Browse Source

Make PMP installer handle Windows N

- Fixed to only install Media Packs on Client not Server
- Missing WinRegInstallationType, added useful Registry Searches
- Installer adds MediaFoundation when installing on Windows Server
- Fix Win8 MediaPack Detection
William J Irwin 8 years ago
parent
commit
86cbd6a437
2 changed files with 169 additions and 3 deletions
  1. 162 0
      bundle/win/Bundle.wxs
  2. 7 3
      bundle/win/PMP.wxs

+ 162 - 0
bundle/win/Bundle.wxs

@@ -15,6 +15,18 @@
           Tag="$(var.FullVersion)"
           IconSourceFile="Plex.ico"
           >
+    <!-- VersionNT and VersionNT64 will always report 10.0.0.0 on windows 10 no matter what version/build it is -->
+    <!-- ServicePackLevel means nothing on any windows after windows 7 -->
+    <!-- WindowsBuild variable does not exist for burn -->
+
+    <!-- These variables from the registry gives us more accurate version info and they are useful even just to log -->
+    <util:RegistrySearch Id="WinRegProductName" Root='HKLM' Key='SOFTWARE\Microsoft\Windows NT\CurrentVersion' Value='ProductName' Variable='WinRegProductName' />
+    <util:RegistrySearch Id="WinRegReleaseID" Root='HKLM' Key='SOFTWARE\Microsoft\Windows NT\CurrentVersion' Value='ReleaseID' Variable='WinRegReleaseID' />
+    <util:RegistrySearch Id="WinRegEditionIDSearch" Root='HKLM' Key='SOFTWARE\Microsoft\Windows NT\CurrentVersion' Value='EditionID' Variable='WinRegEditionID' />
+    <util:RegistrySearch Id="WinRegInstallationType" Root='HKLM' Key='SOFTWARE\Microsoft\Windows NT\CurrentVersion' Value='InstallationType' Variable='WinRegInstallationType' />
+    <util:RegistrySearch Id="WinRegCurrentBuildSearch" Root='HKLM' Key='SOFTWARE\Microsoft\Windows NT\CurrentVersion' Value='CurrentBuild' Variable='WinRegCurrentBuild' />
+    <util:RegistrySearch Id="WinRegCurrentBuildNumberSearch" Root='HKLM' Key='SOFTWARE\Microsoft\Windows NT\CurrentVersion' Value='CurrentBuildNumber' Variable='WinRegCurrentBuildNumber' />
+    <util:RegistrySearch Id="WinRegMediaPlayerSearch" Root='HKLM' Key='SOFTWARE\Microsoft\MediaPlayer' Value='Installation Directory' Variable='WinRegMediaPlayer' />
     <util:RegistrySearch Variable="KB2919355_amd64"
                          Root="HKLM"
                          Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB2919355~31bf3856ad364e35~amd64~~6.3.1.14"
@@ -72,7 +84,156 @@
 
     <Variable Name="LaunchTarget" Value="[InstallFolder]\PlexMediaPlayer.exe"/>
 
