Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 349834

Summary: @user.home not resolved for osgi.install.area
Product: [Eclipse Project] Equinox Reporter: Szymon Ptaszkiewicz <sptaszkiewicz>
Component: LauncherAssignee: Project Inbox <equinox.launcher-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: aaron.lfoot, melancoleeca, stefan.bolton, strider80, tjwatson, zimmermann.k
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Szymon Ptaszkiewicz CLA 2011-06-20 11:10:42 EDT
According to http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html section Locations, location "osgi.install.area" can be set to "@user.home" value. Unfortunately, this value is not resolved into "user.home" system property. In my case install location was set to "file:/C://@user.home/Application Data/HelloRCP" URL which is incorrect.

Main#getConfigurationLocation() resolves @user.home correctly because it first calls #buildLocation. Main#getInstallLocation() calls #buildURL only and thus omits the resolving part that is done in #buildLocation.
Comment 1 gerald r. CLA 2012-10-03 07:56:09 EDT
is there any workaround for this problem?
Comment 2 Thomas Watson CLA 2012-10-03 08:42:28 EDT
No, unfortunately the install location still does not support variable substitution.
Comment 3 gerald r. CLA 2012-10-03 11:23:25 EDT
(In reply to comment #2)
> No, unfortunately the install location still does not support variable
> substitution.

Is the -install paramter used so seldom?
I think the major feature of this is, to decouple your updates from somehow writesave program folders. 
So using @user.home/someappname for the "new" folder seems natural.
but it feels like i am the only one who struggles with this.

anyway, i am using now "hardcoded" paths which direct to the "alls user" folder.
unfortunately this needs me to deploy different launcher.ini files depending on the windows version.
Comment 4 Aaron L CLA 2012-11-12 15:11:35 EST
The osgi.install.area must be specified in order to have a custom splash screen show up when deploying an RCP application via Java Web Start.

However, because of this bug, when using a JNLP that creates a shortcut to the application on the user's desktop, the install.area folder is also created on the desktop instead of the desired location in the user's home directory.

It would be greatly appreciated if the install.area value could use/resolve "@user.home" since we cannot hard code this value, as we do not know what the location should be until the user is launching the application.

This bug prohibits us from utilizing some of the more useful branding and deployment features provided by deploying our product via Java Web Start.
Comment 5 Henno Vermeulen CLA 2014-04-28 05:03:12 EDT
I ran into the same problem while trying to get the splash screen working with Java webstart. I worked around it by using a custom Webstart launcher with a main method that resolves the property and then calls the usual WebStartMain:

import java.util.Properties;
import org.eclipse.equinox.launcher.WebStartMain;

public final class WebStartLauncher {

	public static void main(String[] args) {
		workaroundEclipseBug349834();
		WebStartMain.main(args);
	}

	/**
	 * Workaround Eclipse "user.home" <a
	 * href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=349834">bug</a> where
	 * the placeholder is not resolved for system property
	 * <code>osgi.install.area</code>.
	 */
	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")));
		}
	}
}
Comment 6 Eclipse Genie CLA 2019-09-19 14:31:59 EDT
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.