mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 06:30:55 +00:00
Upgrade installer to WiX v4
This commit is contained in:
@@ -1,13 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProductVersion>3.10</ProductVersion>
|
||||
<ProjectGuid>8468ef94-3bb8-47a5-af15-0e314afe664d</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>Moonlight</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
<DefineSolutionProperties>false</DefineSolutionProperties>
|
||||
</PropertyGroup>
|
||||
<Project Sdk="WixToolset.Sdk/4.0.1" ToolsVersion="4.0">
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<DefineConstants>Debug</DefineConstants>
|
||||
</PropertyGroup>
|
||||
@@ -16,33 +7,22 @@
|
||||
<IntermediateOutputPath>$(BUILD_FOLDER)\</IntermediateOutputPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<DefineConstants>SourceDir=$(DEPLOY_FOLDER)</DefineConstants>
|
||||
<DefineConstants>DeployDir=$(DEPLOY_FOLDER);BuildDir=$(BUILD_FOLDER)</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Product.wxs" />
|
||||
<Compile Include="$(BUILD_FOLDER)\Dependencies.wxs" />
|
||||
<HarvestDirectory Include="$(DEPLOY_FOLDER)">
|
||||
<ComponentGroupName>MoonlightDependencies</ComponentGroupName>
|
||||
<DirectoryRefId>INSTALLFOLDER</DirectoryRefId>
|
||||
<PreprocessorVariable>DeployDir</PreprocessorVariable>
|
||||
<SuppressRootDirectory>true</SuppressRootDirectory>
|
||||
<SuppressCom>true</SuppressCom>
|
||||
<SuppressRegistry>true</SuppressRegistry>
|
||||
</HarvestDirectory>
|
||||
<BindPath Include="$(DEPLOY_FOLDER)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WixExtension Include="WixFirewallExtension">
|
||||
<HintPath>$(WixExtDir)\WixFirewallExtension.dll</HintPath>
|
||||
<Name>WixFirewallExtension</Name>
|
||||
</WixExtension>
|
||||
<WixExtension Include="WixUtilExtension">
|
||||
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
|
||||
<Name>WixUtilExtension</Name>
|
||||
</WixExtension>
|
||||
<PackageReference Include="WixToolset.Firewall.wixext" Version="4.*" />
|
||||
<PackageReference Include="WixToolset.Util.wixext" Version="4.*" />
|
||||
<PackageReference Include="WixToolset.Heat" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
|
||||
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
|
||||
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
|
||||
</Target>
|
||||
<!--
|
||||
To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Wix.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
+78
-80
@@ -1,117 +1,107 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?define ShortName = "Moonlight" ?>
|
||||
<?define ShortName = "Moonlight" ?>
|
||||
<?define FullName = "Moonlight Game Streaming Client" ?>
|
||||
|
||||
<?define ShortcutName = "$(var.ShortName)" ?>
|
||||
<?define ShortcutDesc = "Stream games and other applications from another PC" ?>
|
||||
<?define InstallFolder = "Moonlight Game Streaming" ?>
|
||||
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
|
||||
xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension"
|
||||
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
|
||||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:fire="http://wixtoolset.org/schemas/v4/wxs/firewall" xmlns:util="http://wixtoolset.org/schemas/v4/wxs/util">
|
||||
|
||||
<Product Id="*"
|
||||
Name="$(var.FullName)"
|
||||
Language="1033"
|
||||
Version="!(bind.fileVersion.MoonlightExe)"
|
||||
Manufacturer="Moonlight Game Streaming Project"
|
||||
UpgradeCode="5c09f94e-f809-4c6a-9b7b-597c99f041fe">
|
||||
|
||||
<Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" />
|
||||
|
||||
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize" />
|
||||
<Package Name="$(var.FullName)"
|
||||
Language="1033"
|
||||
Version="!(bind.fileVersion.MoonlightExe)"
|
||||
Manufacturer="Moonlight Game Streaming Project"
|
||||
UpgradeCode="5c09f94e-f809-4c6a-9b7b-597c99f041fe">
|
||||
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize" />
|
||||
<MediaTemplate CompressionLevel="high" EmbedCab="yes" />
|
||||
|
||||
<Property Id="MPSSVC_START">
|
||||
<RegistrySearch Id="MpsSvcStart"
|
||||
Root="HKLM"
|
||||
Key="System\CurrentControlSet\Services\MpsSvc"
|
||||
Name="Start"
|
||||
Type="raw" />
|
||||
Root="HKLM"
|
||||
Key="System\CurrentControlSet\Services\MpsSvc"
|
||||
Name="Start"
|
||||
Type="raw" />
|
||||
</Property>
|
||||
|
||||
<Condition Message="Setup cannot proceed because the Windows Firewall service has been improperly disabled or stopped. You must start the Windows Firewall service (MpsSvc) to continue. If you would like to disable Windows Firewall properly, use the Windows Firewall options in Control Panel.">
|
||||
<![CDATA[Installed OR MPSSVC_START="#2"]]>
|
||||
</Condition>
|
||||
<Launch Condition="Installed OR MPSSVC_START="#2""
|
||||
Message="Setup cannot proceed because the Windows Firewall service has been improperly disabled or stopped. You must start the Windows Firewall service (MpsSvc) to continue. If you would like to disable Windows Firewall properly, use the Windows Firewall options in Control Panel." />
|
||||
|
||||
<?if $(var.Platform) = x64 Or $(var.Platform) = arm64 ?>
|
||||
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
|
||||
<?else ?>
|
||||
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
|
||||
<?endif ?>
|
||||
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="DesktopFolder" />
|
||||
<Directory Id="$(var.PlatformProgramFilesFolder)">
|
||||
<Directory Id="INSTALLFOLDER" Name="$(var.InstallFolder)" />
|
||||
</Directory>
|
||||
<Directory Id="ProgramMenuFolder">
|
||||
<Directory Id="ApplicationProgramsFolder" Name="$(var.InstallFolder)" />
|
||||
</Directory>
|
||||
</Directory>
|
||||
|
||||
<Property Id="APPDATAFOLDER">%LOCALAPPDATA%\Moonlight Game Streaming Project</Property>
|
||||
<Property Id="APPDATAFOLDER" Value="%LOCALAPPDATA%\Moonlight Game Streaming Project" />
|
||||
|
||||
<!-- There's no way to delete a registry key on uninstall but not major upgrade, so
|
||||
we have to roll our own deletion via custom action -->
|
||||
<CustomAction Id="DeleteRegistryKey"
|
||||
Directory="$(var.PlatformProgramFilesFolder)"
|
||||
ExeCommand="reg.exe delete "HKCU\Software\Moonlight Game Streaming Project" /f"
|
||||
Execute="deferred"
|
||||
Return="ignore"
|
||||
Impersonate="yes"/>
|
||||
Directory="ProgramFiles6432Folder"
|
||||
ExeCommand="reg.exe delete "HKCU\Software\Moonlight Game Streaming Project" /f"
|
||||
Execute="deferred"
|
||||
Return="ignore"
|
||||
Impersonate="yes" />
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action="DeleteRegistryKey" Before="InstallFinalize">Installed AND REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE</Custom>
|
||||
<Custom Action="DeleteRegistryKey"
|
||||
Before="InstallFinalize"
|
||||
Condition="Installed AND REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE" />
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<Component Id="MoonlightShortcuts" Guid="*" Directory="INSTALLFOLDER">
|
||||
<Shortcut Id="StartMenuShortcut"
|
||||
Name="$(var.ShortcutName)"
|
||||
Description="$(var.ShortcutDesc)"
|
||||
Target="[#MoonlightExe]"
|
||||
Directory="ApplicationProgramsFolder"
|
||||
WorkingDirectory="INSTALLFOLDER" />
|
||||
<RemoveFolder Id="CleanupStartMenuShortcut" Directory="ApplicationProgramsFolder" On="uninstall" />
|
||||
<util:RemoveFolderEx Id="CleanupAppDataFolder" On="uninstall" Property="APPDATAFOLDER" />
|
||||
<RegistryValue Root="HKCU" Key="Software\Moonlight Game Streaming Project" Name="Installed" Type="integer" Value="1" KeyPath="yes" />
|
||||
<Component Id="MoonlightShortcuts" Directory="INSTALLFOLDER">
|
||||
<Shortcut Id="StartMenuShortcut"
|
||||
Name="$(var.ShortcutName)"
|
||||
Description="$(var.ShortcutDesc)"
|
||||
Target="[#MoonlightExe]"
|
||||
Directory="ApplicationProgramsFolder"
|
||||
WorkingDirectory="INSTALLFOLDER" />
|
||||
<RemoveFolder Id="CleanupStartMenuShortcut"
|
||||
Directory="ApplicationProgramsFolder"
|
||||
On="uninstall" />
|
||||
<util:RemoveFolderEx Id="CleanupAppDataFolder"
|
||||
On="uninstall"
|
||||
Property="APPDATAFOLDER" />
|
||||
<RegistryValue Root="HKCU"
|
||||
Key="Software\Moonlight Game Streaming Project"
|
||||
Name="Installed"
|
||||
Type="integer"
|
||||
Value="1"
|
||||
KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<Component Id="MoonlightDesktopShortcut" Guid="*" Directory="INSTALLFOLDER">
|
||||
<Component Id="MoonlightDesktopShortcut" Directory="INSTALLFOLDER" Condition="ADDDESKTOPSHORTCUT=1">
|
||||
<Shortcut Id="DesktopShortcut"
|
||||
Name="$(var.ShortcutName)"
|
||||
Description="$(var.ShortcutDesc)"
|
||||
Target="[#MoonlightExe]"
|
||||
Directory="DesktopFolder"
|
||||
WorkingDirectory="INSTALLFOLDER" />
|
||||
<RemoveFolder Id="CleanupDesktopShortcut" Directory="DesktopFolder" On="uninstall" />
|
||||
Name="$(var.ShortcutName)"
|
||||
Description="$(var.ShortcutDesc)"
|
||||
Target="[#MoonlightExe]"
|
||||
Directory="DesktopFolder"
|
||||
WorkingDirectory="INSTALLFOLDER" />
|
||||
<RemoveFolder Id="CleanupDesktopShortcut"
|
||||
Directory="DesktopFolder"
|
||||
On="uninstall" />
|
||||
<RegistryValue Root="HKCU"
|
||||
Key="Software\Moonlight Game Streaming Project"
|
||||
Name="DesktopShortcutInstalled"
|
||||
Type="integer"
|
||||
Value="1"
|
||||
KeyPath="yes" />
|
||||
<Condition>ADDDESKTOPSHORTCUT=1</Condition>
|
||||
Key="Software\Moonlight Game Streaming Project"
|
||||
Name="DesktopShortcutInstalled"
|
||||
Type="integer"
|
||||
Value="1"
|
||||
KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<!-- Persist desktop shortcut's installed state to let Bundle.wxs know if
|
||||
the desktop shortcut should installed by default when upgrading the
|
||||
product -->
|
||||
<Component Id="MoonlightDesktopShortcutState" Guid="*" Directory="INSTALLFOLDER">
|
||||
<Component Id="MoonlightDesktopShortcutState" Directory="INSTALLFOLDER">
|
||||
<RegistryValue Root="HKCU"
|
||||
Key="Software\Moonlight Game Streaming Project"
|
||||
Name="DesktopShortcutInstallState"
|
||||
Type="integer"
|
||||
Value="[ADDDESKTOPSHORTCUT]"
|
||||
KeyPath="yes" />
|
||||
Key="Software\Moonlight Game Streaming Project"
|
||||
Name="DesktopShortcutInstallState"
|
||||
Type="integer"
|
||||
Value="[ADDDESKTOPSHORTCUT]"
|
||||
KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<DirectoryRef Id="INSTALLFOLDER">
|
||||
<Component Id="Moonlight" Guid="*">
|
||||
<File Id="MoonlightExe" KeyPath="yes" Checksum="yes" Source="$(var.SourceDir)\Moonlight.exe">
|
||||
<Component Id="Moonlight">
|
||||
<File Id="MoonlightExe"
|
||||
KeyPath="yes"
|
||||
Checksum="yes"
|
||||
Source="$(var.BuildDir)\app\$(var.Configuration)\Moonlight.exe">
|
||||
<fire:FirewallException Id="MoonlightFirewallException"
|
||||
Scope="any"
|
||||
Name="$(var.FullName)" />
|
||||
Scope="any"
|
||||
Name="$(var.FullName)" />
|
||||
</File>
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
@@ -123,5 +113,13 @@
|
||||
<ComponentRef Id="MoonlightDesktopShortcut" />
|
||||
<ComponentGroupRef Id="MoonlightDependencies" />
|
||||
</Feature>
|
||||
</Product>
|
||||
|
||||
<StandardDirectory Id="DesktopFolder" />
|
||||
<StandardDirectory Id="ProgramFiles6432Folder">
|
||||
<Directory Id="INSTALLFOLDER" Name="$(var.InstallFolder)" />
|
||||
</StandardDirectory>
|
||||
<StandardDirectory Id="ProgramMenuFolder">
|
||||
<Directory Id="ApplicationProgramsFolder" Name="$(var.InstallFolder)" />
|
||||
</StandardDirectory>
|
||||
</Package>
|
||||
</Wix>
|
||||
|
||||
Reference in New Issue
Block a user