I am working on a java application that targets both mac and PC. Recently I discovered a strange problem with Windows 7. My application has a projects directory that is not uninstalled by my uninstaller. Recently I uninstalled the application and then manually deleted this projects directory, then reinstalled the application. When I opened an AWT open dialog file chooser inside the application (this file chooser is used to open existing projects), inside the file chooser I could see project directories that existed in the project directory I had deleted but do not exist in the Windows explorer. So for example I had a project called mojo that was in the projects directory I had deleted but was not contained in the projects directory installed by my installer but when going through the file chooser I could see it (it did not show up when looking at it with the explorer).
This problem only occurs on Windows 7 so I assume this must have something to do with virtual directories but this is a topic I am not well versed on so I was wondering if anyone could help me shed a little light onto this problem.
Windows Vista and Windows 7 both prevent normal users from writing to the Program Files directory by default. Instead, they redirect writes to the User’s AppData\Local\VirtualStore directory.
If this is the case, the easiest solution is… don’t write to Program Files, but instead to a user’s home directory (the
user.homesystem property can be some help there) or to the location that the user chooses.Now, the other quirk is that the Windows common file dialogs will not show these files. I’m not sure that the AWT open dialog would either, so it may be something entirely different going on.