Skip to content

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

feat: add conditional desktop and start menu shortcuts

Lars Berger6f9965bd6375
diff --git a/resources/scripts/package.ps1 b/resources/scripts/package.ps1
index 76574675..2139b2fc 100644
--- a/resources/scripts/package.ps1
+++ b/resources/scripts/package.ps1
@@ -29,11 +29,11 @@ foreach ($target in $rustTargets) {
Write-Output "Building for $target (windows subsystem)"
cargo build --locked --release --target $target --features no_console,ui_access
- Move-Item -Path "$sourceDir/glazewm.exe", "$sourceDir/glazewm-watcher.exe" -Destination "$outDir/noconsole"
+ Move-Item -Path -Force "$sourceDir/glazewm.exe", "$sourceDir/glazewm-watcher.exe" -Destination "$outDir/noconsole"
Write-Output "Building for $target (console subsystem)"
cargo build --locked --release --target $target --features ui_access
- Move-Item -Path "$sourceDir/glazewm.exe", "$sourceDir/glazewm-watcher.exe" -Destination "$outDir/console"
+ Move-Item -Path -Force "$sourceDir/glazewm.exe", "$sourceDir/glazewm-watcher.exe" -Destination "$outDir/console"
}
# WiX architectures to create installers for (x64 and arm64).
diff --git a/resources/wix/standalone-ui.wxs b/resources/wix/standalone-ui.wxs
index 8a73c1e3..68b80393 100644
--- a/resources/wix/standalone-ui.wxs
+++ b/resources/wix/standalone-ui.wxs
@@ -35,6 +35,17 @@
NoPrefix="yes"
Text="!(loc.WelcomeDlgDescription)"
/>
+ <Control
+ Id="Custom_DesktopCheckbox"
+ Type="CheckBox"
+ X="135"
+ Y="160"
+ Width="226"
+ Height="18"
+ CheckBoxValue="1"
+ Property="ENABLE_DESKTOP_SHORTCUT"
+ Text="Add shortcut to desktop"
+ />
<Control
Id="Custom_StartMenuCheckbox"
Type="CheckBox"
@@ -43,8 +54,8 @@
Width="226"
Height="18"
CheckBoxValue="1"
- Property="Custom_AddStartMenuShortcut"
- Default="no"
+ Property="ENABLE_START_MENU_SHORTCUT"
+ Default="yes"
Text="Add shortcut to Start Menu"
/>
<Control
diff --git a/resources/wix/standalone.wxs b/resources/wix/standalone.wxs
index 3905020e..f87927d6 100644
--- a/resources/wix/standalone.wxs
+++ b/resources/wix/standalone.wxs
@@ -25,35 +25,43 @@
<UIRef Id="Custom_UI" />
- <!-- User input variable for whether to install Start Menu shortcut. -->
- <Property Id="Custom_AddStartMenuShortcut" Value="1" />
+ <!-- User input variables for whether to install shortcuts. -->
+ <Property Id="ENABLE_DESKTOP_SHORTCUT" Secure="yes" />
+ <Property Id="ENABLE_START_MENU_SHORTCUT" Value="1" Secure="yes" />
<Feature Id="Custom_ProductFeature">
<ComponentRef Id="Custom_CreateInstallDir" />
<ComponentRef Id="Custom_InstallRootFiles" />
<ComponentRef Id="Custom_InstallCliFiles" />
- <!-- <ComponentRef Id="GlazeWMShortcut" /> -->
+ <ComponentRef Id="Custom_AddDesktopShortcut" />
+ <ComponentRef Id="Custom_AddStartMenuShortcut" />
<ComponentRef Id="Custom_AddPathEnv" />
</Feature>
<StandardDirectory Id="ProgramFiles6432Folder">
- <Directory Id="Custom_OrgProgramFiles" Name="glzr.io">
+ <Directory Id="Custom_OrgDir" Name="glzr.io">
<Directory Id="INSTALLFOLDER" Name="GlazeWM">
- <Component Id="Custom_CreateInstallDir" Guid="14B310C4-9B5D-4DA5-ADF9-B9D008E4CD82" >
- <CreateFolder />
- <RegistryKey Root="HKLM" Key="SOFTWARE\glzr.io\GlazeWM">
- <RegistryValue Name="InstallDir" Value="[INSTALLFOLDER]" Type="string" />
- </RegistryKey>
+ <Component Id="Custom_CreateInstallDir">
+ <RegistryValue
+ Root="HKLM"
+ Key="SOFTWARE\glzr.io\GlazeWM"
+ Name="InstallDir"
+ Value="[INSTALLFOLDER]"
+ Type="string"
+ KeyPath="yes"
+ />
</Component>
- <Component Id="Custom_InstallRootFiles" Guid="73752F94-6589-4C7B-ABED-39D655A19714" >
+ <!-- Add main executable + watcher (windows subsystem). -->
+ <Component Id="Custom_InstallRootFiles" Guid="73752F94-6589-4C7B-ABED-39D655A19714">
<File Id="Custom_RootExe" Source="$(var.EXE_DIR)/noconsole/glazewm.exe" KeyPath="yes" />
<File Id="Custom_RootWatcherExe" Source="$(var.EXE_DIR)/noconsole/glazewm-watcher.exe" />
</Component>
+ <!-- Add main executable + watcher (console subsystem). -->
<Directory Id="Custom_CliDir" Name="cli">
- <Component Id="Custom_InstallCliFiles" Guid="916284d8-100c-4f37-8d8c-2722b01cb3dd" >
- <File Id="Custom_CliExe" Source="$(var.EXE_DIR)/console/glazewm.exe" />
+ <Component Id="Custom_InstallCliFiles" Guid="916284d8-100c-4f37-8d8c-2722b01cb3dd">
+ <File Id="Custom_CliExe" Source="$(var.EXE_DIR)/console/glazewm.exe" KeyPath="yes" />
<File Id="Custom_CliWatcherExe" Source="$(var.EXE_DIR)/console/glazewm-watcher.exe" />
</Component>
</Directory>
@@ -61,6 +69,48 @@
</Directory>
</StandardDirectory>
+ <!-- Add shortcut to desktop. -->
+ <StandardDirectory Id="DesktopFolder">
+ <Component Id="Custom_AddDesktopShortcut" Condition="ENABLE_DESKTOP_SHORTCUT = 1">
+ <Shortcut
+ Id="Custom_DesktopShortcut"
+ Name="GlazeWM"
+ Description="Launch GlazeWM"
+ Target="[INSTALLFOLDER]glazewm.exe"
+ />
+
+ <RegistryValue
+ Root="HKLM"
+ Key="SOFTWARE\glzr.io\GlazeWM"
+ Name="DesktopShortcutInstalled"
+ Type="integer"
+ Value="1"
+ KeyPath="yes"
+ />
+ </Component>
+ </StandardDirectory>
+
+ <!-- Add shortcut to Start Menu. -->
+ <StandardDirectory Id="ProgramMenuFolder">
+ <Component Id="Custom_AddStartMenuShortcut" Condition="ENABLE_START_MENU_SHORTCUT = 1">
+ <Shortcut
+ Id="Custom_StartMenuShortcut"
+ Name="GlazeWM"
+ Description="Launch GlazeWM"
+ Target="[INSTALLFOLDER]glazewm.exe"
+ />
+
+ <RegistryValue
+ Root="HKLM"
+ Key="SOFTWARE\glzr.io\GlazeWM"
+ Name="StartMenuShortcutInstalled"
+ Type="integer"
+ Value="1"
+ KeyPath="yes"
+ />
+ </Component>
+ </StandardDirectory>
+
<!-- Add CLI directory to PATH. -->
<Component Id="Custom_AddPathEnv" Guid="66a4be46-19ae-4ed4-944f-b01673887f64" KeyPath="yes">
<Environment