This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: INSTALLDIR problem
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 28, 2012
01:06 PM
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.
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.
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2012
01:50 PM
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2012
08:00 PM
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.