Browse Source

fix(bundler) wix template escape character (#2608)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Robert Buchanan 3 years ago
parent
commit
2be1abd112

+ 5 - 0
.changes/wix-registry-keys.md

@@ -0,0 +1,5 @@
+---
+"tauri-bundler": patch
+---
+
+Fix registry keys on the WiX template.

+ 1 - 7
tooling/bundler/src/bundle/path_utils.rs

@@ -8,7 +8,7 @@ use std::{
 };
 
 /// Directory options.
-#[derive(Clone)]
+#[derive(Default, Clone)]
 pub struct DirOpts {
   pub depth: u64,
 }
@@ -51,12 +51,6 @@ impl Default for Options {
   }
 }
 
-impl Default for DirOpts {
-  fn default() -> DirOpts {
-    DirOpts { depth: 0 }
-  }
-}
-
 impl Default for FileOpts {
   fn default() -> FileOpts {
     FileOpts {

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

@@ -71,7 +71,7 @@
                 <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" />
+                    <RegistryValue Root="HKCU" Key="Software\\{{{product_name}}}" Name="installed" Type="integer" Value="1" KeyPath="yes" />
                 </Component>
             </Directory>
             <Directory Id="$(var.PlatformProgramFilesFolder)" Name="PFiles">
@@ -115,7 +115,7 @@
 							  On="uninstall" />
 
 				<RegistryValue Root="HKCR"
-							   Key="Software\{{{manufacturer}}}\{{{product_name}}}"
+							   Key="Software\\{{{manufacturer}}}\\{{{product_name}}}"
 							   Name="installed"
 							   Type="integer"
 							   Value="1"
@@ -134,7 +134,7 @@
                     <ShortcutProperty Key="System.AppUserModel.ID" Value="{{{manufacturer}}}"/>
                 </Shortcut>
                 <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
-                <RegistryValue Root="HKCU" Key="Software\{{{manufacturer}}}\{{{product_name}}}" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
+                <RegistryValue Root="HKCU" Key="Software\\{{{manufacturer}}}\\{{{product_name}}}" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
            </Component>
         </DirectoryRef>