Browse Source

feat(bundler): desktop shortcut on Windows (#2052)

Lucas Fernandes Nogueira 4 years ago
parent
commit
f0603fccb3

+ 5 - 0
.changes/windows-shortcut.md

@@ -0,0 +1,5 @@
+---
+"tauri-bundler": patch
+---
+
+Configure app shortcut on the Windows Installer.

+ 8 - 0
tooling/bundler/src/bundle/windows/templates/main.wxs

@@ -63,6 +63,13 @@
         <UIRef Id="WixUI_InstallDir" />
 
         <Directory Id="TARGETDIR" Name="SourceDir">
+            <Directory Id="DesktopFolder" Name="Desktop">
+                <Component Id="ApplicationShortcutDesktop" Guid="*">
+                    <Shortcut Id="ApplicationDesktopShortcut" Name="{{{product_name}}}" Description="Runs {{{product_name}}}" Target="[!Path]" WorkingDirectory="INSTALLDIR" />
+                    <RemoveFolder Id="DesktopFolder" On="uninstall" />
+                    <RegistryValue Root="HKCU" Key="Software\{{{product_name}}}" Name="installed" Type="integer" Value="1" KeyPath="yes" />
+                </Component>
+            </Directory>
             <Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
                 <Directory Id="INSTALLDIR" Name="{{{product_name}}}"/>
             </Directory>
@@ -147,6 +154,7 @@
                 <ComponentRef Id="Path"/>
                 <ComponentRef Id="CMP_ReadFileShortcut" />
                 <ComponentRef Id="ApplicationShortcut" />
+                <ComponentRef Id="ApplicationShortcutDesktop" />
             </Feature>
 
             <Feature