ek778
ek778

Reputation: 25

Wix Set an Environment Variable Conditionally at Runtime

I'm using Wix 3.8, and I need to check to see if an environment variable is set at runtime - if it is not, I need to set it. If it is, I must NOT overwrite the existing value.

From what I've seen, Wix offers statements, and conditional pre-processor directives. The former seems to be for "read only" type checks, as the element has not eligible child elements, such as . The latter only runs at build time.

Do I have any other options, or must I use a custom action to do this? Thanks in advance!

Upvotes: 1

Views: 1016

Answers (1)

Jeff Paquette
Jeff Paquette

Reputation: 7127

According to the docs, you should specify an action=create

create

Creates the environment variable if it does not exist, then set it during installation. This has no effect on the value of the

environment variable if it already exists

Upvotes: 1

Related Questions