aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/installer/installer.wxs
blob: b2f22034589ce97cfdf2b323701d73c8e65554b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:difx='http://schemas.microsoft.com/wix/DifxAppExtension'>
  <Product Id="*" Name="WireGuard" Language="1033" Version="0.0.0.1" Manufacturer="WireGuard LLC" UpgradeCode="5e5a1da5-ba36-404d-92ec-41050d1c799c">
    <!-- TODO: uninstall before installing -->
    <Package InstallerVersion="200" Compressed="yes" Platform="x64" InstallScope="perMachine" Description="WireGuard: Fast, Modern, Secure VPN Tunnel" ReadOnly="yes" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowDowngrades="no" IgnoreRemoveFailure="no" AllowSameVersionUpgrades="yes" />
    <MediaTemplate EmbedCab="yes" CompressionLevel="high" />

    <Icon Id="icon.ico" SourceFile="..\ui\icon\icon.ico" />
    <Property Id="ARPPRODUCTICON" Value="icon.ico" />
    <Property Id="ARPURLINFOABOUT" Value="https://www.wireguard.com/" />
    <Property Id="ARPNOREPAIR" Value="yes" />
    <Property Id="ARPNOMODIFY" Value="yes" />
    <Property Id="DISABLEADVTSHORTCUTS" Value="yes" />

    <Feature Id="WireGuardFeature" Title="WireGuard" Level="1">
      <ComponentGroupRef Id="WireGuardComponents" />
    </Feature>
    <Feature Id="WintunFeature" Title="Wintun" Level="1">
      <ComponentGroupRef Id="WintunComponents" />
    </Feature>
  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFiles64Folder">
        <Directory Id="INSTALLFOLDER" Name="WireGuard" />
      </Directory>
      <Directory Id="ProgramMenuFolder" Name="ProgramMenuFolder" />
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="WireGuardComponents">
      <Component Directory="INSTALLFOLDER" Id="WireGuardExecutable" Win64="yes">
        <File Source="..\wireguard.exe" KeyPath="yes">
          <Shortcut Id="WireGuardStartMenuShortcut" Directory="ProgramMenuFolder" Name="WireGuard" Description="WireGuard: Fast, Modern, Secure VPN Tunnel" WorkingDirectory="INSTALLFOLDER" Advertise="yes" />
        </File>
        <ServiceControl Id="RemoveWireGuardManagerService" Name="WireGuardManager" Remove="both" Stop="both"></ServiceControl>
        <ServiceControl Id="RemoveWireGuardTunnelServices" Name="WireGuardTunnel$test" Remove="both" Stop="both"></ServiceControl>
        <!-- TODO: "test" is just a temporary hack. We need to enumerate all services that are "WireGuardTunnel$*" and remove those. -->
      </Component>
    </ComponentGroup>

    <ComponentGroup Id="WintunComponents">
      <Component Directory="INSTALLFOLDER" Id="WintunComponent" Guid="f84ff766-d154-44a3-9c50-371503f46ce6" Win64="yes" Shared="yes" SharedDllRefCount="yes">
        <!-- TODO: make sure we're installing the latest one. -->
        <difx:Driver DeleteFiles="yes" ForceInstall="yes" Legacy="yes" PlugAndPlayPrompt="no" AddRemovePrograms="no" /> <!-- TODO: Remove legacy once we start signing drivers. -->
        <!-- TODO: These should not end up staying in programfiles after the driver is installed. -->
        <File Source="..\wintun\x64\Release\wintun\wintun.inf" />
        <File Source="..\wintun\x64\Release\wintun\wintun.cat" />
        <File Source="..\wintun\x64\Release\wintun\wintun.sys" />
      </Component>
    </ComponentGroup>

    <InstallExecuteSequence>
      <!-- TODO: this should not launch when msiexec is called with whatever flag means it shouldn't launch. -->
      <Custom Action="LaunchApplication" After="PublishProduct">NOT Installed</Custom>
    </InstallExecuteSequence>
    <CustomAction Id="LaunchApplication" HideTarget="yes" Impersonate="no" Execute="deferred" FileKey="wireguard.exe" ExeCommand="" Return="asyncNoWait" />

    <!-- TODO: On uninstall remove system32\config\wireguard. -->
    <!-- TODO: On install and uninstall, kill services. -->
  </Fragment>
</Wix>