PMP.wxs 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
  3. xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
  4. xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension">
  5. <?include Global.wxi ?>
  6. <?include Version.wxi ?>
  7. <?define FirstProductVersion=1.0.0 ?>
  8. <?define PlexMediaPlayerRegistryKey=Software\Plex, Inc.\Plex Media Player?>
  9. <!-- To keep things simple, the installer considers each new release
  10. a major upgrade, in which everything is uninstalled, then reinstalled
  11. To accomplish this, we change the Product Id on every build.
  12. However, the upgrade code remains the same on every build, to ensure
  13. that newer installers recognize older installations -->
  14. <Product Id="*" Name="$(var.ProductName)" Language="1033" Version="$(var.Version)" Manufacturer="Plex" UpgradeCode="$(var.ProductUUID)">
  15. <!-- Package Ids change on every build, by definition -->
  16. <Package Id="*" Platform="x64" InstallerVersion="405" Compressed="yes" Description="$(var.ProductDesc)" InstallScope="perMachine" />
  17. <!-- allow for reinstall, this is needed to force installation when the version match -->
  18. <Property Id="REINSTALLMODE" Value="amus"/>
  19. <!-- Embedded, compressed cab file -->
  20. <Media Id="1" Cabinet="pmp.cab" EmbedCab="yes" CompressionLevel="high" />
  21. <!-- We support Windows 7 and above -->
  22. <Condition Message="$(var.OldWindowsError)">
  23. <![CDATA[VersionNT >= 601]]>
  24. </Condition>
  25. <!-- Icon used in the control panel -->
  26. <Icon Id="PlexMediaPlayerIcon" SourceFile="Plex.ico" />
  27. <!-- Useful control panel fields -->
  28. <?include ControlPanel.wxi ?>
  29. <!-- Upgrade and downgrade handling -->
  30. <Upgrade Id="$(var.ProductUUID)">
  31. <!-- Detect newer versions -->
  32. <UpgradeVersion Minimum="$(var.Version)"
  33. IncludeMinimum="no"
  34. OnlyDetect="yes"
  35. Property="NEWERPRODUCTFOUND" />
  36. <!-- Detect older versions -->
  37. <UpgradeVersion Minimum="$(var.FirstProductVersion)"
  38. Maximum="$(var.Version)"
  39. IncludeMinimum="yes"
  40. IncludeMaximum="no"
  41. Property="PREVIOUSVERSIONINSTALLED" />
  42. </Upgrade>
  43. <!-- Running program termination -->
  44. <util:CloseApplication Id="PlexMediaPlayer" CloseMessage="yes" Target="PlexMediaPlayer.exe" ElevatedCloseMessage="yes" RebootPrompt="yes" />
  45. <util:CloseApplication Id="PMPHelper" CloseMessage="yes" Target="PMPHelper.exe" ElevatedCloseMessage="yes" RebootPrompt="yes" />
  46. <InstallExecuteSequence>
  47. <Custom Action="WixCloseApplications" After="InstallInitialize" />
  48. </InstallExecuteSequence>
  49. <Property Id="AUTOLAUNCH" Value="0"/>
  50. <Property Id="WixShellExecTarget" Value="[INSTALLLOCATION]PlexMediaPlayer.exe" />
  51. <CustomAction Id="LaunchPMP" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" Return="ignore"/>
  52. <InstallExecuteSequence>
  53. <!-- Prevent downgrades from newer versions -->
  54. <Custom Action="PreventDowngrades" After="FindRelatedProducts">NEWERPRODUCTFOUND</Custom>
  55. <!-- Uninstall older versions before installing ourselves -->
  56. <RemoveExistingProducts After="InstallInitialize">PREVIOUSVERSIONINSTALLED</RemoveExistingProducts>
  57. <Custom Action="LaunchPMP" After="InstallFinalize"><![CDATA[AUTOLAUNCH = 1]]></Custom>
  58. </InstallExecuteSequence>
  59. <!-- Custom Actions -->
  60. <CustomAction Id="PreventDowngrades" Error="$(var.NewerVersionError)" />
  61. <!-- The default installation directory is under [ProgramFilesFolder] -->
  62. <Directory Id="TARGETDIR" Name="SourceDir">
  63. <Directory Id="ProgramFiles64Folder">
  64. <Directory Id="INSTALLLOCATION" Name="Msi">
  65. </Directory>
  66. </Directory>
  67. <Directory Id="ProgramMenuFolder">
  68. <Directory Id="PlexStartMenuFolder" Name="Plex Media Player"/>
  69. </Directory>
  70. </Directory>
  71. <!-- Start Menu shortcut -->
  72. <DirectoryRef Id="PlexStartMenuFolder">
  73. <Component Id="PlexMediaPlayerShortcuts" Guid="*">
  74. <Shortcut Id="PlexMediaPlayerExeShortcut"
  75. Name="Plex Media Player"
  76. Description="Plex Media Player for Windows"
  77. Target="[INSTALLLOCATION]PlexMediaPlayer.exe"
  78. WorkingDirectory="INSTALLLOCATION" />
  79. <RegistryKey Root="HKCU" Key="Software\Plex, Inc.\Plex Media Player">
  80. <RegistryValue Name="InstallFolder" Type="string" Value="[INSTALLLOCATION]" Action="write" KeyPath="no" />
  81. </RegistryKey>
  82. <!-- Firewall Exceptions -->
  83. <!-- These should probably go in their own component, but it's easier just to put them here -->
  84. <fire:FirewallException Id="FWX1" Name="Plex Media Player" Program="[INSTALLLOCATION]PlexMediaPlayer.exe" Scope="any" IgnoreFailure="yes" />
  85. <fire:FirewallException Id="FWX2" Name="Plex Media Player Helper" Program="[INSTALLLOCATION]PMPHelper.exe" Scope="any" IgnoreFailure="yes" />
  86. <RemoveFolder Id="PlexStartMenuFolder" On="uninstall" />
  87. </Component>
  88. </DirectoryRef>
  89. <!-- Product Feature -->
  90. <Feature Id="ProductFeature" Title="Plex" Level="1">
  91. <ComponentGroupRef Id="ProgramFilesComponentGroup" />
  92. <ComponentRef Id="PlexMediaPlayerShortcuts" />
  93. </Feature>
  94. </Product>
  95. </Wix>