[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[p2-dev] Installing a product with P2 on external location

Hello,
 
I’m using the P2 for installing a product.
I wanted to install on external location, so I set the properties
org.eclipse.equinox.p2.installFolder and eclipse.p2.bundleLocation with the desired location.
However the product continued to be installed on the default location until I found in the code in org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util :
public static URI getBundlePoolLocation(IProvisioningAgent agent, IProfile profile) {
                String path = profile.getProperty(IProfile.PROP_CACHE);
                if (path != null)
                        return new File(path).toURI();
                IAgentLocation location = getAgentLocation(agent);
                if (location == null)
                        return null;
                return location.getDataArea(Activator.ID);
        }
After setting the cache property IProfile.PROP_CACHE, the installation on external location worked fine.
It turns out, I have to set the cache location in order to change the install location.
 
So my question is, was this behavior intentional and is it documented somewhere (I could not find it)?
Since it is not the first thing that comes to your mind: to set a cache when you have a self-explanatory  property as installFolder and it took some debugging to figure it out.
 
For installation I’m not using the installer, nor the director application.
I create a profile, in which I set the above mentioned properties.
I use the planner api to create a plan and pass the plan to the engine to perform.
 
 
Thanks and regards,
Elena