Skip to content

Commit

Permalink
feat: add nsis option removeDefaultUninstallWelcomePage to remove t…
Browse files Browse the repository at this point in the history
…he default uninstall welcome page (#7141)
  • Loading branch information
moulinierf committed Sep 19, 2022
1 parent 1b24dbb commit d71a579
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/tasty-pianos-jump.md
@@ -0,0 +1,5 @@
---
"app-builder-lib": minor
---

feat: add nsis option to remove the default uninstall welcome page
1 change: 1 addition & 0 deletions docs/generated/NsisOptions.md
Expand Up @@ -27,6 +27,7 @@
<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>
<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>
<li><code id="NsisOptions-uninstallDisplayName">uninstallDisplayName</code> = <code>${productName} ${version}</code> String - The uninstaller display name in the control panel.</li>
<li><code id="NsisOptions-removeDefaultUninstallWelcomePage">removeDefaultUninstallWelcomePage</code> = <code>false</code> Boolean - <em>assisted installer only.</em> remove the default uninstall welcome page</li>
</ul>
<hr>
<ul>
Expand Down
10 changes: 10 additions & 0 deletions packages/app-builder-lib/scheme.json
Expand Up @@ -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.",
Expand Down Expand Up @@ -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.",
Expand Down
2 changes: 2 additions & 0 deletions packages/app-builder-lib/src/targets/nsis/Defines.ts
Expand Up @@ -76,6 +76,8 @@ export type Defines = {

allowToChangeInstallationDirectory?: null

removeDefaultUninstallWelcomePage?: null

MENU_FILENAME?: string

SHORTCUT_NAME?: string
Expand Down
4 changes: 4 additions & 0 deletions packages/app-builder-lib/src/targets/nsis/NsisTarget.ts
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions packages/app-builder-lib/src/targets/nsis/nsisOptions.ts
Expand Up @@ -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.
Expand Down
8 changes: 5 additions & 3 deletions packages/app-builder-lib/templates/nsis/assistedInstaller.nsh
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d71a579

Please sign in to comment.