From d0d974fa5ef250b2a9219e4c6a2ca175f495e88f Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Tue, 21 May 2024 12:01:37 +0300 Subject: [PATCH] fix(bundler/nsis): fix registering deep-link protocols (#9833) * fix(bundler/nsis): fix registering deep-link protocols * Update bundler-nsis-deep-links.md --------- Co-authored-by: Fabian-Lars --- .changes/bundler-nsis-deep-links.md | 5 +++++ .../src/bundle/windows/templates/installer.nsi | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changes/bundler-nsis-deep-links.md 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}}