openmsx.wxs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <?xml version="1.0"?>
  2. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
  3. xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  4. <!-- Some useful local variables -->
  5. <?define ProductVersion=$(env.OPENMSX_VERSION) ?>
  6. <?define LastNonMSIProductVersion=0.6.0.0 ?>
  7. <?define MinInstallerVersion=200 ?>
  8. <?if $(sys.BUILDARCH)=x86 ?>
  9. <?define ProductName=!(loc.openMSX) ?>
  10. <?define ProgramFilesFolderNative=ProgramFilesFolder ?>
  11. <?define UpgradeCode=9e38eab5-7a1c-4b43-ae24-c2152a4018f1 ?>
  12. <?else?>
  13. <?define ProductName=!(loc.openMSX) (64-bit) ?>
  14. <?define ProgramFilesFolderNative=ProgramFiles64Folder ?>
  15. <?define UpgradeCode=c7bd4b4d-1307-4a0d-b3f8-69744c7e5801 ?>
  16. <?endif?>
  17. <!-- To keep things simple, our installer considers each new release
  18. a major upgrade, so we change the Product Id on every build -->
  19. <Product Id="*"
  20. UpgradeCode="$(var.UpgradeCode)"
  21. Name="$(var.ProductName)"
  22. Language="!(loc.LANG)"
  23. Version="$(var.ProductVersion)"
  24. Manufacturer="!(loc.openMSX)">
  25. <!-- Package Ids change on every build by definition -->
  26. <Package Id="*"
  27. Platform="$(sys.BUILDARCH)"
  28. Description="$(var.ProductName)"
  29. InstallerVersion="$(var.MinInstallerVersion)"
  30. Compressed="yes" />
  31. <!-- Icon used in the control panel -->
  32. <Icon Id="openMSXIcon" SourceFile="$(env.OPENMSX_ICON_PATH)"/>
  33. <!-- Populate useful control panel fields -->
  34. <?include ControlPanel.wxi ?>
  35. <!--
  36. Upgrade handling
  37. -->
  38. <Upgrade Id="$(var.UpgradeCode)">
  39. <UpgradeVersion Minimum="$(var.ProductVersion)"
  40. IncludeMinimum="no"
  41. OnlyDetect="yes"
  42. Language="!(loc.LANG)"
  43. Property="NEWPRODUCTFOUND" />
  44. <UpgradeVersion Minimum="$(var.LastNonMSIProductVersion)"
  45. Maximum="$(var.ProductVersion)"
  46. Property="PREVIOUSVERSIONSINSTALLED"
  47. IncludeMinimum="no"
  48. IncludeMaximum="yes" />
  49. </Upgrade>
  50. <InstallExecuteSequence>
  51. <!-- Prevent downgrades -->
  52. <Custom Action="PreventDowngrades"
  53. After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
  54. <!-- Remove the previous product /before/ installing the new one -->
  55. <RemoveExistingProducts After="InstallValidate">PREVIOUSVERSIONSINSTALLED</RemoveExistingProducts>
  56. </InstallExecuteSequence>
  57. <CustomAction Id="PreventDowngrades"
  58. Error="!(loc.NewerVersionError)" />
  59. <!-- We only support Windows 2000 and above -->
  60. <Condition Message="!(loc.OldWindowsError)">
  61. <![CDATA[VersionNT >= 500]]>
  62. </Condition>
  63. <!-- Compress installation files in an embedded cab file -->
  64. <Media Id="1" Cabinet="openmsx.cab" EmbedCab="yes" CompressionLevel="high" />
  65. <!-- The default installation directory is under [ProgramFilesFolder] or [ProgramFiles64Folder] -->
  66. <Directory Id="TARGETDIR" Name="SourceDir">
  67. <Directory Id="$(var.ProgramFilesFolderNative)">
  68. <Directory Id="OPENMSXINSTALLDIR" Name="openMSX">
  69. <!-- This dummy component has one purpose: to remove the annoying 'run from the network' option on the root feature
  70. Apparently features without components have that option enabled. Shrug. -->
  71. <Component Id="DummyComponent" Guid="1ce98c66-b014-4d3f-b926-b08f65a7f3f3">
  72. <CreateFolder />
  73. </Component>
  74. </Directory>
  75. </Directory>
  76. <Directory Id="ProgramMenuFolder">
  77. <Directory Id="openMSXStartMenuDir" Name="openMSX"/>
  78. </Directory>
  79. <Directory Id="SystemFolder" />
  80. </Directory>
  81. <!--
  82. User interface
  83. -->
  84. <!-- Use the WixUI_FeatureTree UI in order to customize features and installation directory -->
  85. <Property Id="WIXUI_INSTALLDIR" Value="OPENMSXINSTALLDIR" />
  86. <UIRef Id="WixUI_FeatureTree" />
  87. <!-- Remove the license agreement dialog, which sits between WelcomeDlg and CustomizeDlg -->
  88. <UI>
  89. <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg">1</Publish>
  90. <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">NOT Installed</Publish>
  91. </UI>
  92. <!-- We have no license agreement at the moment. This is how we'd reference one -->
  93. <!-->WixVariable Id="WixUILicenseRtf" Value="license1033.rtf" /-->
  94. <!-- Installer Graphics -->
  95. <WixVariable Id="WixUIDialogBmp" Value="$(env.OPENMSX_PACKAGE_WINDOWS_PATH)/images/SideBanner.jpg" />
  96. <WixVariable Id="WixUIBannerBmp" Value="$(env.OPENMSX_PACKAGE_WINDOWS_PATH)/images/TopBanner.jpg" />
  97. <!-- Add text to the final dialog; the custom action is needed to use the OPENMSXINSTALLDIR property -->
  98. <CustomAction Id="CA_Set_WIXUI_EXITDIALOGOPTIONALTEXT" Property="WIXUI_EXITDIALOGOPTIONALTEXT"
  99. Value="To emulate real MSX systems (besides the free C-BIOS machines), put the system ROMs here: [PersonalFolder]openMSX\share\systemroms Copy MSX software referred to from replays or savestates you get from your friends to [PersonalFolder]openMSX\share\software. (For all users, use [OPENMSXINSTALLDIR]share as admin instead.)" />
  100. <InstallUISequence>
  101. <Custom Action="CA_Set_WIXUI_EXITDIALOGOPTIONALTEXT" After="ExecuteAction" />
  102. </InstallUISequence>
  103. <!--
  104. Start Menu shortcuts
  105. -->
  106. <DirectoryRef Id="openMSXStartMenuDir">
  107. <Component Id="openMSXShortcuts" Guid="*">
  108. <!-- Shortcut to openmsx.exe -->
  109. <Shortcut Id="openMSXExeShortcut"
  110. Name="!(loc.openMSX)"
  111. Description="!(loc.TagLine)"
  112. Target="[OPENMSXINSTALLDIR]openmsx.exe"
  113. WorkingDirectory="OPENMSXINSTALLDIR" />
  114. <!-- Shortcut to openMSX manual -->
  115. <Shortcut Id="openMSXManualShortcut"
  116. Name="!(loc.openMSXManual)"
  117. Description="!(loc.openMSXManual)"
  118. Target="[OPENMSXINSTALLDIR]doc\manual\index.html"
  119. WorkingDirectory="OPENMSXINSTALLDIR" />
  120. <!-- Shortcut to openMSX website -->
  121. <util:InternetShortcut Id="openMSXWebSiteShortcut"
  122. Name="!(loc.openMSXWebSite)"
  123. Target="http://openmsx.org/" />
  124. <!-- Shortcut to uninstall - do we really need this?
  125. Note that [SystemFolder64] is always the native system folder -->
  126. <Shortcut Id="UninstallProduct"
  127. Name="!(loc.UninstallopenMSX)"
  128. Description="!(loc.UninstallopenMSX)"
  129. Target="[System64Folder]msiexec.exe"
  130. Arguments="/x [ProductCode]" />
  131. <!-- This is needed to fix two errors:
  132. ICE38: Component openMSXShortcuts installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file.
  133. ICE43: Component openMSXShortcuts has non-advertised shortcuts. It should use a registry key under HKCU as its KeyPath, not a file. -->
  134. <RegistryValue Root="HKCU" Key="Software\$(var.ProductName)" Name="Installed" Type="integer" Value="1" KeyPath="yes"/>
  135. <!-- This is needed to prevent the following error:
  136. ICE64: The directory openMSXStartMenuDir is in the user profile but is not listed in the RemoveFile table. -->
  137. <RemoveFolder Id="openMSXStartMenuDir" On="uninstall" />
  138. </Component>
  139. <!-- Use a hardcoded guid here to work around what appears to be a WiX bug
  140. Otherwise, we get ICE08: Component: CatapultShortcuts has a duplicate GUID: {69F885AD-19F6-5D4D-89DC-E05C05A3D761} -->
  141. <Component Id="CatapultShortcuts" Guid="5ad9c567-56a1-4d61-9edc-5504f2ae673e">
  142. <!-- Shortcut to catapult.exe -->
  143. <Shortcut Id="CatapultExeShortcut"
  144. Name="!(loc.Catapult)"
  145. Description="!(loc.CatapultDescription)"
  146. Target="[OPENMSXINSTALLDIR]Catapult\bin\catapult.exe"
  147. WorkingDirectory="OPENMSXINSTALLDIR" />
  148. <!-- Shortcut to Catapult manual -->
  149. <Shortcut Id="CatapultManualShortcut"
  150. Name="!(loc.CatapultManual)"
  151. Description="!(loc.CatapultManual)"
  152. Target="[OPENMSXINSTALLDIR]Catapult\doc\manual\index.html"
  153. WorkingDirectory="OPENMSXINSTALLDIR" />
  154. <RegistryValue Root="HKCU" Key="Software\$(var.ProductName)" Name="Installed" Type="integer" Value="1" KeyPath="yes"/>
  155. </Component>
  156. </DirectoryRef>
  157. <!--
  158. Registry entries
  159. -->
  160. <!-- Use a hardcoded guid to work around CNDL0230 -->
  161. <Component Id="ZMBVRegistryValues" Guid="52db293d-8b1e-4598-9c9a-c71ed3a5ecb9" KeyPath="yes" Win64="no" Directory="SystemFolder">
  162. <RegistryValue Id="Drivers32"
  163. Name="VIDC.ZMBV"
  164. Value="zmbv.dll"
  165. Type="string"
  166. Root="HKLM"
  167. Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32"
  168. Action="write" />
  169. <RegistryValue Id="drivers.desc"
  170. Name="zmbv.dll"
  171. Value="!(loc.ZMBVVideoCodecDesc)"
  172. Type="string"
  173. Root="HKLM"
  174. Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc"
  175. Action="write" />
  176. </Component>
  177. <!--
  178. Features
  179. -->
  180. <!-- openMSX is composed of three features:
  181. 1) The required Core Emulator
  182. 2) The optional Catapult UI
  183. 3) The optional ZMBV codec
  184. Each feature consists of several components: largely files and shortcuts
  185. The individual file list for feature is dynamically generated
  186. via file harvesting scripts, whose output is references as
  187. component groups. -->
  188. <Feature Id="openMSX"
  189. Title="!(loc.openMSX)"
  190. Description="!(loc.TagLine)"
  191. Level="1"
  192. Absent="disallow"
  193. Display="expand"
  194. AllowAdvertise="no"
  195. ConfigurableDirectory="OPENMSXINSTALLDIR">
  196. <ComponentRef Id="DummyComponent" />
  197. <Feature Id="openMSXCore"
  198. Title="!(loc.CoreEmulator)"
  199. Description="Command line MSX emulator"
  200. Level="1"
  201. Absent="disallow"
  202. AllowAdvertise="no">
  203. <ComponentGroupRef Id="openMSXExe" />
  204. <ComponentGroupRef Id="openMSXDoc" />
  205. <ComponentGroupRef Id="openMSXShare" />
  206. <ComponentGroupRef Id="openMSXIcon" />
  207. <ComponentRef Id="openMSXShortcuts" />
  208. </Feature>
  209. <Feature Id="Catapult"
  210. Title="!(loc.CatapultUI)"
  211. Description="!(loc.CatapultDescription)"
  212. Level="1"
  213. Absent="allow"
  214. AllowAdvertise="no">
  215. <ComponentGroupRef Id="CatapultBin" />
  216. <ComponentGroupRef Id="CatapultDoc" />
  217. <ComponentGroupRef Id="CatapultBitmaps" />
  218. <ComponentGroupRef Id="CatapultDialogs" />
  219. <ComponentGroupRef Id="CatapultIcons" />
  220. <ComponentGroupRef Id="CatapultReadme" />
  221. <ComponentRef Id="CatapultShortcuts" />
  222. </Feature>
  223. <Feature Id="ZMBVCodec"
  224. Title="!(loc.ZMBVVideoCodec)"
  225. Description="!(loc.ZMBVVideoCodecDescription)"
  226. Level="2"
  227. Absent="allow"
  228. AllowAdvertise="no">
  229. <ComponentGroupRef Id="ZMBVCodec" />
  230. <ComponentGroupRef Id="ZMBVFiles" />
  231. <ComponentRef Id="ZMBVRegistryValues" />
  232. </Feature>
  233. </Feature>
  234. </Product>
  235. </Wix>