Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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\

like image 648
Rob Hunter Avatar asked Apr 11 '11 15:04

Rob Hunter


People also ask

What are WiX fragments?

The Fragment element is the building block of creating an installer database in WiX. Once defined, the Fragment becomes an immutable, atomic unit which can either be completely included or excluded from a product.

How do I use heat EXE on WiX?

Navigate to WiX's bin directory from a command prompt and type heat.exe -? to see information about its usage. To make things easy, consider adding the path to the WiX bin directory to your computer's PATH environment variable so that you won't have to reference the full path to the executable each time you use it.


1 Answers

Use [!idOfFile] to get the full short path. (See Formatted in MSI SDK for the full list of special formatting keys.)

like image 143
Bob Arnson Avatar answered Nov 09 '22 13:11

Bob Arnson