Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Blame · packaging/windows/vole.wxs

Line attribution on main · 94 line(s)

31560d91
Keenan Nemetz
2d ago
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 The Windows package.
4
5 Built with wixl (msitools), not the WiX toolset: WiX v5 and v6 refuse to build
6 an MSI anywhere but Windows (every relative path is canonicalized against a
7 hardcoded "C:\"), and the release workflow runs on a Linux runner. wixl
8 implements the WiX v3 schema, which is why this file uses it. Three of wixl
9 0.101's limits shape the package below:
10
11 - Component/@Permanent and @NeverOverwrite are silently ignored, so nothing
12 that has to survive an uninstall may be an MSI file. The configuration and
13 the data directory are created by `vole service install`, not by this
14 package.
15 - Environment elements on a component are unhandled, so the package does not
16 edit PATH; docs/deploy/windows.md says how to add it by hand.
17 - Execute="rollback" is emitted as an ordinary deferred action, so it cannot
18 be used. The service is installed by the binary's own idempotent command,
19 and uninstall removes it before the files go away.
20
21 Paths are resolved against the working directory, not this file, so the build
22 runs from the repository root:
23
24 wixl -a x64 -D Version=0.2.0 -o dist/vole-windows-amd64.msi \
25 packaging/windows/vole.wxs
26
27 wixl logs a GLib CRITICAL and writes an MSI with no files when a source is
28 missing, so the verify and release steps read the File table back instead of
29 trusting the exit status.
30 -->
31 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
32 <Product Id="*" Name="Vole" Language="1033" Version="$(var.Version)"
33 Manufacturer="Rodent Software" UpgradeCode="2F8C1B0A-9D34-4E6B-8B7E-0F5D9C3A7E21">
34 <Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" />
35 <MediaTemplate EmbedCab="yes" />
36
37 <!-- The upgrade table is written by hand because wixl 0.101's MajorUpgrade
38 schedules RemoveExistingProducts after InstallValidate and before
39 InstallInitialize, a window Windows Installer rejects with error 2613.
40 The sequence entry below places it after InstallInitialize instead: the
41 old product is removed — stopping its service — before the new files are
42 copied, which is what keeps the running executable unlocked. -->
43 <Upgrade Id="2F8C1B0A-9D34-4E6B-8B7E-0F5D9C3A7E21">
44 <UpgradeVersion Minimum="0.0.0" Maximum="$(var.Version)" IncludeMinimum="yes"
45 IncludeMaximum="no" Property="WIX_UPGRADE_DETECTED" />
46 <UpgradeVersion Minimum="$(var.Version)" IncludeMinimum="yes" OnlyDetect="yes"
47 Property="WIX_DOWNGRADE_DETECTED" />
48 </Upgrade>
49 <Condition Message="A newer version of Vole is already installed.">NOT WIX_DOWNGRADE_DETECTED</Condition>
50
51 <Directory Id="TARGETDIR" Name="SourceDir">
52 <Directory Id="ProgramFiles64Folder">
53 <Directory Id="INSTALLFOLDER" Name="Vole" />
54 </Directory>
55 </Directory>
56
57 <DirectoryRef Id="INSTALLFOLDER">
58 <Component Id="VoleExe" Guid="6B1C2E44-48B5-4C39-9C5D-1B7E9A6F2D10">
59 <File Id="VoleExeFile" Source="dist/vole-windows-amd64.exe" Name="vole.exe" KeyPath="yes" />
60 </Component>
61 <Component Id="Docs" Guid="A4D3C9B2-7F61-4E28-B3A9-5C0E8D2F1B47">
62 <File Id="LicenseFile" Source="LICENSE" KeyPath="yes" />
63 <File Id="NoticeFile" Source="NOTICE" />
64 </Component>
65 </DirectoryRef>
66
67 <Feature Id="Main">
68 <ComponentRef Id="VoleExe" />
69 <ComponentRef Id="Docs" />
70 </Feature>
71
72 <!-- The service is registered by the binary, so the MSI, the script, and a
73 hand-run install share one definition of the account, the recovery
74 actions, and the command line. FileKey names the file just installed;
75 no formatted properties are needed, which deferred actions cannot see. -->
76 <CustomAction Id="ServiceInstall" FileKey="VoleExeFile" ExeCommand="service install"
77 Execute="deferred" Impersonate="no" Return="check" />
78 <CustomAction Id="ServiceStart" FileKey="VoleExeFile" ExeCommand="service start"
79 Execute="deferred" Impersonate="no" Return="ignore" />
80 <CustomAction Id="ServiceUninstall" FileKey="VoleExeFile" ExeCommand="service uninstall"
81 Execute="deferred" Impersonate="no" Return="ignore" />
82
83 <InstallExecuteSequence>
84 <!-- Sequence numbers rather than After/Before: wixl's dependency placement
85 leaves RemoveExistingProducts behind InstallFiles and this action at
86 sequence 1, where a deferred action outside the transaction is at best
87 unexplained. These are the slots WiX uses for the same arrangement. -->
88 <Custom Action="RemoveExistingProducts" Sequence="1501" />
89 <Custom Action="ServiceUninstall" Sequence="3400">REMOVE="ALL"</Custom>
90 <Custom Action="ServiceInstall" Sequence="4001">NOT Installed</Custom>
91 <Custom Action="ServiceStart" Sequence="4002">NOT Installed</Custom>
92 </InstallExecuteSequence>
93 </Product>
94 </Wix>