Dave Combs
Dave Combs

Reputation: 401

WiX - validating a path that is not the installation directory?

As part of my WiX-based installation, I need to ask the user to enter the value for a property, JAVA_LOC, which I'm going to store as a registry value (it is NOT a directory I want to create on the install.) However, if I use the Publish Event="SetTargetPath", the linker says that I must declare JAVA_LOC as a directory in the component hierarchy. If I do that, things I can record the path okay. However, it turns out that if I run a 'Change' install afterward, the new path value is ignored, and JAVA_LOC is reset to the location of the JAVA_LOC directory I was forced to create.

How does one validate a path the user has entered that isn't for the install directory? Remember, I'm just trying to store it in the registry, not really create a dir for it.

Dave

Upvotes: 2

Views: 1227

Answers (1)

Christopher Painter
Christopher Painter

Reputation: 55591

The SetTargetPath control event can only take a primary key from the Directory table as an argument. You would have to define the directory to be able to use this. Nothing says that the dirctory has to have a CreateFolder entry and/or any File resources. I'd think you could nest your component with the registry data under this directory and it should all work without creating the directory.

Upvotes: 3

Related Questions