Get an environment variable into a WIX property

后端 未结 4 941
粉色の甜心
粉色の甜心 2020-12-06 05:26

Is there a way to get an environment variable in WIX into a property?

I\'m trying to get the USERPROFILE with:

Property Id=\"UserFolder\         


        
4条回答
  •  旧时难觅i
    2020-12-06 05:55

    You can make use of Environment variables during installation but this requires using a custom action. You will need to set the UserFolder property with a Type 51 Custom Action as opposed to setting the property during the build. The [%ENVVARNAME] format is used to make use of an environment variable, but the name of the environment variable is case-sensitive.

    A WiX example of a custom action that sets a property:

    
    

    You can read more on Custom Actions in WiX here:

    http://blogs.technet.com/b/alexshev/archive/2008/02/21/from-msi-to-wix-part-5-custom-actions.aspx

提交回复
热议问题