UPDATE (2012-02-14): I found out that it's not possible to read environment variables before Install* sequences within CustomActions. This means you cannot read a variable and display it in the UI except you program a exe / dll which returns the variable content... :(
I have created two properties to read the two user defined environment variables %MY_ENV_VAR1% and %MY_ENV_VAR2%. The definition goes like this:
<Property Id="ENV_MYENVVAR1" Value="0"/>
<Property Id="ENV_MYENVVAR2" Value="0"/>
Afterwards I created two custom actions being executed in the UI sequence after the WelcomeDlg:
<CustomAction Id="GET_MYENVVAR1" Impersonate="yes" Return="check" Execute="immediate" Property="ENV_MYENVVAR1" Value="[%MY_ENV_VAR1]"/>
<CustomAction Id="GET_MYENVVAR2" Impersonate="yes" Return="check" Execute="immediate" Property="ENV_MYENVVAR2" Value="[%MY_ENV_VAR2]"/>
<InstallUISequence>
<Custom Action="GET_MYENVVAR1" After="WelcomeDlg">1</Custom>
<Custom Action="GET_MYENVVAR2" After="GET_MYENVVAR1">1</Custom>
</InstallUISequence>
The problem I face is, that the environment variables are not read within the defined custom actions. My UI always displays "0" in the respective text fields. Here is the code for the two controls I use:
<Control Id="Control_EnvVar1" Property="ENV_MYENVVAR1" Type="Edit" X="35" Y="191" Width="240" Height="17"/>
<Control Id="Control_EnvVar2" Property="ENV_MYENVVAR2" Type="Edit" X="35" Y="106" Width="240" Height="17"/>
I am using WiX 3.5.2519.0 and MSI 2.0 as basis for my setup program. The installer is running under Win 7 (x64) Professional incl. SP1, .NET Frameworks version from 2.0 to 4.0 are installed as well and the Windows Installer version is 5.0.
Any help would be really appreciated. Thanks! -moik