[wix-users] Set Directory in WiX
venh.123 at gmail.com
Sun Jan 28 23:59:47 PST 2018
I am trying to create a folder at a location different from the application
installation location which happens to be C:\Program Files(x86). I am using
the following fragment
<Directory Id="PhotosDir" Name="Photos" />
<!--<SetDirectory Id="PhotosDir" Value="[TARGETDIR]Photos"
I tried with a SetDirectory element as shown above and also with a
CustomAction as shown below. (If I use both, I get an error saying Id is
duplicated. Hence I commented it.)
<CustomAction Id="SetPhotosDir" Directory="PhotosDir"
<Custom Action="SetPhotosDir" Before="CreateFolders"/>
I have a component also defined for this directory element as below.
But the directory called Photos is always getting created in D drive,
even though it is nested inside of TARGETDIR. I actually want to control
the location where this directory gets created, probably through UI. I
googled for SetDirectory element example, but couldn't find a proper
working sample. All I get to see is that I have to use a custom action type
35 or 51. But it is not clear what code should go inside of these custom
actions. Also, I am not sure, if these custom actions are required in
addition to the SetDirectory element or not. Can anyone please help me
achieve this, with some working sample?
More information about the wix-users