Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

feat: add custom welcome dialog to standalone wix template

Lars Berger44c39e922236
diff --git a/resources/wix/standalone.wxs b/resources/wix/standalone.wxs
index 0eda9481..e72801b6 100644
--- a/resources/wix/standalone.wxs
+++ b/resources/wix/standalone.wxs
@@ -1,94 +1,220 @@
-<Wix
- xmlns="http://wixtoolset.org/schemas/v4/wxs"
- xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui"
->
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package
Name="GlazeWM"
+ Version="$(env.VERSION_NUMBER)"
UpgradeCode="ef0f849b-d90d-4647-bb26-730c6fce5f9e"
+ Manufacturer="Glzr Software Pte. Ltd."
Language="1033"
Codepage="1252"
- Version="0.0.0"
- Manufacturer="glzr.io"
InstallerVersion="200"
>
- <MajorUpgrade
- AllowSameVersionUpgrades="yes"
- DowngradeErrorMessage="A newer version of [ProductName] is already installed."
- />
+ <!--
+ Reinstall all files; rewrite all registry entries; reinstall all shortcuts.
+ Ref: https://docs.microsoft.com/en-us/windows/win32/msi/reinstallmode
+ -->
+ <Property Id="REINSTALLMODE" Value="amus" />
- <Icon Id="GlazeWMIco" SourceFile=".\resources\icon.ico" />
+ <!-- Allow version downgrades. -->
+ <MajorUpgrade Schedule="afterInstallInitialize" AllowDowngrades="yes" />
+
+ <!-- Set icon used by installer. -->
+ <Icon Id="GlazeWMIco" SourceFile="resources\icon.ico" />
<Property Id="ARPPRODUCTICON" Value="GlazeWMIco" />
+ <!-- Enable CAB embed, otherwise, a separate .cab file is created. -->
<MediaTemplate EmbedCab="yes" />
- <ui:WixUI Id="WixUI_Minimal" />
+
+ <UI>
+ <Dialog Id="WelcomeInstallDlg" Width="370" Height="270" Title="!(loc.WelcomeDlg_Title)">
+ <Control
+ Id="Bitmap"
+ Type="Bitmap"
+ X="0"
+ Y="0"
+ Width="370"
+ Height="234"
+ TabSkip="no"
+ Text="!(loc.WelcomeDlgBitmap)"
+ />
+ <Control
+ Id="Title"
+ Type="Text"
+ X="135"
+ Y="20"
+ Width="220"
+ Height="60"
+ Transparent="yes"
+ NoPrefix="yes"
+ Text="!(loc.WelcomeDlgTitle)"
+ />
+ <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
+ <Control
+ Id="Description"
+ Type="Text"
+ X="135"
+ Y="50"
+ Width="220"
+ Height="60"
+ Transparent="yes"
+ NoPrefix="yes"
+ Text="!(loc.WelcomeDlgDescription)"
+ />
+ <Control
+ Id="AddToStartMenuCheckbox"
+ Type="CheckBox"
+ X="135"
+ Y="190"
+ Width="226"
+ Height="18"
+ CheckBoxValue="1"
+ Property="ADD_START_MENU"
+ Default="no"
+ Text="Add shortcut to Start Menu"
+ />
+ <Control
+ Id="Back"
+ Type="PushButton"
+ X="156"
+ Y="243"
+ Width="56"
+ Height="17"
+ Disabled="yes"
+ Text="!(loc.WixUIBack)"
+ />
+ <Control
+ Id="Install"
+ Type="PushButton"
+ ElevationShield="yes"
+ X="212"
+ Y="243"
+ Width="80"
+ Height="17"
+ Default="yes"
+ Text="!(loc.WelcomeEulaDlgInstall)"
+ >
+ <Publish
+ Event="SpawnWaitDialog"
+ Value="WaitForCostingDlg"
+ Condition="!(wix.WixUICostingPopupOptOut) OR CostingComplete = 1"
+ />
+ <Publish Event="EndDialog" Value="Return" Condition="OutOfDiskSpace &lt;&gt; 1" />
+ <Publish
+ Event="SpawnDialog"
+ Value="OutOfRbDiskDlg"
+ Condition="OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND (PROMPTROLLBACKCOST=&quot;P&quot; OR NOT PROMPTROLLBACKCOST)"
+ />
+ <Publish
+ Event="EndDialog"
+ Value="Return"
+ Condition="OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST=&quot;D&quot;"
+ />
+ <Publish
+ Event="EnableRollback"
+ Value="False"
+ Condition="OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 0 AND PROMPTROLLBACKCOST=&quot;D&quot;"
+ />
+ <Publish
+ Event="SpawnDialog"
+ Value="OutOfDiskDlg"
+ Condition="(OutOfDiskSpace = 1 AND OutOfNoRbDiskSpace = 1) OR (OutOfDiskSpace = 1 AND PROMPTROLLBACKCOST=&quot;F&quot;)"
+ />
+ </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>
+ </UI>
+
+ <UI Id="GlazeWMUI">
+ <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" />
+ <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
+ <Property Id="WixUI_Mode" Value="Minimal" />
+ <DialogRef Id="ErrorDlg" />
+ <DialogRef Id="FatalError" />
+ <DialogRef Id="FilesInUse" />
+ <DialogRef Id="MsiRMFilesInUse" />
+ <DialogRef Id="PrepareDlg" />
+ <DialogRef Id="ProgressDlg" />
+ <DialogRef Id="ResumeDlg" />
+ <DialogRef Id="UserExit" />
+ <DialogRef Id="WelcomeInstallDlg" />
+ <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999" />
+ <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" />
+ <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" />
+ <Publish
+ Dialog="VerifyReadyDlg"
+ Control="Back"
+ Event="NewDialog"
+ Value="WelcomeInstallDlg"
+ Order="2"
+ Condition="Installed AND PATCH"
+ />
+
+ <InstallUISequence>
+ <Show Dialog="WelcomeInstallDlg" Before="ProgressDlg"
+ Condition="(NOT Installed) AND NOT AFTERREBOOT" />
+ </InstallUISequence>
+
+ <Property Id="ARPNOMODIFY" Value="1" />
+ </UI>
+
+ <UIRef Id="WixUI_Common" />
<Feature Id="ProductFeature" Title="ConsoleApp" Level="1">
+ <ComponentRef Id="INSTALLDIR_Component" />
<ComponentRef Id="GlazeWMExe" />
- <ComponentRef Id="GlazeWMShortcut" />
+ <!-- <ComponentRef Id="GlazeWMShortcut" /> -->
<ComponentRef Id="ModifyPathEnv" />
</Feature>
- <!-- Application binaries -->
- <DirectoryRef Id="GlazeWMProgramFiles">
- <Component Id="GlazeWMExe">
- <File
- Id="GlazeWMExeFile"
- Source=".\target\release\wm.exe"
- Name="GlazeWM.exe"
- KeyPath="yes"
- />
- </Component>
- </DirectoryRef>
+ <StandardDirectory Id="ProgramFiles6432Folder">
+ <Directory Id="GlzrProgramFiles" Name="glzr.io">
+ <Directory Id="INSTALLDIR" Name="GlazeWM">
+ <Component Id="INSTALLDIR_Component" Guid="14B310C4-9B5D-4DA5-ADF9-B9D008E4CD82"
+ Bitness="always64">
+ <CreateFolder />
+ <RegistryKey Root="HKLM" Key="SOFTWARE\glzr.io\GlazeWM">
+ <RegistryValue Name="InstallDir" Value="[INSTALLDIR]" Type="string" />
+ </RegistryKey>
+ </Component>
- <DirectoryRef Id="GlazeWMProgramMenu">
- <!-- Application shortcut -->
- <Component
- Id="GlazeWMShortcut"
- Guid="66ab31a5-7e45-4306-9f17-fe8ad579b43f"
- >
- <Shortcut
- Id="GlazeWMShortcutFile"
- Name="GlazeWM"
- Description="A tiling window manager for Windows inspired by i3 and Polybar."
- Target="[GlazeWMProgramFiles]glazewm.exe"
- />
- <RemoveFolder Id="GlazeWMProgramMenu" On="uninstall" />
- <RegistryValue
- Root="HKCU"
- Key="Software\Microsoft\GlazeWM"
- Name="installed"
- Type="integer"
- Value="1"
- KeyPath="yes"
- />
- </Component>
- </DirectoryRef>
-
- <DirectoryRef Id="GlazeWMProgramFiles">
- <!-- Add to PATH. -->
- <Component
- Id="ModifyPathEnv"
- Guid="66a4be46-19ae-4ed4-944f-b01673887f64"
- KeyPath="yes"
- >
- <Environment
- Id="PathEnv"
- Value="[GlazeWMProgramFiles]"
- Name="PATH"
- Permanent="no"
- Part="first"
- Action="set"
- System="yes"
- />
- </Component>
- </DirectoryRef>
-
- <StandardDirectory Id="ProgramFiles64Folder">
- <Directory Id="GlazeWMProgramFiles" Name="GlazeWM" />
- </StandardDirectory>
+ <Component Id="GlazeWMExe" Guid="73752F94-6589-4C7B-ABED-39D655A19714" Bitness="always64">
+ <File Id="GlazeWMExeFile" Name="GlazeWM.exe" Source="target\release\wm.exe"
+ KeyPath="yes" />
+ </Component>
+ </Directory>
- <StandardDirectory Id="ProgramMenuFolder">
- <Directory Id="GlazeWMProgramMenu" Name="GlazeWM" />
+ <!-- Add to PATH. -->
+ <Component Id="ModifyPathEnv" Guid="66a4be46-19ae-4ed4-944f-b01673887f64" KeyPath="yes">
+ <Environment
+ Id="PathEnv"
+ Value="[INSTALLDIR]"
+ Name="PATH"
+ Permanent="no"
+ Part="first"
+ Action="set"
+ System="yes"
+ />
+ </Component>
+ </Directory>
</StandardDirectory>
</Package>
</Wix>