0
votes

i have following condition for wix installer: - Starting Installer directory for install should be RootDirectory\ApplicationName [C:\MYApplication] - User should able to customize this path (using pathedit or any textbox )

I've done following code but problem is half of installation is done at specified path and half of folder is copied in the root directory.

<Fragment>
<Property Id="_BrowseProperty" Value="INSTALLDIR" Secure="yes"/>
<CustomAction Id="SetDataLocationDefault" Property="INSTALLDIR" Value="[WindowsVolume]$(var.Title)\" />
<InstallUISequence>
  <Custom Action="SetDataLocationDefault" After="CostFinalize" />
</InstallUISequence>
<InstallExecuteSequence>
  <Custom Action="SetDataLocationDefault" After="CostFinalize" />
</InstallExecuteSequence>

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="INSTALLDIR" Name="$(var.Title)">
    <Directory Id="ProgramMenuFolder">
      <Directory Id="ApplicationProgramsFolder" Name="$(var.Title)"/>
    </Directory>
  </Directory>
  <Directory Id="DesktopFolder"/>
</Directory>

Another file for the component includes

<Fragment>
<ComponentGroup Id="ProductInstallComponent">
  <ComponentRef Id="EXEPackage" />
  <ComponentRef Id="ProjectsOutput" />
  <ComponentRef Id="TempReports" />
  <ComponentRef Id="Help" />
  <ComponentRef Id="ApplicationShortcut" />
  <ComponentRef Id="ApplicationDeskShortcutComp" />
</ComponentGroup>

in the case Help Files and Report Files are created at the rootlocation. so how can i change that?

1

1 Answers

0
votes

AFAIK such an action has to be set before the CostFinalize-action, as afterwards all the directories are set and unmutable. Also set it in both sequences, as you already did in the example above. I.e. it should be the following:

<InstallUISequence>
  <Custom Action="SetDataLocationDefault" Before="CostFinalize" />
</InstallUISequence>
<InstallExecuteSequence>
  <Custom Action="SetDataLocationDefault" Before="CostFinalize" />
</InstallExecuteSequence>