cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
SirLance
Level 3

INSTALLDIR problem

I have a Basic MSI project. I am doing a major upgrade from a previous msi created using a different install package. The issue I am having is if the previous package was installed to a directory other than the default location my new package is not retaining that location as INSTALLDIR. (per se - the log files do show it getting correctly set - in my humble opinion))

I created an InstallScript CA that runs in the UI Sequence. It's purpose is to collect the user data and retain it if the product had been previously installed. One of those things is the install location. Let's say the user installed to c:\app when the default path was c:\program files\app. My InstallShield CA would get that information and then I do:
MsiSetTargetPath ( ISMSI_HANDLE , INSTALLDIR , svAPP_LOCTN );

I am also setting a property with the location:
MsiSetProperty ( ISMSI_HANDLE , "APPLOCTN", svAPP_LOCTN );

And I set another property called UPGRADE. The UPGRADE property is used to bypass the DestinationFolder dialog since I already have that location.

I have this project setup as a major upgrade and if it finds the previous version it goes through the uninstall. The problem I am having is that now it reverts back to the default installation directory (ie - c:\program files\app) instead of the previous location of the install (c:\app). Since the destination directory is bypassed the user has no option of where to direct the install. If this is not an upgrade and I run the install and select a different installation location, it installs properly into that selected location.

I mentioned before I also set a property called APPLOCTN and I created a CA with a Property Name of INSTALLDIR and a property value of [APPLOCTN]. I have then added a DoAction to the Next button on InstallWelcome and I have tried it on the ReadyToInstall Dialog. Now, I get my top level files in the user defined directory but any subfolders and their files still go to the default install directory.
Labels (1)
0 Kudos
(2) Replies
SirLance
Level 3

I ended up with InstallShield Support about this. Turns out they were puzzled by why this was happening and felt I had everything setup correctly. As we threw around some dieas, one of the techs suggested I do a SetDirectory CA instead of the SetProperty. Changing that resolved the issue.
0 Kudos
TsungH
Level 12

Once directory resolution is performed during CostFinalize action, one should use Custom Action Type 35, instead of Custom Action Type 51, to set the value of the directory. For details, please refer to Changing the Target Location for a Directory.
0 Kudos