I want to create a folder in C drive and then create some sub folders inside that folder in the wix installer program. But these folders are not related with installed folder. . My program want to install inside the AServiceSetup folder...but i want to create a 'PTLogFile' folder inside the C drive and then want to create some sub folders inside that folder. Please any one help me to correct my code.Following is my code
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="PTLogFile" Name="PTLogFile">
<Directory Id="Backups" Name="Backups"/>
<Directory Id="CommandLog" Name="CommandLog"/>
<Directory Id="EventLog" Name="EventLog"/>
<Directory Id="Responds" Name="Responds"/>
</Directory>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="AServiceSetup">
</Directory>
</Directory>
</Directory>
</Fragment>
Go to My Sites in your Wix account. Click Create New Folder at the top right. Enter a name for the folder and click Create.
Thank you for your replies. I got the answer from the above replies Directory structure as follows
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="LogFile" Name="LogFile">
<Directory Id="Logs" Name="Logs">
<Directory Id="Log1" Name="Log1"/>
<Directory Id="Log2" Name="Log2"/>
<Directory Id="Log3" Name="Log3"/>
<Directory Id="Log4" Name="Log4"/>
</Directory>
</Directory>
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="AServiceSetup">
</Directory>
</Directory>
</Directory>
And Component as follows
<Component Id="CreateLogFolders" Guid="....." Directory="LogFile" >
<CreateFolder Directory="LogFile" />
<CreateFolder Directory="Logs"/>
<CreateFolder Directory="Log1"/>
<CreateFolder Directory="Log2"/>
<CreateFolder Directory="Log3"/>
<CreateFolder Directory="Log4"/>
</Component>
and this component reference inside the feature of the product as follows
<ComponentRef Id="CreateLogFolders"/>
Finally add a property inside the product as follows
<Property Id="LogFile" Value="C:" />
While you have defined a directory structure, the installer is only going to create directories that are required by components.
A simple option is to add a component like the following:
<Component Id="CreateLogFolders" Directory="PTLogFile">
<CreateFolder Directory="PTLogFile" />
<CreateFolder Directory="Backups" />
<CreateFolder Directory="CommandLog" />
<CreateFolder Directory="EventLog" />
<CreateFolder Directory="Responds" />
</Component>
and reference this component in one of your features.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With