2020-11-29 22:06:02 -06:00

154 lines
7.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<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">
<Product Id="*" Name="Moonlight Internet Hosting Tool" Language="1033" Version="!(bind.fileVersion.MistExe)"
Manufacturer="Moonlight Game Streaming Project" UpgradeCode="cfc2fb53-88e2-4867-851d-9ed9fe7ab2a3">
<Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Feature Id="ProductFeature" Title="MISHSetup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<!-- Enable the Windows Firewall service if it is disabled. Disabling the Windows Firewall service
will paradoxically block *all* incoming network traffic and prevent GameStream, MIST, MISS,
and other local servers from working at all. The proper way to disable Windows Firewall is via
the Windows Firewall control panel applet. -->
<Fragment>
<Property Id="MPSSVC_START">
<RegistrySearch Id="MpsSvcStart"
Root="HKLM"
Key="System\CurrentControlSet\Services\MpsSvc"
Name="Start"
Type="raw" />
</Property>
<SetProperty Id="EnableMpsSvc" Value='"[SystemFolder]sc.exe" config MpsSvc start= auto' Sequence="execute" Before="InstallInitialize"/>
<CustomAction Id="EnableMpsSvc" BinaryKey="WixCA" DllEntry="WixQuietExec"
Execute="deferred" Return="ignore" Impersonate="no"/>
<SetProperty Id="StartMpsSvc" Value='"[SystemFolder]net.exe" start MpsSvc' Sequence="execute" Before="InstallInitialize"/>
<CustomAction Id="StartMpsSvc" BinaryKey="WixCA" DllEntry="WixQuietExec"
Execute="deferred" Return="ignore" Impersonate="no"/>
</Fragment>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="Moonlight Internet Hosting Tool" />
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="Moonlight Internet Hosting Tool" />
</Directory>
<Directory Id="CommonAppDataFolder">
<Directory Name="MISS" Id="MISSLogFolder" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="MiniupnpcDll">
<File Source="$(var.miss.TargetDir)miniupnpc.dll" KeyPath="yes"/>
</Component>
<Component Id="LibnatpmpDll">
<File Source="$(var.miss.TargetDir)libnatpmp.dll" KeyPath="yes"/>
</Component>
<Component Id="MISS">
<File Source="$(var.miss.TargetPath)" KeyPath="yes">
<fire:FirewallException Id="MISSFwException"
Scope="any"
Name="Moonlight Internet Streaming Service"/>
</File>
<CreateFolder Directory="MISSLogFolder">
<util:PermissionEx User="NT SERVICE\MISS" GenericAll="yes" />
</CreateFolder>
<ServiceInstall Type="ownProcess"
Name="MISS"
DisplayName="Moonlight Internet Streaming Service"
Description="Automatically manages router port forwarding rules required to use Moonlight over the Internet"
Start="auto"
Account="NT AUTHORITY\LocalService"
ErrorControl="ignore"
Interactive="no">
<ServiceConfig DelayedAutoStart="no" OnInstall="yes" OnReinstall="yes" ServiceSid="unrestricted"/>
<util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="restart" ResetPeriodInDays="1" RestartServiceDelayInSeconds="10"/>
</ServiceInstall>
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="MISS" Wait="yes" />
</Component>
<Component Id="MIST">
<File Id="MistExe" Source="$(var.mist.TargetPath)" KeyPath="yes">
<fire:FirewallException Id="MISTFwException"
Scope="any"
Name="Moonlight Internet Streaming Tester"/>
</File>
</Component>
<Component Id="GameStreamFirewallRules" Guid="{16CA2511-B533-46F8-8882-F8AEEFDFD7DF}" KeyPath="yes">
<fire:FirewallException Id="HttpsFwException"
Scope="any"
Port="47984"
Protocol="tcp"
Name="Moonlight - HTTPS"/>
<fire:FirewallException Id="HttpFwException"
Scope="any"
Port="47989"
Protocol="tcp"
Name="Moonlight - HTTP"/>
<fire:FirewallException Id="RtspFwException"
Scope="any"
Port="48010"
Protocol="tcp"
Name="Moonlight - RTSP"/>
<fire:FirewallException Id="VideoFwException"
Scope="any"
Port="47998"
Protocol="udp"
Name="Moonlight - Video"/>
<fire:FirewallException Id="ControlFwException"
Scope="any"
Port="47999"
Protocol="udp"
Name="Moonlight - Control"/>
<fire:FirewallException Id="AudioFwException"
Scope="any"
Port="48000"
Protocol="udp"
Name="Moonlight - Audio"/>
<fire:FirewallException Id="RtspuFwException"
Scope="any"
Port="48010"
Protocol="udp"
Name="Moonlight - RTSPU"/>
<fire:FirewallException Id="MdnsFwException"
Scope="any"
Port="5353"
Protocol="udp"
Name="Moonlight - mDNS"/>
</Component>
<Component Id="Shortcuts" Guid="*">
<Shortcut Id="StartMenuShortcut"
Name="Moonlight Internet Streaming Tester"
Description="Test your configuration for streaming with Moonlight over the Internet"
Target="[#MistExe]"
Directory="ApplicationProgramsFolder"
WorkingDirectory="INSTALLFOLDER" />
<RemoveFolder Id="CleanupStartMenuShortcut" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\Moonlight Internet Streaming Tester" Name="Installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</ComponentGroup>
<InstallExecuteSequence>
<Custom Action="EnableMpsSvc" Before="StartMpsSvc">
<![CDATA[MPSSVC_START <> "#2"]]>
</Custom>
<Custom Action="StartMpsSvc" Before="StopServices">
<![CDATA[MPSSVC_START <> "#2"]]>
</Custom>
</InstallExecuteSequence>
</Fragment>
</Wix>