blob: 89e98dc3121ed5a8f0b02391e54dcce7a35f0224 (
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
|
<?xml version="1.0" encoding="utf-8"?>
<!--
Zellij MSI installer (WiX v6).
Custom UI built from individual WixToolset.UI.wixext stock dialogs plus a
custom welcome/EULA dialog (ZellijWelcomeDlg). We do NOT use the stock
WixUI_Advanced dialog set because:
- It does not support dual-scope packages (wixtoolset/issues#7137)
- Its AdvancedWelcomeEulaDlg cannot be overridden (not declared virtual)
- It includes a Print button and FeaturesDlg we don't need
Instead we reference stock dialogs individually (InstallScopeDlg,
InstallDirDlg, VerifyReadyDlg, etc.) and wire up navigation ourselves.
Dual-scope support:
Scope="perUserOrMachine" sets ALLUSERS=2, MSIINSTALLPERUSER=1.
Custom actions (SetFolderPerUser / SetFolderPerMachine) resolve
APPLICATIONFOLDER to the correct path based on scope selection.
The stock WixUI_Advanced folder CAs are broken for this scenario.
Dialog flow:
New install: ZellijWelcomeDlg → [Advanced] → InstallScopeDlg
→ InstallDirDlg → VerifyReadyDlg
Quick install: ZellijWelcomeDlg → [Install] (per-user, no UAC)
Maintenance: MaintenanceWelcomeDlg → MaintenanceTypeDlg → VerifyReadyDlg
Build:
wix build wix\main.wxs wix\Zellij.wxl -d Version=X.Y.Z -arch x64
-ext WixToolset.UI.wixext -o target\wix\zellij-x86_64-pc-windows-msvc.msi
-->
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="Zellij"
Manufacturer="Zellij Contributors"
Version="$(var.Version)"
UpgradeCode="BEE7A897-6DE0-4243-9977-5924C8CDB391"
Scope="perUserOrMachine"
InstallerVersion="500">
<!-- Properties used by stock InstallScopeDlg and InstallDirDlg -->
<Property Id="ApplicationFolderName" Value="Zellij" />
<Property Id="WixAppFolder" Value="WixPerUserFolder" />
<Property Id="WIXUI_INSTALLDIR" Value="APPLICATIONFOLDER" />
<!-- Icon shown in Add/Remove Programs -->
<Icon Id="ZellijIcon" SourceFile="assets\logo128.ico" />
<Property Id="ARPPRODUCTICON" Value="ZellijIcon" />
<!-- Auto-remove previous versions -->
<MajorUpgrade DowngradeErrorMessage="A newer version of Zellij is already installed." />
<!-- Embed the .cab inside the MSI -->
<MediaTemplate EmbedCab="yes" />
<!-- ===== Directory tree ===== -->
<StandardDirectory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONFOLDER" Name="Zellij" />
</StandardDirectory>
<!-- ===== Custom actions for folder resolution =====
The stock WixUI_Advanced CAs (WixSetPerUserFolder / WixSetPerMachineFolder)
resolve incorrectly under Scope="perUserOrMachine" because WixPerMachineFolder
is evaluated before the user selects a scope. We bypass them entirely and set
APPLICATIONFOLDER to explicit paths based on MSIINSTALLPERUSER. -->
<CustomAction Id="SetFolderPerUser"
Property="APPLICATIONFOLDER"
Value="[LocalAppDataFolder]Zellij" />
<CustomAction Id="SetFolderPerMachine"
Property="APPLICATIONFOLDER"
Value="[ProgramFilesFolder]Zellij" />
<!-- Schedule in both UI and Execute sequences so the correct path is set
even after UAC elevation re-launches the server process. -->
<InstallExecuteSequence>
<Custom Action="SetFolderPerUser" Before="CostFinalize"
Condition="MSIINSTALLPERUSER = 1" />
<Custom Action="SetFolderPerMachine" Before="CostFinalize"
Condition="NOT MSIINSTALLPERUSER" />
</InstallExecuteSequence>
<InstallUISequence>
<Custom Action="SetFolderPerUser" Before="CostFinalize"
Condition="MSIINSTALLPERUSER = 1" />
<Custom Action="SetFolderPerMachine" Before="CostFinalize"
Condition="NOT MSIINSTALLPERUSER" />
</InstallUISequence>
<!-- ===== Components =====
Three components: binary (always), plus two conditional PATH components.
ALLUSERS is set by InstallScopeDlg: 1 for per-machine, empty for per-user.
Default (quick install without scope dialog): ALLUSERS=2, which is <> 1,
so path_user activates — correct for the per-user default. -->
<Component Id="binary"
Directory="APPLICATIONFOLDER"
Guid="BC9D18AE-17CA-4790-ADB0-C64530DEDE57">
<File Id="zellij_exe"
Source="target\release\zellij.exe"
KeyPath="yes" />
</Component>
<Component Id="path_machine"
Directory="APPLICATIONFOLDER"
Guid="85C2CC85-8379-4C27-8337-A90EAD9AC265"
Condition="ALLUSERS = 1">
<RegistryValue Root="HKLM"
Key="Software\Zellij"
Name="InstallPath"
Type="string"
Value="[APPLICATIONFOLDER]"
KeyPath="yes" />
<Environment Id="PATH_machine"
Name="PATH"
Value="[APPLICATIONFOLDER]"
Permanent="no"
Part="last"
Action="set"
System="yes" />
</Component>
<Component Id="path_user"
Directory="APPLICATIONFOLDER"
Guid="EED3D01E-8FBC-4F3D-A3E5-DF55939970CD"
Condition="ALLUSERS <> 1">
<RegistryValue Root="HKCU"
Key="Software\Zellij"
Name="InstallPath"
Type="string"
Value="[APPLICATIONFOLDER]"
KeyPath="yes" />
<Environment Id="PATH_user"
Name="PATH"
Value="[APPLICATIONFOLDER]"
Permanent="no"
Part="last"
Action="set"
System="no" />
</Component>
<!-- ===== Feature ===== -->
<Feature Id="MainFeature" Title="Zellij" Level="1">
<ComponentRef Id="binary" />
<ComponentRef Id="path_machine" />
<ComponentRef Id="path_user" />
</Feature>
<!-- ===== Custom UI =====
We define our own UI element instead of using <ui:WixUI Id="WixUI_Advanced" />
because WiX v6 does not allow overriding extension dialogs (they are not
declared virtual). We reference individual stock dialogs from
WixToolset.UI.wixext and provide our own ZellijWelcomeDlg and navigation. -->
<UI>
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
<TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />
<TextStyle Id="WixUI_Font_Emphasized" FaceName="Tahoma" Size="9" Bold="yes" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<!-- Individual stock dialogs from WixToolset.UI.wixext -->
<DialogRef Id="BrowseDlg" />
<DialogRef Id="DiskCostDlg" />
<DialogRef Id="ErrorDlg" />
<DialogRef Id="ExitDialog" />
<DialogRef Id="FatalError" />
<DialogRef Id="FilesInUse" />
<DialogRef Id="InstallDirDlg" />
<DialogRef Id="InstallScopeDlg" />
<DialogRef Id="MaintenanceTypeDlg" />
<DialogRef Id="MaintenanceWelcomeDlg" />
<DialogRef Id="MsiRMFilesInUse" />
<DialogRef Id="PrepareDlg" />
<DialogRef Id="ProgressDlg" />
<DialogRef Id="ResumeDlg" />
<DialogRef Id="UserExit" />
<DialogRef Id="VerifyReadyDlg" />
<DialogRef Id="WaitForCostingDlg" />
<!-- ==========================================
ZellijWelcomeDlg — custom welcome + EULA dialog.
Based on the stock AdvancedWelcomeEulaDlg from WixToolset.UI.wixext
(src/ext/UI/wixlib/AdvancedWelcomeEulaDlg.wxs) with Print button removed.
Localization strings (!(loc.XXX)) come from the extension's WXL files;
overrides are in wix/Zellij.wxl.
========================================== -->
<Dialog Id="ZellijWelcomeDlg" Width="370" Height="270"
Title="!(loc.AdvancedWelcomeEulaDlg_Title)">
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44"
TabSkip="no" Text="!(loc.AdvancedWelcomeEulaDlgBannerBitmap)" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="373" Height="0" />
<Control Id="Title" Type="Text" X="20" Y="10" Width="300" Height="24"
Transparent="yes" NoPrefix="yes"
Text="!(loc.AdvancedWelcomeEulaDlgTitle)" />
<Control Id="DescriptionPerMachine" Type="Text" X="20" Y="202" Width="330" Height="31"
Transparent="yes" NoPrefix="yes" Hidden="yes"
Text="!(loc.AdvancedWelcomeEulaDlgDescriptionPerMachine)"
ShowCondition="ALLUSERS" />
<Control Id="DescriptionPerUser" Type="Text" X="20" Y="202" Width="330" Height="31"
Transparent="yes" NoPrefix="yes" Hidden="yes"
Text="!(loc.AdvancedWelcomeEulaDlgDescriptionPerUser)"
ShowCondition="NOT ALLUSERS" />
<Control Id="LicenseAcceptedCheckBox" Type="CheckBox" X="20" Y="180" Width="226" Height="18"
CheckBoxValue="1" Property="LicenseAccepted"
Text="!(loc.WelcomeEulaDlgLicenseAcceptedCheckBox)" />
<Control Id="LicenseText" Type="ScrollableText" X="20" Y="55" Width="330" Height="121"
Sunken="yes" TabSkip="no">
<Text SourceFile="!(wix.WixUILicenseRtf)" />
</Control>
<Control Id="Advanced" Type="PushButton" X="156" Y="243" Width="56" Height="17"
Text="!(loc.AdvancedWelcomeEulaDlgAdvanced)"
DisableCondition="LicenseAccepted <> "1""
EnableCondition="LicenseAccepted = "1"" />
<Control Id="Install" Type="PushButton" ElevationShield="yes"
X="212" Y="243" Width="80" Height="17" Default="yes"
Text="!(loc.AdvancedWelcomeEulaDlgInstall)" Hidden="yes"
DisableCondition="LicenseAccepted <> "1""
EnableCondition="LicenseAccepted = "1""
ShowCondition="ALLUSERS">
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg"
Condition="!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1" />
<Publish Event="EndDialog" Value="Return"
Condition="OutOfDiskSpace <> 1" />
<Publish Event="SpawnDialog" Value="OutOfRbDiskDlg"
Condition="OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)" />
<Publish Event="EndDialog" Value="Return"
Condition="OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"" />
<Publish Event="EnableRollback" Value="False"
Condition="OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"" />
<Publish Event="SpawnDialog" Value="OutOfDiskDlg"
Condition="(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")" />
</Control>
<Control Id="InstallNoShield" Type="PushButton" ElevationShield="no"
X="212" Y="243" Width="80" Height="17" Default="yes"
Text="!(loc.AdvancedWelcomeEulaDlgInstall)" Hidden="yes"
DisableCondition="LicenseAccepted <> "1""
EnableCondition="LicenseAccepted = "1""
ShowCondition="NOT ALLUSERS">
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg"
Condition="!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1" />
<Publish Event="EndDialog" Value="Return"
Condition="OutOfDiskSpace <> 1" />
<Publish Event="SpawnDialog" Value="OutOfRbDiskDlg"
Condition="OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST="P" OR NOT PROMPTROLLBACKCOST)" />
<Publish Event="EndDialog" Value="Return"
Condition="OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"" />
<Publish Event="EnableRollback" Value="False"
Condition="OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST="D"" />
<Publish Event="SpawnDialog" Value="OutOfDiskDlg"
Condition="(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST="F")" />
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17"
Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg" />
</Control>
</Dialog>
<!-- ==========================================
Navigation: new install flow.
Scope dialog sets ALLUSERS, MSIINSTALLPERUSER, and fires our
folder CAs so InstallDirDlg shows the correct default path.
========================================== -->
<Publish Dialog="ZellijWelcomeDlg" Control="Advanced"
Event="NewDialog" Value="InstallScopeDlg" />
<Publish Dialog="InstallScopeDlg" Control="Back"
Event="NewDialog" Value="ZellijWelcomeDlg" />
<Publish Dialog="InstallScopeDlg" Control="Next"
Property="WixAppFolder" Value="WixPerUserFolder" Order="1"
Condition="NOT Privileged" />
<Publish Dialog="InstallScopeDlg" Control="Next"
Property="ALLUSERS" Value="{}" Order="2"
Condition="WixAppFolder = "WixPerUserFolder"" />
<Publish Dialog="InstallScopeDlg" Control="Next"
Property="ALLUSERS" Value="1" Order="3"
Condition="WixAppFolder = "WixPerMachineFolder"" />
<Publish Dialog="InstallScopeDlg" Control="Next"
Property="MSIINSTALLPERUSER" Value="1" Order="4"
Condition="WixAppFolder = "WixPerUserFolder"" />
<Publish Dialog="InstallScopeDlg" Control="Next"
Property="MSIINSTALLPERUSER" Value="{}" Order="5"
Condition="WixAppFolder = "WixPerMachineFolder"" />
<Publish Dialog="InstallScopeDlg" Control="Next"
Event="DoAction" Value="SetFolderPerUser" Order="6"
Condition="WixAppFolder = "WixPerUserFolder"" />
<Publish Dialog="InstallScopeDlg" Control="Next"
Event="DoAction" Value="SetFolderPerMachine" Order="7"
Condition="WixAppFolder = "WixPerMachineFolder"" />
<Publish Dialog="InstallScopeDlg" Control="Next"
Event="NewDialog" Value="InstallDirDlg" Order="8" />
<Publish Dialog="InstallDirDlg" Control="Back"
Event="NewDialog" Value="InstallScopeDlg" />
<Publish Dialog="InstallDirDlg" Control="Next"
Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1" />
<Publish Dialog="InstallDirDlg" Control="Next"
Event="NewDialog" Value="VerifyReadyDlg" Order="2" />
<Publish Dialog="InstallDirDlg" Control="ChangeFolder"
Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1" />
<Publish Dialog="InstallDirDlg" Control="ChangeFolder"
Event="SpawnDialog" Value="BrowseDlg" Order="2" />
<Publish Dialog="BrowseDlg" Control="OK"
Event="SetTargetPath" Value="[_BrowseProperty]" Order="1" />
<Publish Dialog="BrowseDlg" Control="OK"
Event="EndDialog" Value="Return" Order="2" />
<Publish Dialog="VerifyReadyDlg" Control="Back"
Event="NewDialog" Value="InstallDirDlg" Order="1"
Condition="NOT Installed" />
<Publish Dialog="VerifyReadyDlg" Control="Back"
Event="NewDialog" Value="MaintenanceTypeDlg" Order="2"
Condition="Installed AND NOT PATCH" />
<Publish Dialog="ExitDialog" Control="Finish"
Event="EndDialog" Value="Return" Order="999" />
<!-- Navigation: maintenance (repair/uninstall) -->
<Publish Dialog="MaintenanceWelcomeDlg" Control="Next"
Event="NewDialog" Value="MaintenanceTypeDlg" />
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton"
Event="NewDialog" Value="VerifyReadyDlg" />
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton"
Event="NewDialog" Value="VerifyReadyDlg" />
<Publish Dialog="MaintenanceTypeDlg" Control="Back"
Event="NewDialog" Value="MaintenanceWelcomeDlg" />
</UI>
<!-- Show our welcome dialog for new installs -->
<InstallUISequence>
<Show Dialog="ZellijWelcomeDlg" Before="ProgressDlg"
Condition="NOT Installed" />
</InstallUISequence>
<!-- WixUI_Common provides shared error/progress/cancel dialogs -->
<UIRef Id="WixUI_Common" />
<!-- These variables were originally defined in the WixUI_Advanced fragment
which we no longer use. InstallScopeDlg references them to decide
which radio buttons to show. -->
<WixVariable Id="WixUISupportPerUser" Value="1" />
<WixVariable Id="WixUISupportPerMachine" Value="1" />
<WixVariable Id="WixUILicenseRtf" Value="wix\License.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="wix\banner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="wix\dialog.bmp" />
</Package>
</Wix>
|