PDA

View Full Version : QueryProgItem changes returned path



Michael.Marmack
09-28-2012, 11:05 AM
OK here is the situation I am experiencing.

I have a custom action that tries to read the shortcut path of the opposite platform version's shortcut using QueryProgItem.

exa (x86 installer reads the shortcut path of the x64 installation shortcut)

Now this function works fine when 64-bit installation reads the 32-bit shortcut. It returns the correct path and all is well.

however the 32-bit installation changes the returned information. Specifically it changes C:\Program Files\ to C:\Program Files (x86)\

- I have made sure of all variables and even spit them out in my log to make sure the script is reading the correct shortcut (the 32 bit shortcut doesn't even exist at the time this custom action executes).

- I have also made sure the variable svCmdLine is used elsewhere in my script and it is not.


Sample of code used:

nResult = QueryProgItem (szFolderName , svShortcutName, svCmdLine, svWrkDir,
svIconPath, nvIconIndex, svShortCutKey, nvMinimizeFlag);

if (nResult = 0) then

SprintfMsiLog("Shortcut Command Line = " + svCmdLine);

This is a Basic MSI running and Installscript Custom Action. The Custom action is Immediate execute running in Execute phase after ISSetupFilesCleanup (last custom action in sequence) Only Runs on Uninstall.

Also Note I use the same custom action inside an Installscript installation (not MSI) and have not had problems so far.

Michael.Marmack
10-01-2012, 07:28 AM
I have confirmed this happens on both Windows XP 64-bit and on Windows 7 x64.

OldBean
03-15-2013, 09:34 AM
I figured better late than never. You might try this:

Disable(WOW64FSREDIRECTION);