PostInstallSetup.wxs 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?xml version='1.0' encoding='windows-1252'?>
  2. <?include "cpack_variables.wxi"?>
  3. <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
  4. xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  5. <Fragment>
  6. <!-- RemoveFolderEx works on properties instead of directory references -->
  7. <Property Id="INSTALLPATH">
  8. <RegistrySearch Id="INSTALLPATH_REGSEARCH"
  9. Root="HKLM"
  10. Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)\$(var.CPACK_PACKAGE_VERSION)"
  11. Name="Install Path"
  12. Type="raw"/>
  13. </Property>
  14. <DirectoryRef Id="INSTALL_ROOT">
  15. <!-- this will clear out any additional files as part of the installation that weren't originally
  16. included of the MSI table -->
  17. <Component Id="SanitizeInstallFolder" Guid="{85468941-52E6-4C04-A66D-8E3CA3BBF04A}">
  18. <Condition><![CDATA[Installed OR NOT MANUALPRODUCTFOUND]]></Condition>
  19. <util:RemoveFolderEx On="uninstall" Property="INSTALLPATH"/>
  20. <!-- registry entry is required to properly initialize the property during uninstall-->
  21. <RegistryValue Root="HKLM"
  22. Key="Software\$(var.CPACK_PACKAGE_VENDOR)\$(var.CPACK_PACKAGE_NAME)\$(var.CPACK_PACKAGE_VERSION)"
  23. Name="Install Path"
  24. Type="string"
  25. Value="[INSTALL_ROOT]"
  26. KeyPath="yes"/>
  27. </Component>
  28. <!-- installation directory references for use in post install commands -->
  29. <Directory Id="root.cmake" Name="cmake">
  30. <Directory Id="root.cmake.runtime" Name="runtime"/>
  31. </Directory>
  32. <Directory Id="root.python" Name="python"/>
  33. <Directory Id="root.scripts" Name="scripts"/>
  34. <Directory Id="root.tools" Name="Tools">
  35. <Directory Id="root.tools.redist" Name="Redistributables">
  36. <Directory Id="root.tools.redist.cmake" Name="CMake"/>
  37. </Directory>
  38. </Directory>
  39. </DirectoryRef>
  40. <CustomAction Id="ExtractCMake"
  41. ExeCommand="&quot;[SystemFolder]cmd.exe&quot; /C tar -x -f &quot;[root.tools.redist.cmake]$(var.CPACK_CMAKE_PACKAGE_NAME).zip&quot; -C &quot;[root.tools.redist]CMake&quot;"
  42. Directory="INSTALL_ROOT"
  43. Execute="deferred"
  44. Impersonate="no"/>
  45. <CustomAction Id="MoveCMake"
  46. ExeCommand="&quot;[SystemFolder]cmd.exe&quot; /C move &quot;[root.tools.redist.cmake]$(var.CPACK_CMAKE_PACKAGE_NAME)&quot; &quot;[root.cmake]runtime&quot;"
  47. Directory="INSTALL_ROOT"
  48. Execute="deferred"
  49. Impersonate="no"/>
  50. <CustomAction Id="ConfigurePython"
  51. ExeCommand="&quot;[SystemFolder]cmd.exe&quot; /C set &quot;LY_CMAKE_PATH=[root.cmake.runtime]bin&quot; &amp;&amp; &quot;[root.python]get_python.bat&quot;"
  52. Directory="INSTALL_ROOT"
  53. Execute="deferred"
  54. Impersonate="no"/>
  55. <CustomAction Id="UnRegisterEngine"
  56. ExeCommand="&quot;[SystemFolder]cmd.exe&quot; /C @&quot;[root.scripts]o3de.bat&quot; register --remove --this-engine"
  57. Directory="INSTALL_ROOT"
  58. Execute="immediate"
  59. Return="ignore"
  60. Impersonate="no"/>
  61. </Fragment>
  62. </Wix>