问题
I am trying to register an out-of-process COM file (.exe) through WiX after extracting the COM registration from regspy.exe, and am running into the problem that the registry key I need to write is:
<RegistryValue Value="C:\PROGRA~1\COMMON~1\file.exe /Automation" Type="String" />
Now I would like to use the Windows Installer property [CommonFilesFolder] as not everyone installs to C:\
For an in-process (.dll) the long name is acceptable:
<RegistryValue Value="[CommonFilesFolder]file.dll" Type="string" />
But it appears this in not true for out-of-process. Is there a way to convince or convert [CommonFilesFolder] to the short name? This is a particular problem for x64, as the name will resolve to C:\PROGRA~2\ instead of C:\PROGRA~1\
回答1:
Use [!idOfFile] to get the full short path. (See Formatted in MSI SDK for the full list of special formatting keys.)
来源:https://stackoverflow.com/questions/5623591/how-do-i-get-a-shortname-for-a-folder-in-wix-for-a-windows-installer-property