cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DataAnalyzer
Level 8

INSTALLDIR is not C:\Program Files (x86) if user Select C:\Program Files for 32-bit

Our setup program lets users specify the folder to install the program. If they choose C:\program files on a 64-bit system, our INSTALLDIR value is set to that. However, the files get installed in the C:\Program Files (x86) folder. We need the INSTALLDIR variable (or some other variable) to reflect the actual folder name where the file is installed since we need to update registries, shortcuts, etc. to reflect this.

How do we get the actual folder name when InstallShielld makes that change behind the scenes? Thanks.
Labels (1)
0 Kudos
(21) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The behavior you are seeing with the Program Files folder is a direct function of Windows Installer (for MSI projects) when installing a 32-bit package. However, there should be no inconsistency with the value of INSTALLDIR across the installation after it has been changed by a user through a runtime dialog.

Before a solution to this issue can be provided, the following information is necessary:

  • Please clarify the project type you are using. InstallScript and InstallScript custom actions have been mentioned a few times but the actual project type has not been clearly provided. With the project open in InstallShield, the title bar will indicate which project type is being used (which is likely Basic MSI or InstallScript MSI). Without the correct project type we are guessing as to what could be the next step to take or why the behavior could be occurring.
  • How are you setting registry entries or shortcuts in your project to use INSTALLDIR? Are these items configured through their corresponding views in the project, or are they created/modified through custom actions?
  • Assuming this is an MSI based project, a verbose log file should be created to determine the value of INSTALLDIR throughout the installation. If the log either shows the wrong value being set back in INSTALLDIR or it shows a consistent and expected value for INSTALLDIR throughout the install, then something else besides INSTALLDIR is the cause of the behavior. A verbose log can be created with one of the following command lines:

For Basic MSI projects only

setup.exe /v"/l*v C:\PathToLog\logfile.log"

-- or --
msiexec.exe /i C:\PathToMsiPackage\MsiPackage.msi /l*v C:\PathToLogFile\logfile.log


InstallScript MSI projects only

setup.exe /verbose"C:\PathToLogFile\logfile.log"


Please attach the log to this thread.

(On a side note: This behavior will not occur with pure InstallScript projects as InstallScript does not have any concept of 32/64-bit packages and InstallScript does not perform any processing of installation paths. InstallScript also does not use an INSTALLDIR variable/property. The only behavior that can be an issue is due to the Windows file system redirector which will only affect the System32 folder.)
0 Kudos