golang.zx2c4.com/wireguard/windows@v0.5.4-0.20230123132234-dcc0eb72a04b/installer/wireguard.wxs (about)

     1  <?xml version="1.0" encoding="UTF-8"?>
     2  <!--
     3  	SPDX-License-Identifier: GPL-2.0
     4  
     5  	Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
     6  -->
     7  
     8  <?if $(var.WIREGUARD_PLATFORM) = "amd64" Or $(var.WIREGUARD_PLATFORM) = "arm64"?>
     9  	<?define PlatformProgramFilesFolder = "ProgramFiles64Folder"?>
    10  <?else?>
    11  	<?define PlatformProgramFilesFolder = "ProgramFilesFolder"?>
    12  <?endif?>
    13  <?if $(var.WIREGUARD_PLATFORM) = "amd64"?>
    14  	<?define UpgradeCode = "5e5a1da5-ba36-404d-92ec-41050d1c799c"?>
    15  <?elseif $(var.WIREGUARD_PLATFORM) = "x86"?>
    16  	<?define UpgradeCode = "62754a0a-fee9-4412-b739-e8da2e7c9405"?>
    17  <?elseif $(var.WIREGUARD_PLATFORM) = "arm"?>
    18  	<?define UpgradeCode = "f90bca59-9627-431d-92b4-a5c2d9a529ff"?>
    19  <?elseif $(var.WIREGUARD_PLATFORM) = "arm64"?>
    20  	<?define UpgradeCode = "7ff76099-8940-4d3e-99b9-50a3b3ca1ee9"?>
    21  <?else?>
    22  	<?error Unknown platform ?>
    23  <?endif?>
    24  
    25  <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    26  	<Product
    27  		Id="*"
    28  		Name="WireGuard"
    29  		Language="1033"
    30  		Version="$(var.WIREGUARD_VERSION)"
    31  		Manufacturer="WireGuard LLC"
    32  		UpgradeCode="$(var.UpgradeCode)">
    33  		<Package
    34  			InstallerVersion="500"
    35  			Compressed="yes"
    36  			InstallScope="perMachine"
    37  			Description="WireGuard: Fast, Modern, Secure VPN Tunnel"
    38  			ReadOnly="yes" />
    39  
    40  		<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
    41  
    42  		<Icon Id="wireguard.ico" SourceFile="..\ui\icon\wireguard.ico" />
    43  		<Binary Id="customactions.dll" SourceFile="$(var.WIREGUARD_PLATFORM)\customactions.dll" />
    44  
    45  		<Property Id="ARPPRODUCTICON" Value="wireguard.ico" />
    46  		<Property Id="ARPURLINFOABOUT" Value="https://www.wireguard.com/" />
    47  		<Property Id="ARPNOMODIFY" Value="yes" />
    48  		<Property Id="DISABLEADVTSHORTCUTS" Value="yes" />
    49  		<Property Id="DISABLEROLLBACK" Value="yes" />
    50  		<Property Id="MSIDISABLERMRESTART" Value="1" />
    51  		<Property Id="MSIRMSHUTDOWN" Value="1" />
    52  
    53  		<!--
    54  			Upgrading
    55  		-->
    56  		<MajorUpgrade
    57  			AllowDowngrades="no"
    58  			AllowSameVersionUpgrades="yes"
    59  			DowngradeErrorMessage="A newer version of [ProductName] is already installed."
    60  			Schedule="afterInstallExecute"
    61  			IgnoreRemoveFailure="yes" />
    62  
    63  		<!--
    64  			Folders
    65  		-->
    66  		<Directory Id="TARGETDIR" Name="SourceDir">
    67  			<Directory Id="$(var.PlatformProgramFilesFolder)">
    68  				<Directory Id="WireGuardFolder" Name="WireGuard" />
    69  			</Directory>
    70  			<Directory Id="ProgramMenuFolder" />
    71  		</Directory>
    72  
    73  		<!--
    74  			Components
    75  		-->
    76  		<ComponentGroup Id="WireGuardComponents">
    77  			<Component Directory="WireGuardFolder" Id="WireGuardExecutable" Guid="c3508d23-3362-47ce-9220-321bdb1a1acc">
    78  				<File Source="..\$(var.WIREGUARD_PLATFORM)\wireguard.exe" KeyPath="yes">
    79  					<Shortcut Id="WireGuardStartMenuShortcut" Directory="ProgramMenuFolder" Name="WireGuard" Description="WireGuard: Fast, Modern, Secure VPN Tunnel" WorkingDirectory="WireGuardFolder" Advertise="yes" />
    80  				</File>
    81  				<ServiceControl Id="DummyService.3AA0C492_29F4_4342_B608_DB95B2DECB13" Name="DummyService.3AA0C492_29F4_4342_B608_DB95B2DECB13" /><!-- A dummy to make WiX create ServiceControl table for us. -->
    82  			</Component>
    83  			<Component Directory="WireGuardFolder" Id="WgExecutable" Guid="540cf446-fcc3-4452-b9fb-eb4c02780251">
    84  				<File Source="..\$(var.WIREGUARD_PLATFORM)\wg.exe" KeyPath="yes" />
    85  				<Environment Id="PATH" Name="PATH" System="yes" Action="set" Part="last" Permanent="no" Value="[WireGuardFolder]" />
    86  			</Component>
    87  		</ComponentGroup>
    88  
    89  		<!--
    90  			Features
    91  		-->
    92  		<Feature Id="WireGuardFeature" Title="WireGuard" Level="1">
    93  			<ComponentGroupRef Id="WireGuardComponents" />
    94  		</Feature>
    95  
    96  		<!--
    97  			Abort early if running under Wow64
    98  		-->
    99  		<CustomAction Id="CheckWow64" BinaryKey="customactions.dll" DllEntry="CheckWow64" />
   100  		<InstallExecuteSequence>
   101  			<Custom Action="CheckWow64" After="FindRelatedProducts">NOT REMOVE</Custom>
   102  		</InstallExecuteSequence>
   103  
   104  		<!--
   105  			Evaluate WireGuard services and populate ServiceControl table
   106  		-->
   107  		<CustomAction Id="EvaluateWireGuardServices" BinaryKey="customactions.dll" DllEntry="EvaluateWireGuardServices" />
   108  		<InstallExecuteSequence>
   109  			<Custom Action="EvaluateWireGuardServices" After="FindRelatedProducts" />
   110  		</InstallExecuteSequence>
   111  
   112  		<!--
   113  			Launch wireguard.exe on product reconfiguration (starting same MSI again)
   114  		-->
   115  		<CustomAction Id="LaunchApplicationAndAbort" BinaryKey="customactions.dll" DllEntry="LaunchApplicationAndAbort" />
   116  		<InstallExecuteSequence>
   117  			<Custom Action="LaunchApplicationAndAbort" After="CostFinalize">ProductState=5 AND NOT REMOVE AND NOT DO_NOT_LAUNCH</Custom>
   118  		</InstallExecuteSequence>
   119  
   120  		<!--
   121  			Evaluate WireGuard components
   122  		-->
   123  		<CustomAction Id="EvaluateWireGuardComponents" BinaryKey="customactions.dll" DllEntry="EvaluateWireGuardComponents" />
   124  		<InstallExecuteSequence>
   125  			<Custom Action="EvaluateWireGuardComponents" After="ProcessComponents" />
   126  		</InstallExecuteSequence>
   127  
   128  		<!--
   129  			Kill lingering processes
   130  		-->
   131  		<CustomAction Id="KillWireGuardProcesses" BinaryKey="customactions.dll" DllEntry="KillWireGuardProcesses" Execute="deferred" Impersonate="no" />
   132  		<InstallExecuteSequence>
   133  			<Custom Action="KillWireGuardProcesses" After="StopServices" />
   134  		</InstallExecuteSequence>
   135  
   136  		<!--
   137  			Clear out our config folder on uninstall
   138  		-->
   139  		<CustomAction Id="RemoveConfigFolder" BinaryKey="customactions.dll" DllEntry="RemoveConfigFolder" Execute="deferred" Impersonate="no" />
   140  		<InstallExecuteSequence>
   141  			<Custom Action="RemoveConfigFolder" After="DeleteServices" />
   142  		</InstallExecuteSequence>
   143  
   144  		<!--
   145  			Clear out our adapters on uninstall
   146  		-->
   147  		<CustomAction Id="RemoveAdapters" BinaryKey="customactions.dll" DllEntry="RemoveAdapters" Execute="deferred" Impersonate="no" />
   148  		<InstallExecuteSequence>
   149  			<Custom Action="RemoveAdapters" Before="RemoveFiles" />
   150  		</InstallExecuteSequence>
   151  
   152  		<!--
   153  			Launch wireguard.exe after setup complete
   154  		-->
   155  		<CustomAction Id="LaunchApplication" HideTarget="yes" Impersonate="no" Execute="deferred" FileKey="wireguard.exe" ExeCommand="" Return="asyncNoWait" />
   156  		<InstallExecuteSequence>
   157  			<Custom Action="LaunchApplication" Before="InstallFinalize">(&amp;WireGuardFeature = 3) AND NOT DO_NOT_LAUNCH</Custom>
   158  		</InstallExecuteSequence>
   159  	</Product>
   160  </Wix>