Folders.wxs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
  2. xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
  3. <?include ../Includes.wxi?>
  4. <Fragment>
  5. <!-- For compatibility with command line values from previous versions -->
  6. <Property Id="INSTALLFOLDER" Secure="yes">
  7. <RegistrySearch Id="InstallFolderSearch" Root="HKCR" Key="$(var.RegKeyRoot)" Name="INSTALLFOLDER" Type="raw" />
  8. </Property>
  9. <!-- If a property value has been passed via the command line (which includes when set from the bundle), the registry search will
  10. overwrite the command line value, these actions temporarily store the command line value before the registry search
  11. is performed so they can be restored after the registry search is complete -->
  12. <SetProperty Id="SavedInstallFolderCmdLineValue" Value="[INSTALLFOLDER]" Before="AppSearch" Sequence="first" Condition="INSTALLFOLDER" />
  13. <!-- If a command line value was stored, restore it after the registry search has been performed -->
  14. <SetProperty Action="RestoreSavedInstallFolderValue" Id="INSTALLFOLDER" Value="[SavedInstallFolderCmdLineValue]" After="AppSearch" Sequence="first" Condition="SavedInstallFolderCmdLineValue" />
  15. <!-- If a command line value or registry value was set, update the main properties with the value -->
  16. <SetProperty Id="INSTALLFOLDER_INNER" Value="[INSTALLFOLDER]" After="RestoreSavedInstallFolderValue" Sequence="first" Condition="INSTALLFOLDER" />
  17. <!-- INSTALLFOLDER_INNER is defined for compatibility with previous versions of the installer. -->
  18. <!-- Because we need to use INSTALLFOLDER as the command line argument. -->
  19. <StandardDirectory Id="ProgramFiles6432Folder">
  20. <Directory Id="INSTALLFOLDER_INNER" Name="$(var.Product)" />
  21. </StandardDirectory>
  22. <StandardDirectory Id="CommonAppDataFolder">
  23. <Directory Id="App.Data.Folder" Name="$(var.Product)" />
  24. </StandardDirectory>
  25. <StandardDirectory Id="ProgramMenuFolder">
  26. <Directory Id="App.StartMenu" Name="$(var.Product)" />
  27. </StandardDirectory>
  28. <StandardDirectory Id="DesktopFolder" />
  29. </Fragment>
  30. </Wix>