+    <!-- Is Media Feature Pack present? (This should be enough for detecting if we are running on Windows N or not) -->
+    <util:FileSearch Variable="FoundMfPlatDll" Path="[SystemFolder]mfplat.dll" Result="exists" />
+
+    <!-- In order to avoid using a SourceFile, use heat to harvest the RemotePayload data out of the msu files: "heat payload xxx.msu -out out.xml"-->
+    <!-- Add the <RemotePayload> element from the xml file to the package file and change SourceFile to Name with just the filename. -->
+    <!-- For msu files <RemotePayload> needs a dummy Version, ProductName and Description attributes (These aren't available from the file itself and build fails if you omit them) -->
+
+    <!-- When installing burn will automatically use a package (.msu, .msi, .exe) if its uncompressed and is next to the install bundle, instead of downloading it.-->
     <Chain>
+      <!-- Media Feature Packs for Windows 7.0 -->
+      <MsuPackage KB="KB968211"
+                  DisplayName="Downloading Media Feature Pack for Windows 7 x86"
+                  Id="MediaPackWin7x86"
+                  Name="Windows6.1-KB968211-x86-RefreshPkg.msu"
+                  DownloadUrl="https://download.microsoft.com/download/B/9/B/B9BED058-8669-490E-BA61-D502E4E8BEB1/Windows6.1-KB968211-x86-RefreshPkg.msu"
+                  InstallCondition='VersionNT=v6.1 AND NOT VersionNT64 AND WinRegInstallationType~="Client"'
+                  DetectCondition="FoundMfPlatDll"
+                  Cache="no"
+                  Compressed="no"
+                  Permanent="yes"
+                  Vital="yes">
+        <RemotePayload CertificatePublicKey="61E7707927AF8DEDA014EC17C6959A989EB68C57" CertificateThumbprint="9BF69D5E8D01A92F413B60A4BE003E323CB52F7F" Description="Windows6.1-KB968211-x86-RefreshPkg.msu" Hash="88C37CB34D871C1B52A9D1125477D812999CB28E" ProductName="Windows6.1-KB968211-x86-RefreshPkg.msu" Size="291852366" Version="1.1.1.1"/>
+      </MsuPackage>
+      <MsuPackage KB="KB968211"
+                  DisplayName="Downloading Media Feature Pack for Windows 7 x64"
+                  Id="MediaPackWin7x64"
+                  Name="Windows6.1-KB968211-x64-RefreshPkg.msu"
+                  DownloadUrl="https://download.microsoft.com/download/B/9/B/B9BED058-8669-490E-BA61-D502E4E8BEB1/Windows6.1-KB968211-x64-RefreshPkg.msu"
+                  InstallCondition='VersionNT=v6.1 AND VersionNT64 AND WinRegInstallationType~="Client"'
+                  DetectCondition="FoundMfPlatDll"
+                  Cache="no"
+                  Compressed="no"
+                  Permanent="yes"
+                  Vital="yes">
+        <RemotePayload CertificatePublicKey="61E7707927AF8DEDA014EC17C6959A989EB68C57" CertificateThumbprint="9BF69D5E8D01A92F413B60A4BE003E323CB52F7F" Description="Windows6.1-KB968211-x64-RefreshPkg.msu" Hash="79FC3C186F7AF88E3273A40E52F01A5E48103BF9" ProductName="Windows6.1-KB968211-x64-RefreshPkg.msu" Size="318337992" Version="1.1.1.1"/>
+      </MsuPackage>
+
+      <!-- Media Feature Packs for Windows 8.0 -->
+      <MsuPackage KB="KB2703761"
+                  DisplayName="Downloading Media Feature Pack for Windows 8.0 x86"
+                  Id="MediaPackWin8x86"
+                  Name="Windows6.2-KB2703761-x86.msu"
+                  DownloadUrl="https://download.microsoft.com/download/7/A/D/7AD12930-3AA6-4040-81CF-350BF1E99076/Windows6.2-KB2703761-x86.msu"
+                  InstallCondition='VersionNT=v6.2 AND NOT VersionNT64 AND WinRegInstallationType~="Client"'
+                  DetectCondition="FoundMfPlatDll AND WinRegMediaPlayer"
+                  Cache="no"
+                  Compressed="no"
+                  Permanent="yes"
+                  Vital="yes">
+        <RemotePayload CertificatePublicKey="D37F6D0F2894D56049061A44596FFA88CBFD1B5B" CertificateThumbprint="19F8F76F4655074509769C20349FFAECCECD217D" Description="Windows6.2-KB2703761-x86.msu" Hash="E94B6B38870333F33091630915D06C1C3CB3BD59" ProductName="Windows6.2-KB2703761-x86.msu" Size="60746899" Version="1.1.1.1"/>
+      </MsuPackage>
+      <MsuPackage KB="KB2703761"
+                  DisplayName="Downloading Media Feature Pack for Windows 8.0 x64"
+                  Id="MediaPackWin8x64"
+                  Name="Windows6.2-KB2703761-x64.msu"
+                  DownloadUrl="https://download.microsoft.com/download/7/A/D/7AD12930-3AA6-4040-81CF-350BF1E99076/Windows6.2-KB2703761-x64.msu"
+                  InstallCondition='VersionNT=v6.2 AND VersionNT64 AND WinRegInstallationType~="Client"'
+                  DetectCondition="FoundMfPlatDll AND WinRegMediaPlayer"
+                  Cache="no"
+                  Compressed="no"
+                  Permanent="yes"
+                  Vital="yes">
+        <RemotePayload CertificatePublicKey="D37F6D0F2894D56049061A44596FFA88CBFD1B5B" CertificateThumbprint="19F8F76F4655074509769C20349FFAECCECD217D" Description="Windows6.2-KB2703761-x64.msu" Hash="B2A81F0BE816628096A22B37F2D17D9E8063DC6F" ProductName="Windows6.2-KB2703761-x64.msu" Size="82674179" Version="1.1.1.1"/>
+      </MsuPackage>
+
+      <!-- Media Feature Packs for Windows 8.1 -->
+      <MsuPackage KB="KB2929699"
+                  DisplayName="Downloading Media Feature Pack for Windows 8.1 x86"
+                  Id="MediaPackWin81x86"
+                  Name="Windows8.1-KB2929699-x86.msu"
+                  DownloadUrl="https://download.microsoft.com/download/8/9/7/89775613-432E-4ECF-93A9-5BAFCB5B7807/Windows8.1-KB2929699-x86.msu"
+                  InstallCondition='VersionNT=v6.3 AND NOT VersionNT64 AND WinRegInstallationType~="Client"'
+                  DetectCondition="FoundMfPlatDll"
+                  Cache="no"
+                  Compressed="no"
+                  Permanent="yes"
+                  Vital="yes">
+        <RemotePayload CertificatePublicKey="A260A870BE1145ED71E2BB5AA19463A4FE9DCC41" CertificateThumbprint="108E2BA23632620C427C570B6D9DB51AC31387FE" Description="Windows8.1-KB2929699-x86.msu" Hash="386524559BAF25F86BF374F88EB5BAD6F07A0F9F" ProductName="Windows8.1-KB2929699-x86.msu" Size="63605391" Version="1.1.1.1"/>
+      </MsuPackage>
+      <MsuPackage KB="KB2929699"
+                  DisplayName="Downloading Media Feature Pack for Windows 8.1 x64"
+                  Id="MediaPackWin81x64"
+                  Name="Windows8.1-KB2929699-x64.msu"
+                  DownloadUrl="https://download.microsoft.com/download/8/9/7/89775613-432E-4ECF-93A9-5BAFCB5B7807/Windows8.1-KB2929699-x64.msu"
+                  InstallCondition='VersionNT=v6.3 AND VersionNT64 AND WinRegInstallationType~="Client"'
+                  DetectCondition="FoundMfPlatDll"
+                  Cache="no"
+                  Compressed="no"
+                  Permanent="yes"
+                  Vital="yes">
+        <RemotePayload CertificatePublicKey="A260A870BE1145ED71E2BB5AA19463A4FE9DCC41" CertificateThumbprint="108E2BA23632620C427C570B6D9DB51AC31387FE" Description="Windows8.1-KB2929699-x64.msu" Hash="0734AED9D4354F90A77811758F4BC554D731F6B0" ProductName="Windows8.1-KB2929699-x64.msu" Size="89383884" Version="1.1.1.1"/>
+      </MsuPackage>
+
+      <!-- Media Feature Packs for Windows 10 RTM -->
+      <MsuPackage KB="KB3010081"
+                  DisplayName="Downloading Media Feature Pack for Windows 10 x86"
+                  Id="MediaPackWin10x86"
+                  Name="Microsoft-Windows-MediaFeaturePack-OOB-Package.msu"
+                  DownloadUrl="https://download.microsoft.com/download/7/F/2/7F2E00A7-F071-41CA-A35B-00DC536D4227/Microsoft-Windows-MediaFeaturePack-OOB-Package.msu"
+                  InstallCondition='VersionNT>=v10.0 AND NOT VersionNT64 AND WinRegCurrentBuildNumber=10240 AND WinRegInstallationType~="Client"'
+                  DetectCondition="FoundMfPlatDll"
+                  Cache="no"
+                  Compressed="no"
+                  Permanent="yes"
+                  Vital="yes">
+        <RemotePayload CertificatePublicKey="4C72A5297C20ADD16A1964578EFFC7CB4EF1D38D" CertificateThumbprint="49DA9A5E21EDC4682AD0211C85D552C86C422F13" Description="Microsoft-Windows-MediaFeaturePack-OOB-Package.msu" Hash="87ABA28404F07E7D1CEA496FDB4AD20B8C978E50" ProductName="Microsoft-Windows-MediaFeaturePack-OOB-Package.msu" Size="75898094" Version="1.1.1.1"/>
+      </MsuPackage>
+      <MsuPackage KB="KB3010081"
+                  DisplayName="Downloading Media Feature Pack for Windows 10 x64"
+                  Id="MediaPackWin10x64"
+                  Name="Microsoft-Windows-MediaFeaturePack-OOB-Package_x64.msu"
+                  DownloadUrl="https://download.microsoft.com/download/7/F/2/7F2E00A7-F071-41CA-A35B-00DC536D4227/Microsoft-Windows-MediaFeaturePack-OOB-Package_x64.msu"
+                  InstallCondition='VersionNT>=v10.0 AND VersionNT64 AND WinRegCurrentBuildNumber=10240 AND WinRegInstallationType~="Client"'
+                  DetectCondition="FoundMfPlatDll"
+                  Cache="no"
+                  Compressed="no"
+                  Permanent="yes"
+                  Vital="yes">
+        <RemotePayload CertificatePublicKey="4C72A5297C20ADD16A1964578EFFC7CB4EF1D38D" CertificateThumbprint="49DA9A5E21EDC4682AD0211C85D552C86C422F13" Description="Microsoft-Windows-MediaFeaturePack-OOB-Package_x64.msu" Hash="2D1FAE125F6A5FBEB3F56479DBA7A2BE8BC3EE77" ProductName="Microsoft-Windows-MediaFeaturePack-OOB-Package_x64.msu" Size="114150296" Version="1.1.1.1"/>
+      </MsuPackage>
+
+      <!-- Media Feature Packs for Windows 10 1511 -->
+      <MsuPackage KB="KB3099229"
+                  DisplayName="Downloading Media Pack for Windows 10 x86 1511"
+                  Id="MediaPackWin10x861511"
+                  Name="KB3099229_x86.msu"
+                  DownloadUrl="https://download.microsoft.com/download/B/E/3/BE302763-5BFD-4209-9C98-02DF5B2DB452/KB3099229_x86.msu"
+                  InstallCondition='VersionNT>=v10.0 AND NOT VersionNT64 AND WinRegReleaseID=1511 AND WinRegInstallationType~="Client"'
+                  DetectCondition="FoundMfPlatDll"
+                  Cache="no"
+                  Compressed="no"
+                  Permanent="yes"
+                  Vital="yes">
+        <RemotePayload CertificatePublicKey="4C72A5297C20ADD16A1964578EFFC7CB4EF1D38D" CertificateThumbprint="49DA9A5E21EDC4682AD0211C85D552C86C422F13" Description="KB3099229_x86.msu" Hash="4C1CBED520159DA8F5DB69BF1E04C2D0DD7EDB23" ProductName="KB3099229_x86.msu" Size="76836258" Version="1.1.1.1"/>
+      </MsuPackage>
+      <MsuPackage KB="KB3099229"
+                  DisplayName="Downloading Media Pack for Windows 10 x64 1511"
+                  Id="MediaPackWin10x641511"
+                  Name="KB3099229_x64.msu"
+                  DownloadUrl="https://download.microsoft.com/download/B/E/3/BE302763-5BFD-4209-9C98-02DF5B2DB452/KB3099229_x64.msu"
+                  InstallCondition='VersionNT>=v10.0 AND VersionNT64 AND WinRegReleaseID=1511 AND WinRegInstallationType~="Client"'
+                  DetectCondition="FoundMfPlatDll"
+                  Cache="no"
+                  Compressed="no"
+                  Permanent="yes"
+                  Vital="yes">
+        <RemotePayload CertificatePublicKey="4C72A5297C20ADD16A1964578EFFC7CB4EF1D38D" CertificateThumbprint="49DA9A5E21EDC4682AD0211C85D552C86C422F13" Description="KB3099229_x64.msu" Hash="DB92011AB439392E426A82A1F60EF6CC87A63864" ProductName="KB3099229_x64.msu" Size="115805700" Version="1.1.1.1"/>
+      </MsuPackage>
+
+      <!-- PMP's msi-->
       <MsiPackage Id="pmp"
                   Name="PMP.msi"
                   Compressed="yes"
@@ -80,6 +241,7 @@
                   Vital="yes">
         <MsiProperty Name="INSTALLLOCATION" Value="[InstallFolder]" />
         <MsiProperty Name="AUTOLAUNCH" Value="[autolaunch]" />
+        <MsiProperty Name="WINDOWSTYPE" Value="[WinRegInstallationType]" />
       </MsiPackage>
       <ExePackage Id="vcredist_repair"
                   SourceFile="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\redist\1033\vcredist_x64.exe"

+ 7 - 3
bundle/win/PMP.wxs

@@ -55,9 +55,11 @@
     <!-- Running program termination -->
     <util:CloseApplication Id="PlexMediaPlayer" CloseMessage="yes" Target="PlexMediaPlayer.exe" ElevatedCloseMessage="yes" RebootPrompt="yes" />
     <util:CloseApplication Id="PMPHelper" CloseMessage="yes" Target="PMPHelper.exe" ElevatedCloseMessage="yes" RebootPrompt="yes" />
-    <InstallExecuteSequence>
-      <Custom Action="WixCloseApplications" After="InstallInitialize" />
-    </InstallExecuteSequence>
+
+    <!-- Custom action to Install MediaFoundation on Windows Server -->
+    <Property Id="WINDOWSTYPE" Value="Client"/>
+    <Property Id="WixQuietExec64CmdLine" Value='"C:\Windows\System32\dism.exe" /online /enable-feature /all /featurename:ServerMediaFoundation /NoRestart'/>
+    <CustomAction Id="EnableMediaFoundation" BinaryKey="WixCA" DllEntry="WixQuietExec64" Execute="immediate" Return="ignore" Impersonate="no"/>
 
     <Property Id="AUTOLAUNCH" Value="0"/>
     <Property Id="WixShellExecTarget" Value="[INSTALLLOCATION]PlexMediaPlayer.exe" />
@@ -69,6 +71,8 @@
       <!-- Uninstall older versions before installing ourselves -->
       <RemoveExistingProducts After="InstallInitialize">PREVIOUSVERSIONINSTALLED</RemoveExistingProducts>
       <Custom Action="LaunchPMP" After="InstallFinalize"><![CDATA[AUTOLAUNCH = 1]]></Custom>
+      <Custom Action="WixCloseApplications" After="InstallInitialize" />
+      <Custom Action="EnableMediaFoundation" Before="CostFinalize">WINDOWSTYPE~="Server"</Custom>
     </InstallExecuteSequence>
 
     <!-- Custom Actions -->