Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create folders in wix

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>                 
like image 536
Programmer Avatar asked Mar 19 '13 10:03

Programmer


People also ask

Can you make a directory on Wix?

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.


2 Answers

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:" />
like image 89
Programmer Avatar answered Sep 24 '22 23:09

Programmer


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.

like image 32
ChrisPatrick Avatar answered Sep 23 '22 23:09

ChrisPatrick