I still don't know how to add the installdir into the PATH of the Windows System Variables after I went through the WIX tutorial.
I tried to use
Environment Id='UpdatePath' Action='create' Name='PATH' System='yes' Value='[INSTALLDIR]'
But there was no change in the Path after I installed the program. I can hardly find sample code of WIX anywhere. Please help me, thanks a lot!
On the Windows taskbar, right-click the Windows icon and select System. In the Settings window, under Related Settings, click Advanced system settings. On the Advanced tab, click Environment Variables. Click New to create a new environment variable.
In the System Properties window, click “Environment Variables.” Click on the variable you'd like to change, click “Edit.” Many environment variables will simply take a name and value, like “Number of processors.” All you have to do to edit them is to change the value, and click “OK.”
You should be able to use:
<Environment Id="PATH" Name="PATH" Value="[INSTALLDIR]" Permanent="yes" Part="last" Action="set" System="yes" />
This should add a new entry to the environment path, set to [INSTALLDIR].
Another thing to note is, Environment
need to be placed inside a component with directory, e.g.
<DirectoryRef Id="TARGETDIR"> <Component Id="Path" Guid="{xxx-xxx-xxx-xxx}"> <Environment Id="PATH" Name="PATH" Value="[INSTALLDIR]" Permanent="no" Part="last" Action="set" System="no" /> </Component> </DirectoryRef>
Details of Wix Element described at Environment Element
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With