Community
Participate
Working Groups
Currently we are using the arguments -data @user.home/myapp -configuration @user.home/myapp/configuration in our launcher file or as launcher argument (when using webstart). For windows-systems I'd like to specify -data $APPDATA$/myapp -configuration $APPDATA$/myapp/configuration because this the default location on windows systems and is most cases on the local drive where @user.home can point to a limited network share. I've already tried the arguments above but the result was a new folder $APPDATA$ in my application folder. :-)
The arguments in the launcher-files org.eclipse.equinox.launcher.Main org.eclipse.equinox.launcher.WebStartMain should be patched with something like this: <pre> private static String[] substituteVars(String[] args) { if (args == null) return args; String[] patched = new String[args.length]; for (int i = 0; i < args.length; i++) patched[i] = org.eclipse.equinox.launcher.Main.substituteVars(args[i]); return patched; } </pre> Because WebStartMain extends Main and both seems to call run() it's maybe enough to do args = substituteVars(args); at first statement.
I've trid this locally by checking out the launcher-projects, adding this method and args = substituteVars(args); as first command in run() private static String[] substituteVars(String[] args) { if (args == null) return args; final String[] patched = new String[args.length]; for (int i = 0; i < args.length; i++) { if (args[i] != null) patched[i] = substituteVars(args[i]); else patched[i] = null; // should never happen (theoretically) } return patched; } This patch works with $APPDATA$ in launcher.ini, as command-line argument and also in jnlp as program argument. I someone has doubts about this patch a check of a system-property (e.g. org.eclipse.equinox.launcher.enable_variable_substition could be added to the code)
Created attachment 251986 [details] Patch for R3_8_maintenance I've tried the patch in R3_8_maintenance-branch because this is the version we use.
I've set the importance to major because our app (also eclipse) becomes slow if @user.home points to a network drive. With the patch we want to replace @user.home with $APPDATA$ on windows systems to ensure a faster startup (btw. APPDATA is the prefered folder on windows-systems for application specific files)
Possible duplicate of bug 349834 Sorry for the late reply. We've run into the same issue and worked around it by making our own web start launcher that sets Java's user.home system variable to Windows' LOCALAPPDATA environment variable: private static void workaroundJavaBug6519127() { String userProfile = System.getenv("LOCALAPPDATA"); if (userProfile != null) { System.setProperty("user.home", userProfile); } } You will also have to work around Bug 349834 by doing something like private static void workaroundEclipseBug349834() { String key = "osgi.install.area"; String installArea = System.getProperty(key); if (installArea != null) { System.setProperty( key, installArea.replace("@user.home", System.getProperty("user.home"))); } }
Thanks for your reply. I think patching the launcher would work but unfortunately only for webstart. With my submitted patch it works for the default client and webstart too and gives users and administrators the abillity to configure the directories.
Am I really the only one who needs this feature?
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.