diff --git a/.changes/bundler-nsis-deep-links.md b/.changes/bundler-nsis-deep-links.md new file mode 100644 index 000000000..762a7fd64 --- /dev/null +++ b/.changes/bundler-nsis-deep-links.md @@ -0,0 +1,5 @@ +--- +"tauri-bundler": "patch:bug" +--- + +Fix NSIS installer deep links registration. diff --git a/tooling/bundler/src/bundle/windows/templates/installer.nsi b/tooling/bundler/src/bundle/windows/templates/installer.nsi index 69a46451c..cf804f764 100644 --- a/tooling/bundler/src/bundle/windows/templates/installer.nsi +++ b/tooling/bundler/src/bundle/windows/templates/installer.nsi @@ -570,11 +570,11 @@ Section Install {{/each}} ; Register deep links - {{#each deep_link_protocol as |protocol| ~}} - WriteRegStr SHCTX "Software\Classes\{{protocol}}" "URL Protocol" "" - WriteRegStr SHCTX "Software\Classes\{{protocol}}" "" "URL:${BUNDLEID} protocol" - WriteRegStr SHCTX "Software\Classes\{{protocol}}\DefaultIcon" "" "$\"$INSTDIR\${MAINBINARYNAME}.exe$\",0" - WriteRegStr SHCTX "Software\Classes\{{protocol}}\shell\open\command" "" "$\"$INSTDIR\${MAINBINARYNAME}.exe$\" $\"%1$\"" + {{#each deep_link_protocols as |protocol| ~}} + WriteRegStr SHCTX "Software\Classes\\{{protocol}}" "URL Protocol" "" + WriteRegStr SHCTX "Software\Classes\\{{protocol}}" "" "URL:${BUNDLEID} protocol" + WriteRegStr SHCTX "Software\Classes\\{{protocol}}\DefaultIcon" "" "$\"$INSTDIR\${MAINBINARYNAME}.exe$\",0" + WriteRegStr SHCTX "Software\Classes\\{{protocol}}\shell\open\command" "" "$\"$INSTDIR\${MAINBINARYNAME}.exe$\" $\"%1$\"" {{/each}} ; Create uninstaller @@ -700,10 +700,10 @@ Section Uninstall {{/each}} ; Delete deep links - {{#each deep_link_protocol as |protocol| ~}} - ReadRegStr $R7 SHCTX "Software\Classes\{{protocol}}\shell\open\command" "" + {{#each deep_link_protocols as |protocol| ~}} + ReadRegStr $R7 SHCTX "Software\Classes\\{{protocol}}\shell\open\command" "" !if $R7 == "$\"$INSTDIR\${MAINBINARYNAME}.exe$\" $\"%1$\"" - DeleteRegKey SHCTX "Software\Classes\{{protocol}}" + DeleteRegKey SHCTX "Software\Classes\\{{protocol}}" !endif {{/each}}