Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nsis): add NsisOption to specify selectPerMachineByDefault #7967

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dull-brooms-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": minor
---

feat(nsis): add NsisOption to specify selectPerMachineByDefault
3 changes: 3 additions & 0 deletions docs/generated/NsisOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<p>If <code>oneClick</code> is <code>false</code> and <code>perMachine</code> is <code>false</code> (default): install mode installer page.</p>
</li>
<li>
<p><code id="NsisOptions-selectPerMachineByDefault">selectPerMachineByDefault</code> = <code>false</code> Boolean - Whether to set per-machine or per-user installation as default selection on the install mode installer page.</p>
</li>
<li>
<p><code id="NsisOptions-allowElevation">allowElevation</code> = <code>true</code> Boolean - <em>assisted installer only.</em> Allow requesting for elevation. If false, user will have to restart installer with elevated permissions.</p>
</li>
<li>
Expand Down
10 changes: 10 additions & 0 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -4183,6 +4183,11 @@
"string"
]
},
"selectPerMachineByDefault": {
"default": false,
"description": "Whether to set per-machine or per-user installation as default selection on the install mode installer page.",
"type": "boolean"
},
"shortcutName": {
"description": "The name that will be used for all shortcuts. Defaults to the application name.",
"type": [
Expand Down Expand Up @@ -4506,6 +4511,11 @@
"string"
]
},
"selectPerMachineByDefault": {
"default": false,
"description": "Whether to set per-machine or per-user installation as default selection on the install mode installer page.",
"type": "boolean"
},
"shortcutName": {
"description": "The name that will be used for all shortcuts. Defaults to the application name.",
"type": [
Expand Down
1 change: 1 addition & 0 deletions packages/app-builder-lib/src/targets/nsis/Defines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export type Defines = {
MULTIUSER_INSTALLMODE_ALLOW_ELEVATION?: null

INSTALL_MODE_PER_ALL_USERS?: null
INSTALL_MODE_PER_ALL_USERS_DEFAULT?: null
INSTALL_MODE_PER_ALL_USERS_REQUIRED?: null

allowToChangeInstallationDirectory?: null
Expand Down
4 changes: 4 additions & 0 deletions packages/app-builder-lib/src/targets/nsis/NsisTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ export class NsisTarget extends Target {
defines.INSTALL_MODE_PER_ALL_USERS = null
}

if (options.selectPerMachineByDefault === true) {
defines.INSTALL_MODE_PER_ALL_USERS_DEFAULT = null
}

if (!oneClick || options.perMachine === true) {
defines.INSTALL_MODE_PER_ALL_USERS_REQUIRED = null
}
Expand Down
7 changes: 7 additions & 0 deletions packages/app-builder-lib/src/targets/nsis/nsisOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ export interface NsisOptions extends CommonNsisOptions, CommonWindowsInstallerCo
*/
readonly perMachine?: boolean

/**
* Whether to set per-machine or per-user installation as default selection on the install mode installer page.
*
* @default false
*/
readonly selectPerMachineByDefault?: boolean

/**
* *assisted installer only.* Allow requesting for elevation. If false, user will have to restart installer with elevated permissions.
* @default true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@
!ifdef INSTALL_MODE_PER_ALL_USERS
mmaietta marked this conversation as resolved.
Show resolved Hide resolved
!insertmacro setInstallModePerAllUsers
!else
!insertmacro setInstallModePerUser
!ifdef INSTALL_MODE_PER_ALL_USERS_DEFAULT
!insertmacro setInstallModePerAllUsers
!else
!insertmacro setInstallModePerUser
!endif
!endif
${endif}
!endif
Expand Down