Skip to content

Commit d71a579

Browse files
authored
feat: add nsis option removeDefaultUninstallWelcomePage to remove the default uninstall welcome page (#7141)
1 parent 1b24dbb commit d71a579

File tree

7 files changed

+33
-3
lines changed

7 files changed

+33
-3
lines changed

.changeset/tasty-pianos-jump.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": minor
3+
---
4+
5+
feat: add nsis option to remove the default uninstall welcome page

docs/generated/NsisOptions.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<li><code id="NsisOptions-installerSidebar">installerSidebar</code> String | “undefined” - <em>assisted installer only.</em> <code>MUI_WELCOMEFINISHPAGE_BITMAP</code>, relative to the <a href="/configuration/configuration#MetadataDirectories-buildResources">build resources</a> or to the project directory. Defaults to <code>build/installerSidebar.bmp</code> or <code>${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp</code>. Image size 164 × 314 pixels.</li>
2828
<li><code id="NsisOptions-uninstallerSidebar">uninstallerSidebar</code> String | “undefined” - <em>assisted installer only.</em> <code>MUI_UNWELCOMEFINISHPAGE_BITMAP</code>, relative to the <a href="/configuration/configuration#MetadataDirectories-buildResources">build resources</a> or to the project directory. Defaults to <code>installerSidebar</code> option or <code>build/uninstallerSidebar.bmp</code> or <code>build/installerSidebar.bmp</code> or <code>${NSISDIR}\\Contrib\\Graphics\\Wizard\\nsis3-metro.bmp</code></li>
2929
<li><code id="NsisOptions-uninstallDisplayName">uninstallDisplayName</code> = <code>${productName} ${version}</code> String - The uninstaller display name in the control panel.</li>
30+
<li><code id="NsisOptions-removeDefaultUninstallWelcomePage">removeDefaultUninstallWelcomePage</code> = <code>false</code> Boolean - <em>assisted installer only.</em> remove the default uninstall welcome page</li>
3031
</ul>
3132
<hr>
3233
<ul>

packages/app-builder-lib/scheme.json

+10
Original file line numberDiff line numberDiff line change
@@ -3914,6 +3914,11 @@
39143914
}
39153915
]
39163916
},
3917+
"removeDefaultUninstallWelcomePage": {
3918+
"default": false,
3919+
"description": "*assisted installer only.* remove the default uninstall welcome page.",
3920+
"type": "boolean"
3921+
},
39173922
"runAfterFinish": {
39183923
"default": true,
39193924
"description": "Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.",
@@ -4232,6 +4237,11 @@
42324237
}
42334238
]
42344239
},
4240+
"removeDefaultUninstallWelcomePage": {
4241+
"default": false,
4242+
"description": "*assisted installer only.* remove the default uninstall welcome page.",
4243+
"type": "boolean"
4244+
},
42354245
"runAfterFinish": {
42364246
"default": true,
42374247
"description": "Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.",

packages/app-builder-lib/src/targets/nsis/Defines.ts

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ export type Defines = {
7676

7777
allowToChangeInstallationDirectory?: null
7878

79+
removeDefaultUninstallWelcomePage?: null
80+
7981
MENU_FILENAME?: string
8082

8183
SHORTCUT_NAME?: string

packages/app-builder-lib/src/targets/nsis/NsisTarget.ts

+4
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,10 @@ export class NsisTarget extends Target {
481481
defines.allowToChangeInstallationDirectory = null
482482
}
483483

484+
if (options.removeDefaultUninstallWelcomePage) {
485+
defines.removeDefaultUninstallWelcomePage = null
486+
}
487+
484488
const commonOptions = getEffectiveOptions(options, packager)
485489

486490
if (commonOptions.menuCategory != null) {

packages/app-builder-lib/src/targets/nsis/nsisOptions.ts

+6
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerCo
8686
*/
8787
readonly allowToChangeInstallationDirectory?: boolean
8888

89+
/**
90+
* *assisted installer only.* remove the default uninstall welcome page.
91+
* @default false
92+
*/
93+
readonly removeDefaultUninstallWelcomePage?: boolean
94+
8995
/**
9096
* The path to installer icon, relative to the [build resources](/configuration/configuration#MetadataDirectories-buildResources) or to the project directory.
9197
* Defaults to `build/installerIcon.ico` or application icon.

packages/app-builder-lib/templates/nsis/assistedInstaller.nsh

+5-3
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
${endIf}
4040
FunctionEnd
4141
!endif
42-
42+
4343
# after change installation directory and before install start, you can show custom page here.
4444
!ifmacrodef customPageAfterChangeDir
4545
!insertmacro customPageAfterChangeDir
4646
!endif
47-
47+
4848
!insertmacro MUI_PAGE_INSTFILES
4949
!ifmacrodef customFinishPage
5050
!insertmacro customFinishPage
@@ -65,7 +65,9 @@
6565
!insertmacro MUI_PAGE_FINISH
6666
!endif
6767
!else
68-
!insertmacro MUI_UNPAGE_WELCOME
68+
!ifndef removeDefaultUninstallWelcomePage
69+
!insertmacro MUI_UNPAGE_WELCOME
70+
!endif
6971
!ifndef INSTALL_MODE_PER_ALL_USERS
7072
!insertmacro PAGE_INSTALL_MODE
7173
!endif

0 commit comments

Comments
 (0)