diff --git a/.changeset/tasty-pianos-jump.md b/.changeset/tasty-pianos-jump.md
new file mode 100644
index 00000000000..5edc2879869
--- /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
diff --git a/docs/generated/NsisOptions.md b/docs/generated/NsisOptions.md
index 0d6b3555813..4583dffc737 100644
--- a/docs/generated/NsisOptions.md
+++ b/docs/generated/NsisOptions.md
@@ -27,6 +27,7 @@
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.
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 27869369333..d9c60fcb496 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 af50ba471d5..07f78c3b7c0 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 5e6fcbfa5df..6a9ecab56c1 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 a322de342da..e8e22ec0419 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 e43d9a76eec..03f4decbbf2 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