Skip to content

Commit c223421

Browse files
committed
fix(nsis): Decide to use elevate.exe for installer when update using nsis packElevateHelper option in electron-builder config
If window service needs to run installer for update, the installer must have admin previlege. Electron-updater detects whether elevating or not using isAdminRightsRequired in update-info.json. And this isAdminRightsRequired true option should be added to latest.yml using nsis's packElevateHelper option
1 parent 85a3e55 commit c223421

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/poor-windows-heal.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
If window service needs to run installer for update, the installer must have admin previlege. Electron-updater detects whether elevating or not using isAdminRightsRequired in update-info.json. And this isAdminRightsRequired true option should be added to latest.yml using nsis's packElevateHelper option

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export class NsisTarget extends Target {
159159
.join(", "),
160160
}
161161
const isPerMachine = options.perMachine === true
162+
162163
if (!this.isPortable) {
163164
logFields.oneClick = oneClick
164165
logFields.perMachine = isPerMachine
@@ -319,7 +320,7 @@ export class NsisTarget extends Target {
319320
updateInfo = await createBlockmap(installerPath, this, packager, safeArtifactName)
320321
}
321322

322-
if (updateInfo != null && isPerMachine && oneClick) {
323+
if (updateInfo != null && isPerMachine && (oneClick || options.packElevateHelper)) {
323324
updateInfo.isAdminRightsRequired = true
324325
}
325326

0 commit comments

Comments
 (0)