I have an RCP application that uses p2 and needs to run on all of our platforms (this uses 3.4.2). Everything was great until Vista came along. On Vista when going to the Software Updates… dialog it gets the “not properly configured” dialog and won’t let me do the fun p2 stuff.
The problem is that Vista does not like it (sort of) if you try to write things in the Program Files directory. You can write as much as you like only during the install process, and there seems to be some way that it writes a “virtual store” into this area when the app is running, but p2 will not work with this.
The solution that I have found is to (my app is called “osdt”, which is also the name of my launcher executable):
to my Launching Arguments in my product file in the VM Arguments section for all platforms. This tells it to look for the configuration area in a location that’s relative to the Java “user.home” system property (c:/Users/<User name> on Vista and c:/Documents and Settings/<User name> on XP.)
- Add the following into my config.ini file:
- Teach my installer to put the configuration and p2 directories in the expected location. I use install4j – and the key here is to have it come up with the variable setting the location to install these things at install time using the “user.home” system property from Java so that the Eclipse @user.home and where the kit is being installed to will always be in sync.
This makes sure that the p2 data area is relative to the configuration and my workspace is also created relative to the user’s home directory.
All of this was great, but it did not work, and I was finding that no matter what I did to my osdt.ini file it had no effect. The problem was that the Vista “virtual store” mechanism had written my information from the previous installs and that was silently overriding what was in the Program Files folder. In general, if you write something to the Program Files folder, it will really be written to c:/Users/<User name>/AppData/Local/VirtualStore/Program Files, and whatever is at this virtual store location will silently take precedence over what is in the Program Files folder. Once I deleted the stuff in the virtual store location everything was fine.