From 260fd061f6c610be8372fe10c91a5d567ff8828b Mon Sep 17 00:00:00 2001 From: stffabi Date: Mon, 13 Feb 2023 08:40:42 +0100 Subject: [PATCH] [nsis] Adjust template to install shortcuts for all users (#2373) --- v2/pkg/buildassets/build/windows/installer/project.nsi | 4 ++++ .../buildassets/build/windows/installer/wails_tools.nsh | 8 ++++++++ website/src/pages/changelog.mdx | 1 + 3 files changed, 13 insertions(+) diff --git a/v2/pkg/buildassets/build/windows/installer/project.nsi b/v2/pkg/buildassets/build/windows/installer/project.nsi index 3b1588e0c..7b2148bc8 100644 --- a/v2/pkg/buildassets/build/windows/installer/project.nsi +++ b/v2/pkg/buildassets/build/windows/installer/project.nsi @@ -77,6 +77,8 @@ Function .onInit FunctionEnd Section + !insertmacro wails.setShellContext + !insertmacro wails.webview2runtime SetOutPath $INSTDIR @@ -90,6 +92,8 @@ Section SectionEnd Section "uninstall" + !insertmacro wails.setShellContext + RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath RMDir /r $INSTDIR diff --git a/v2/pkg/buildassets/build/windows/installer/wails_tools.nsh b/v2/pkg/buildassets/build/windows/installer/wails_tools.nsh index 66dc209a3..467c349ac 100644 --- a/v2/pkg/buildassets/build/windows/installer/wails_tools.nsh +++ b/v2/pkg/buildassets/build/windows/installer/wails_tools.nsh @@ -134,6 +134,14 @@ RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}" DeleteRegKey HKLM "${UNINST_KEY}" !macroend +!macro wails.setShellContext + ${If} ${REQUEST_EXECUTION_LEVEL} == "admin" + SetShellVarContext all + ${else} + SetShellVarContext current + ${EndIf} +!macroend + # Install webview2 by launching the bootstrapper # See https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#online-only-deployment !macro wails.webview2runtime diff --git a/website/src/pages/changelog.mdx b/website/src/pages/changelog.mdx index ada7df8d9..fdb64b48b 100644 --- a/website/src/pages/changelog.mdx +++ b/website/src/pages/changelog.mdx @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - On Windows unmaximising a window has no effect anymore when the window is in fullscreen mode, this makes it consistent with e.g. macOS. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2279) - Frameless resize now sets the cursor on documentElement, otherwise resizing cursor won't be shown outside of the body rectangle. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2289) - Improved the `--wails-draggable` experience to be more reactive. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2302) +- NSIS template now installs the shortcuts for all users and not only for the current user. Changed by @stffabi in [PR](https://github.com/wailsapp/wails/pull/2373) ### Fixed - Fixed failing build hooks when `build/bin` was missing. Fixed by @Lyimmi in [PR](https://github.com/wailsapp/wails/pull/2273)