cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
senthil_vpc
Level 4

Change Install Location for different Platforms

Hi ,
I am using Destination Dialog to set the installLocation for the product.

I want to display different default destination folder for different platform.
For eg,

For windows:

C:\Program Files\My Company\My Product

For HP-Ux
/opt/My Company/My Product

I am using a IS_DESTINATION variable to retrieve installLocation at runtime.

Please help me know how to change default installLocation depending on the Platform(Windows,AIX,Solaris).

Thanks
Senthil
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

The expression $D(install) expands to the "typical" install location on different platforms (the Program Files folder on Windows, /opt on most other systems (except Mac OS X and OS/400)), which is why you see $D(install) in the default Install Location for the root Product bean.

If you need something different, you could perhaps use a Set Product Bean Property action to change the root Product bean's Install Location property, conditioned so that it runs only on the desired platforms...
0 Kudos
enanrum
Level 9

For my installs on Unix - I default the destination to the cwd by doing this in Begin Install:

   
String installPath;
String DESTINATION_VAR_NAME = "IS_DESTINATION";
String strOSName = arg0.resolveString("$J(os.name)").substring(0,3).toUpperCase();

if(strOSName.equalsIgnoreCase("WIN")){
// set Windows default stuff
}else{ // Unix - set the default install location to cwd.
String cwd= arg0.resolveString("$J(user.dir)");
installPath = arg0.resolveString("$PATH(" + cwd+ "/MyCompany)");
arg0.getServices().getISDatabase().setVariableValue(DESTINATION_VAR_NAME,installPath);
}


Regards,
Tom
0 Kudos