简体   繁体   中英

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>

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM