How to install the application in a user folder using the wix installer, except for the Program Files folder

I created the installer using wix. By default, the application is installed in the Program Files folder. I need to create a folder for my application in the directory c:and install my application there.

<Fragment>
      <Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="WINDOWSVOLUME" >
    <Directory Id="INSTALLLOCATION" Name="WIXDemoApp">
    </Directory>
  </Directory>
</Directory>

<SetDirectory Id="WINDOWSVOLUME" Value="c"/>

<Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">

        <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
         <Component Id="MyApplication.exe">
     <File Source="$(var.MyApplication.TargetPath)" Name="MyApp.exe" Id="MYAPPEXE" KeyPath="yes"  />
            <!-- TODO: Insert files, registry keys, and other resources here. -->
         </Component> 
    </ComponentGroup>
</Fragment>

I get the following error " error LGHT0094: Unresolved reference to symbol 'Directory:INSTALLFOLDER' in section 'Fragment:'".

Update:

<Fragment>
          <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="WindowsVolume" >
        <Directory Id="INSTALLLOCATION" Name="WIXDemoApp">
        </Directory>
      </Directory>
    </Directory>

    <SetDirectory Id="WindowsVolume" Value="c"/>
  </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLLOCATION">

            <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
             <Component Id="MyApplication.exe">
         <File Source="$(var.MyApplication.TargetPath)" Name="MyApp.exe" Id="MYAPPEXE" KeyPath="yes"  />
                <!-- TODO: Insert files, registry keys, and other resources here. -->
             </Component> 
        </ComponentGroup>
    </Fragment>

This gives me another error "error LGHT0204: ICE99: The directory name: WindowsVolume is the same as one of the MSI Public Properties and can cause unforeseen side effects.. "Googled and refereed this and this to fix it. But it doesn’t work for me, but I get the same error as" error LGHT0204: ICE99: directory name: WindowsVolume is one of the public properties MSI and can cause unforeseen side effects. "Any idea what the problem is.

+4
2

Windows , WINDOWSVOLUME . - :

<Fragment>
  <Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramFilesFolder">
      <Directory Id="INSTALLLOCATION" Name="SetupProject1" />
    </Directory>
  </Directory>

  <SetDirectory Id="INSTALLLOCATION" Value="[WindowsVolume]SetupProject1" />
</Fragment>

: INSTALLFOLDER INSTALLLOCATION. .

+4

kentie.net - Wix. WINDOWSVOLUME.

TARGETDIR

(, "C:\application" ), , -

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="INSTALLLOCATION" Name="SetupProject1">
    </Directory>
</Directory>

TARGETDIR , ProgramFilesFolder TARGETDIR. ; TARGETDIR . . , :

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="WINDOWSVOLUME" >
        <Directory Id="INSTALLLOCATION" Name="SetupProject1">
        </Directory>
    </Directory>
 </Directory>

<SetDirectory Id="WINDOWSVOLUME" Value="[WindowsVolume]"/> 

SetDirectory , WindowsVolume

error LGHT0204: ICE99: : WindowsVolume MSI . MSI

+2

All Articles