PDA

View Full Version : $D(<my_own_here>) named directories



dszar12
05-12-2003, 07:40 PM
Is it possible to define my own named directory variable? The
current ones of $D( install, temp, lib, etc.. ) are fine but, I
would like to add (define) my own.

Or is it possible to re-define the ones that already exist? I am
packaging for Solaris and Win32 and cannot use $D(install) of
/opt and /Program Files. I know the user can change the install
destination at install time but, I have a picky employer that insist
on having a different install directory as the default. I know I
should NOT hard-code this. Trying to find a work-around.

Any help would be appreciated.

Thanks.

Jeff Dillon
05-12-2003, 10:00 PM
This is a great suggestion and I am personally pushing to see this in the future.

A couple possible options...

1) (Custom Code) - You can define your own string resolvers. So that $MYDIR(whatever) will resolve to whatever you want based on the platform. See the source code for the $E environment variable string resolver which creates a $E resolver for 4.5x at...

http://www.installshield.com/downloads/beans.asp?prod=mpf

2) (No code solution) - Add several "Set Product Bean Property" wizard actions to the beginning of your installer sequence. In these actions set the root install location to each directory that you want. Now place platform conditions on each of these actions so that only the appropriate one gets executed.

rohithaksha
07-01-2003, 06:56 AM
I would like to change the default value of $D(install) on Linux to Users home directory (~).
What variable and bean I need to refer to do this ?

PS: I don't have write permission for my /opt folder on Linux. So my installer is failing. In fact I am changing the install location to my home folder in destination panel. Still it is failing. What could be the esiest solution ?

RobertDickau
07-01-2003, 08:23 AM
As Jeff Dillon mentions, there's no straightforward way. One relatively easy option would be to define a Java system property (say, ismp.installdir) that you would set to be the value of $D(install) on every platform but Linux, where you would set it to $J(user.home); and then use $J(ismp.installdir) in the root Product bean's Install Location setting.

jspirn
07-17-2003, 08:32 PM
2) (No code solution) - Add several "Set Product Bean Property" wizard actions to the beginning of your installer sequence. In these actions set the root install location to each directory that you want. Now place platform conditions on each of these actions so that only the appropriate one gets executed.

This is a good suggestion, but has the flaw that any vpd.properties entry about where the product was previously installed will be ignored. If you want to set a per-platform default location, but still pick up the location of any prior install, then the following works for me:

In the main product bean in the product tree, enter something "impossible" for the Install Location. For example, enter "product_default". Then, in the wizard tree, add any number of "Set Product Bean Property" panels just before the destination panel . Each of these beans should have two conditions: an appropriate platform condition, and a String Comparison condition which checks that $P(productname .installLocation) must match "product_default". This seems to work perfectly.

Jeff

wohler
03-09-2005, 05:13 PM
As Jeff Dillon mentions, there's no straightforward way. One relatively easy option would be to define a Java system property (say, ismp.installdir) that you would set to be the value of $D(install) on every platform but Linux, where you would set it to $J(user.home); and then use $J(ismp.installdir) in the root Product bean's Install Location setting.

Robert, I need to change the value of $D(install) on Windows to c:\ (actually, it would be preferred to use the SYSTEM_DRIVE environment variable instead of hardcoding c: ) . How is that done?

RobertDickau
03-09-2005, 11:11 PM
I don't think you can redefine an existing $D value; I expect you'd still need to define your own, say, $J expression, setting it to $D(install) for most platforms and $E(SystemDrive) for Windows systems...

wohler
03-10-2005, 01:46 AM
Thanks, Robert.

While it would be nice to simply override $D(install) so that I could take of InstallShield's default actions for initializing $P(absoluteInstallDir), I can simulate that by using the contributed AlreadyInstalledCondition to only override the installation directory on a fresh installation. At least, this is what I've done and it seems to be working so far.