Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid deprecated Windows function #5

Closed
henryx opened this issue Aug 30, 2018 · 3 comments
Closed

Avoid deprecated Windows function #5

henryx opened this issue Aug 30, 2018 · 3 comments
Assignees
Milestone

Comments

@henryx
Copy link

henryx commented Aug 30, 2018

As reported in http://msdn.microsoft.com/en-us/library/bb762181%28VS.85%29.aspx, the function is deprecated. Please, consider to change with new method or, better, validating the environment variables (here you can view a summary this: https://stackoverflow.com/a/39868933/5695585)

@harawata
Copy link
Owner

Hi @henryx ,

I'm sorry for the belated reply!

As you suggested, I rewrote it to call the new function (i.e. SHGetKnownFolderPath) first.
And when it fails (it will on pre-Vista), the old function is called.

It seems to be working on Windows 7, but I don't have pre-vista Windows machine to test the fallback behavior, unfortunately.
So, I would appreciate if you (or someone who has some spare time) could test the latest 1.0.2-SNAPSHOT on pre-Vista OS.

If you use Maven, add the snapshot repository to the pom.xml...

<project>
...
  <repositories>
    <repository>
      <id>sonatype-snapshot</id>
      <name>Sonatype OSS Snapshot Repository</name>
      <url>http://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>
...
</project>

...and specify 1.0.2-SNAPSHOT as appdirs version.

<dependency>
  <groupId>net.harawata</groupId>
  <artifactId>appdirs</artifactId>
  <version>1.0.2-SNAPSHOT</version>
</dependency>

Please let me know if there is any difficulty.

@henryx
Copy link
Author

henryx commented Dec 17, 2018

I'm sorry for my delay.

Sadly, I haven't a machine with a pre-Vista Windows OS, so, I can't able to test the library. A good solution is to mantain the old code for fallback and use it if the OS is pre-Vista. If the rewrite use this fallback, test is optional

@harawata
Copy link
Owner

No worries. Maybe no one uses such old OS. 😁
And yes, the old code is still there as a fallback.

I have released 1.0.2, so let's see what happens.
Thank you for your help!

@harawata harawata self-assigned this Dec 18, 2018
@harawata harawata added this to the 1.0.2 milestone Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants