Wix在运行时有条件地设置环境变量

Wix在运行时有条件地设置环境变量,wix,windows-installer,custom-action,Wix,Windows Installer,Custom Action,我使用的是WIX3.8,我需要检查环境变量是否在运行时设置-如果没有,我需要设置它。如果是,则不能覆盖现有值 据我所见,Wix提供语句和条件预处理器指令。前者似乎用于“只读”类型检查,因为该元素没有符合条件的子元素,例如。后者仅在构建时运行 我是否有其他选项,或者我必须使用自定义操作来完成此操作?提前谢谢 根据,您应该指定一个action=create 创造 Creates the environment variable if it does not exist, then set it du

我使用的是WIX3.8,我需要检查环境变量是否在运行时设置-如果没有,我需要设置它。如果是,则不能覆盖现有值

据我所见,Wix提供语句和条件预处理器指令。前者似乎用于“只读”类型检查,因为该元素没有符合条件的子元素,例如。后者仅在构建时运行

我是否有其他选项,或者我必须使用自定义操作来完成此操作?提前谢谢

根据,您应该指定一个
action=create

创造

Creates the environment variable if it does not exist, then set it during installation. This has no effect on the value of the
环境变量(如果已存在)


你能添加代码来显示你的尝试吗?