Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 2

Unable to use path retrieved from Registry Key for INSTALLDIR

My intention is to set the INSTALLDIR to a path retrieved from a Registry Key, as well as appending subfolders.

First, I set up a System Search for:
- Folder path, as specified by registry entry
- Registry Key: SOFTWARE\Company\CompanyFolder
- Registry Value: InstallPath
- I also select the "Search 64-bit portion of the Registry"

I store the value into property SDIR64, and select "Store the value in the property and use the property in an Install Condition"
For the Condition, I simply enter the property SDIR64, and the Message is logging INSTALLDIR and SDIR64 properties.

Then, I create a Custom Action (New Set Directory) and name it SetSDIR64InstDir
Directory Name: INSTALLDIR
Directory Value: [SDIR64]subfolder1\subfolder2
Return Processing: Synchronous (check exit code)
Execution Scheduling: Always execute
MSI Type number: 35
Install Exec Sequence: After CostFinalize


When I run the MSI, the message box appears and there are no values displayed for INSTALLDIR or SDIR64.
I click ok, and the wizard quits.

From the MSI log, it appears that AppSearch did indeed find the path from the registry key. It does some expansion for the 32 bit folder naming convention, but all in all, yielded a value.

MSI (c) (3C:44) [11:45:58:597]: Doing action: AppSearch
Action 11:45:58: AppSearch. Searching for installed applications
Action start 11:45:58: AppSearch.
AppSearch: Property: SDIR64, Signature: NewSignature1
MSI (c) (3C:44) [11:45:58:598]: Note: 1: 2262 2: Signature 3: -2147287038
MSI (c) (3C:44) [11:45:58:598]: WIN64DUALFOLDERS: 'C:\Program Files (x86)\' will substitute 17 characters in 'C:\Program Files\Company\CompanyFolder\' folder path. (mask argument = 0, the folder pair's iSwapAttrib member = 0).
Action ended 11:45:58: AppSearch. Return value 1.

MSI (c) (3C:44) [11:45:58:598]: Doing action: LaunchConditions
Action 11:45:58: LaunchConditions. Evaluating launch conditions
Action start 11:45:58: LaunchConditions.
Info 2898. For Tahoma8 textstyle, the system created a 'Tahoma' font, in 0 character set.
InstallDir: SDIR64:
MSI (c) (3C:44) [11:47:03:043]: Product: MyProduct -- InstallDir: SDIR64:

Action ended 11:47:03: LaunchConditions. Return value 3.
MSI (c) (3C:44) [11:47:03:053]: Doing action: SetupCompleteError
Action 11:47:03: SetupCompleteError.
Action start 11:47:03: SetupCompleteError.
Info 2898. For TahomaBold10 textstyle, the system created a 'Tahoma' font, in 0 character set.
Action 11:47:03: SetupCompleteError. Dialog created
MSI (c) (3C:80) [11:47:03:084]: Note: 1: 2731 2: 0
Action ended 11:47:31: SetupCompleteError. Return value 2.
Action ended 11:47:31: INSTALL. Return value 3.

Why does AppSearch seem to pull the correct value, but the Property created (SDIR64) does not reflect the value retrieved? Is there a step or scope issue I may be overlooking?

Any help is appreciated, thanks much!
Labels (1)
0 Kudos
1 Reply
Level 2

Just wanted to update, I was able to get past this blocker. The issue was attempting to install a 32 bit installer on a 64 bit system.
I had selected "Search 64" in the System Search, and while it appeared it was yielding a value, the 32 bit installer was not taking it.
Once I had built a 64 bit installer, the correct value was stored in the property and I was able to use it to build my INSTALLDIR.

This website helped me get a start on how to build 32 and 64 bit installers.
0 Kudos