Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a directory in wix?

My requirement is to create a directory in programdata/test/example. How can I do that in wix?

like image 561
Prakash Avatar asked Jun 02 '12 07:06

Prakash


People also ask

Can I create 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.

How do I create a list on Wix?

In the Wix Editor, click “Add” in the left-side menu, and choose “List Builder. ”Choose the type of list you want to add. You can use one of the presets or build a new list with the Blank option.


2 Answers

Define the folder like this:

<Directory Id="TARGETDIR" Name="SourceDir">     <Directory Id="CommonAppDataFolder">         <Directory Id="TestFolder" Name="test">             <Directory Id="ExampleFolder" Name="example" />         </Directory>     </Directory> </Directory> 

The important part here is the CommonAppDataFolder Id, which is known by Windows installer. You can find the full list of known system folders in the Windows Installer Property Reference.

If you install any files to that folder, it will be created implicitly. If not, you can force it to be created by installing a component like this:

<Component Id="CreateTestFolder" Directory="ExampleFolder" Guid="PUT-RANDOM-GUID-HERE">     <CreateFolder /> </Component> 
like image 116
Wim Coenen Avatar answered Oct 04 '22 20:10

Wim Coenen


Under <Product> you can enter:

   <DirectoryRef Id="TARGETDIR">       <Directory Id="CommonAppDataFolder">         <Directory Id="CommonAppXXXX" Name="test">           <Directory Id="CommonAppYYYY" Name="example">             <Component Id="CreateProgramDataZZZ" Guid="ABC-ETC">               <CreateFolder />             </Component>           </Directory>         </Directory>       </Directory>     </DirectoryRef> 

And reference the component CreateProgramDataZZZ in your feature.

It can also be helpful to set permissions on the directory like this:

<CreateFolder>     <util:PermissionEx User="Users" GenericAll="yes" /> </CreateFolder> 

(in place of <CreateFolder />)

like image 34
noelicus Avatar answered Oct 04 '22 18:10

noelicus