Automatic account creation is now enabled. Captcha authentication required for account creation and editing unless you are trusted here.

WiX Properties

From WiX Wiki at MindCapers

Jump to: navigation, search

There are built-in Windows Installer Properties that act as "magic words" in WiX. These properties are documented on the MSDN site under Windows Installer Guide.

Contents

System Folders

Here is the documentation on all those magic system directory names.

ROOTDRIVE and TARGETDIR

Beware that ROOTDRIVE will be set to the writable drive having the most available space. This is not necessarily the C: drive, especially if the user has an external harddrive to facilitate backups. If the drive letter should match the Windows drive, it can be set like so:

 
        <Property Id='ROOTDRIVE' Value='$(env.SystemDrive)' />
 

Properties and the UI

You can't use properties set from the UI in feature conditions unless you make them public and secure, so they get passed from the UI sequence to the Execute sequence. Registry searches get set during AppSearch, which WiX schedules before CostFinalize, so that's why it shows up the second time.

Using Environment Variables with Properties

Question
I need to access environment variable COMPUTERNAME of the TargetComputer and use it to set a property....how do i do that in WIX ? I am using WIX 2.0
Answer
The Formatted topic in the MSI SDK says:
 If a substring of the form [%environmentvariable] is found, the value of the environment
 variable is substituted for the substring.
Personal tools