Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create folder inside C:\ProgramData using WIX installer and deploy few configuration files in that folder

i tried with following code, But ProgramData folder is not getting created while installing. My requirement is to install some files in install directory provided by user and deploy few configuration files in ProgramData folder(C:\ProgramData\COMPANYNAME\APPNAME). Code is given below. Can anyone help me to identify the issue? or another solution to achieve this.

 <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="APPNAME" />
      </Directory>

      <Directory Id="CommonAppDataFolder">
        <Directory Id="CommonAppDataManufacturerFolder" Name="COMPANYNAME">
          <Directory Id="MyAppDataFolder" Name="APPNAME">
          </Directory>
        </Directory>
      </Directory>
    </Directory>
  </Fragment>
like image 503
Nikhil Arackal Sivadas Avatar asked Jun 09 '16 12:06

Nikhil Arackal Sivadas


2 Answers

You need a feature containing a component installing into the MyAppDataFolder directory for the installer to implicitly create the folder during installation. With no component installing there the folder won't be created.

Just defining a Directory structure is not good enough to get those folders to be created.

like image 129
Brian Sutherland Avatar answered Sep 17 '22 22:09

Brian Sutherland


It's not required to copy files into the folder to create the folder. You just need specify the element.

For instance..

  <Fragment>
    <Component Id="FolderComponent" Directory="BackupFolder" Guid="GUID" Win64="yes">
      <CreateFolder />
    </Component>
  </Fragment>
like image 28
stoj Avatar answered Sep 20 '22 22:09

stoj