How do I get a shortname for a folder in WiX for a Windows Installer property?

只谈情不闲聊 提交于 2019-12-22 07:44:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!