options.wxs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
  2. <Fragment>
  3. <!-- Hold the "CMAKE_IN_PATH" checkbox value in a public property to propagate to the InstallExecuteSequence. -->
  4. <Property Id="CMAKE_IN_PATH" Value="Init" />
  5. <!-- Always initialize the checkbox value so it cannot be directly overridden from the command line. -->
  6. <SetProperty Action="Set_CMAKE_IN_PATH_Init" Id="CMAKE_IN_PATH" After="AppSearch" Sequence="first" Value="1" />
  7. <!-- Read the "CMAKE_IN_PATH" checkbox value from the registry, if it was stored previously.
  8. Properties using RegistrySearch cannot be private, so use a private-looking public name. -->
  9. <Property Id="_CMAKE_IN_PATH_REG">
  10. <RegistrySearch Id="CMAKE_IN_PATH_RegistrySearch_HKLM" Root="HKLM" Key="Software\Kitware\CMake" Name="InstallInPATH" Type="raw" />
  11. </Property>
  12. <!-- Override the default "CMAKE_IN_PATH" checkbox with a value read from the registry, if any. -->
  13. <SetProperty Action="Set_CMAKE_IN_PATH_REG_0" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_Init" Sequence="first" Value="{}" Condition="_CMAKE_IN_PATH_REG = &quot;#0&quot;" />
  14. <SetProperty Action="Set_CMAKE_IN_PATH_REG_1" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_REG_0" Sequence="first" Value="1" Condition="_CMAKE_IN_PATH_REG = &quot;#1&quot;" />
  15. <!-- Override the default "CMAKE_IN_PATH" checkbox with a value specified on the command line, if any. -->
  16. <SetProperty Action="Set_CMAKE_IN_PATH_CMD_0" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_REG_1" Sequence="first" Value="{}" Condition="ADD_CMAKE_TO_PATH = &quot;0&quot;" />
  17. <SetProperty Action="Set_CMAKE_IN_PATH_CMD_1" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_0" Sequence="first" Value="1" Condition="ADD_CMAKE_TO_PATH = &quot;1&quot;" />
  18. <!-- Support legacy values too. -->
  19. <SetProperty Action="Set_CMAKE_IN_PATH_CMD_None" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_1" Sequence="first" Value="{}" Condition="ADD_CMAKE_TO_PATH = &quot;None&quot;" />
  20. <SetProperty Action="Set_CMAKE_IN_PATH_CMD_System" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_None" Sequence="first" Value="1" Condition="ADD_CMAKE_TO_PATH = &quot;System&quot; AND ALLUSERS" />
  21. <!-- Per-user installation is not implemented, but reserve the old value for future use. -->
  22. <SetProperty Action="Set_CMAKE_IN_PATH_CMD_User" Id="CMAKE_IN_PATH" After="Set_CMAKE_IN_PATH_CMD_System" Sequence="first" Value="1" Condition="ADD_CMAKE_TO_PATH = &quot;User&quot; AND NOT ALLUSERS" />
  23. <StandardDirectory Id="TARGETDIR">
  24. <!-- Save the "CMAKE_IN_PATH" checkbox value persistently in the registry. -->
  25. <Component Id="CMakeRegistry_InstallInPATH">
  26. <!-- Use a leading "0" so the value parses as an integer even when the property is unset. -->
  27. <RegistryValue Root="HKLM" Key="Software\Kitware\CMake" Name="InstallInPATH" Type="integer" Value="0[CMAKE_IN_PATH]" />
  28. </Component>
  29. </StandardDirectory>
  30. </Fragment>
  31. </Wix>