Reputation: 86
I'm creating an install wizard and i have a page where you can choose where you want to install the program. In my c# class i have InstallPath that keeps the exact directory i want to install the program.
By default it's c:\Program Files.
In my WiX setup file i have that:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id ="Folder" Name="SomeFolder"/>
</Directory>
</Directory>
My problem is that i don't know how to tell this Wix setup to install in InstallPath. For example if InstallPath is changed to D:\SomeFolder\Here I want to install there not in Program Files again.
Upvotes: 0
Views: 1529
Reputation: 9
to change the path is:
<Product Id="*">
<Property Id="ROOTDRIVE">
<![CDATA[D:\]]>
</Property>
</Product>
and for the new path D:\SomeFolder\Here, will be something like this.
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="SomeFolder" Name="SomeFolder">
<Directory Id="INSTALLFOLDER" Name="Here"/>
</Directory>
</Directory>
greetings,
Upvotes: 0
Reputation: 10080
You can use one of these custom action to change the property value during install:
For example:
<CustomAction Id="ChangeDir" Directory="INSTALLFOLDER" Value="[SomeValueorPropertyhere]"/>
2.Schedule the action during the InstallExecution phase (must be after the CostFinalize step):
<Custom Action="ChangeDir" After="CostFinalize"></Custom>
Upvotes: 1