From 5df5ac6d1fad077a40e03d5efd2d8a1851dcece0 Mon Sep 17 00:00:00 2001 From: florent Moulinier Date: Thu, 15 Sep 2022 22:06:56 +0200 Subject: [PATCH 1/2] feat add nsis option to remove the default uninstall welcome page nsis until now we can't modify the default unwelcome page, this feature adds the option removeDefaultUninstallWelcomePage to give the possibility to remove from the nsis option this default page in order to custom it in the installer.nsh
BREAKING CHANGE: the nsis option removeDefaultUninstallWelcomePage is used in the assistedInstaller.nsh to decide if we must add the MUI_UNPAGE_WELCOME or not. based on the issue based on this issue https://github.com/electron-userland/electron-builder/issues/6987
--- docs/generated/NsisOptions.md | 1 + packages/app-builder-lib/scheme.json | 10 ++++++++++ packages/app-builder-lib/src/targets/nsis/Defines.ts | 2 ++ .../app-builder-lib/src/targets/nsis/NsisTarget.ts | 4 ++++ .../app-builder-lib/src/targets/nsis/nsisOptions.ts | 6 ++++++ .../templates/nsis/assistedInstaller.nsh | 8 +++++--- 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/docs/generated/NsisOptions.md b/docs/generated/NsisOptions.md index 0d6b355581..4583dffc73 100644 --- a/docs/generated/NsisOptions.md +++ b/docs/generated/NsisOptions.md @@ -27,6 +27,7 @@
  • installerSidebar String | “undefined” - assisted installer only. MUI_WELCOMEFINISHPAGE_BITMAP, relative to the build resources or to the project directory. Defaults to build/installerSidebar.bmp or ${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp. Image size 164 × 314 pixels.
  • uninstallerSidebar String | “undefined” - assisted installer only. MUI_UNWELCOMEFINISHPAGE_BITMAP, relative to the build resources or to the project directory. Defaults to installerSidebar option or build/uninstallerSidebar.bmp or build/installerSidebar.bmp or ${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp
  • uninstallDisplayName = ${productName} ${version} String - The uninstaller display name in the control panel.
  • +
  • removeDefaultUninstallWelcomePage = false Boolean - assisted installer only. remove the default uninstall welcome page

    • diff --git a/packages/app-builder-lib/scheme.json b/packages/app-builder-lib/scheme.json index 2786936933..d9c60fcb49 100644 --- a/packages/app-builder-lib/scheme.json +++ b/packages/app-builder-lib/scheme.json @@ -3914,6 +3914,11 @@ } ] }, + "removeDefaultUninstallWelcomePage": { + "default": false, + "description": "*assisted installer only.* remove the default uninstall welcome page.", + "type": "boolean" + }, "runAfterFinish": { "default": true, "description": "Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.", @@ -4232,6 +4237,11 @@ } ] }, + "removeDefaultUninstallWelcomePage": { + "default": false, + "description": "*assisted installer only.* remove the default uninstall welcome page.", + "type": "boolean" + }, "runAfterFinish": { "default": true, "description": "Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.", diff --git a/packages/app-builder-lib/src/targets/nsis/Defines.ts b/packages/app-builder-lib/src/targets/nsis/Defines.ts index af50ba471d..07f78c3b7c 100644 --- a/packages/app-builder-lib/src/targets/nsis/Defines.ts +++ b/packages/app-builder-lib/src/targets/nsis/Defines.ts @@ -76,6 +76,8 @@ export type Defines = { allowToChangeInstallationDirectory?: null + removeDefaultUninstallWelcomePage?: null + MENU_FILENAME?: string SHORTCUT_NAME?: string diff --git a/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts b/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts index 5e6fcbfa5d..6a9ecab56c 100644 --- a/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts +++ b/packages/app-builder-lib/src/targets/nsis/NsisTarget.ts @@ -481,6 +481,10 @@ export class NsisTarget extends Target { defines.allowToChangeInstallationDirectory = null } + if (options.removeDefaultUninstallWelcomePage) { + defines.removeDefaultUninstallWelcomePage = null + } + const commonOptions = getEffectiveOptions(options, packager) if (commonOptions.menuCategory != null) { diff --git a/packages/app-builder-lib/src/targets/nsis/nsisOptions.ts b/packages/app-builder-lib/src/targets/nsis/nsisOptions.ts index a322de342d..e8e22ec041 100644 --- a/packages/app-builder-lib/src/targets/nsis/nsisOptions.ts +++ b/packages/app-builder-lib/src/targets/nsis/nsisOptions.ts @@ -86,6 +86,12 @@ export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerCo */ readonly allowToChangeInstallationDirectory?: boolean + /** + * *assisted installer only.* remove the default uninstall welcome page. + * @default false + */ + readonly removeDefaultUninstallWelcomePage?: boolean + /** * The path to installer icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory. * Defaults to `build/installerIcon.ico` or application icon. diff --git a/packages/app-builder-lib/templates/nsis/assistedInstaller.nsh b/packages/app-builder-lib/templates/nsis/assistedInstaller.nsh index e43d9a76ee..03f4decbbf 100644 --- a/packages/app-builder-lib/templates/nsis/assistedInstaller.nsh +++ b/packages/app-builder-lib/templates/nsis/assistedInstaller.nsh @@ -39,12 +39,12 @@ ${endIf} FunctionEnd !endif - + # after change installation directory and before install start, you can show custom page here. !ifmacrodef customPageAfterChangeDir !insertmacro customPageAfterChangeDir !endif - + !insertmacro MUI_PAGE_INSTFILES !ifmacrodef customFinishPage !insertmacro customFinishPage @@ -65,7 +65,9 @@ !insertmacro MUI_PAGE_FINISH !endif !else - !insertmacro MUI_UNPAGE_WELCOME + !ifndef removeDefaultUninstallWelcomePage + !insertmacro MUI_UNPAGE_WELCOME + !endif !ifndef INSTALL_MODE_PER_ALL_USERS !insertmacro PAGE_INSTALL_MODE !endif From 70bd60d20ac58d469c2d202a3d2eb97abdd6f400 Mon Sep 17 00:00:00 2001 From: Mike Maietta Date: Fri, 16 Sep 2022 08:52:44 -0700 Subject: [PATCH 2/2] Create tasty-pianos-jump.md --- .changeset/tasty-pianos-jump.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tasty-pianos-jump.md diff --git a/.changeset/tasty-pianos-jump.md b/.changeset/tasty-pianos-jump.md new file mode 100644 index 0000000000..5edc287986 --- /dev/null +++ b/.changeset/tasty-pianos-jump.md @@ -0,0 +1,5 @@ +--- +"app-builder-lib": minor +--- + +feat: add nsis option to remove the default uninstall welcome page