1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 06:13:38 +00:00

Add NSIS custom installer script for UAC fix on Windows (#2856)

This commit is contained in:
Vince Grassia
2022-06-08 08:47:10 -04:00
committed by GitHub
parent 93e8c8b25a
commit 3d4c5fea4d
2 changed files with 66 additions and 14 deletions

View File

@@ -1,10 +1,16 @@
{ {
"extraMetadata": { "name": "bitwarden" }, "extraMetadata": {
"name": "bitwarden"
},
"productName": "Bitwarden", "productName": "Bitwarden",
"appId": "com.bitwarden.desktop", "appId": "com.bitwarden.desktop",
"buildDependenciesFromSource": true, "buildDependenciesFromSource": true,
"copyright": "Copyright © 2015-2022 Bitwarden Inc.", "copyright": "Copyright © 2015-2022 Bitwarden Inc.",
"directories": { "buildResources": "resources", "output": "dist", "app": "build" }, "directories": {
"buildResources": "resources",
"output": "dist",
"app": "build"
},
"afterSign": "scripts/after-sign.js", "afterSign": "scripts/after-sign.js",
"asarUnpack": ["**/*.node"], "asarUnpack": ["**/*.node"],
"files": ["**/*", "!**/node_modules/@bitwarden/desktop-native/**/*"], "files": ["**/*", "!**/node_modules/@bitwarden/desktop-native/**/*"],
@@ -62,29 +68,54 @@
"target": ["portable", "nsis-web", "appx"], "target": ["portable", "nsis-web", "appx"],
"sign": "./sign.js", "sign": "./sign.js",
"extraResources": [ "extraResources": [
{ "from": "node_modules/regedit/vbs", "to": "regedit/vbs", "filter": ["**/*"] }, {
{ "from": "resources/native-messaging.bat", "to": "native-messaging.bat" } "from": "node_modules/regedit/vbs",
"to": "regedit/vbs",
"filter": ["**/*"]
},
{
"from": "resources/native-messaging.bat",
"to": "native-messaging.bat"
}
] ]
}, },
"linux": { "linux": {
"category": "Utility", "category": "Utility",
"synopsis": "A secure and free password manager for all of your devices.", "synopsis": "A secure and free password manager for all of your devices.",
"target": ["deb", "freebsd", "rpm", "AppImage", "snap"], "target": ["deb", "freebsd", "rpm", "AppImage", "snap"],
"desktop": { "Name": "Bitwarden", "Type": "Application", "GenericName": "Password Manager" } "desktop": {
"Name": "Bitwarden",
"Type": "Application",
"GenericName": "Password Manager"
}
}, },
"dmg": { "dmg": {
"icon": "dmg.icns", "icon": "dmg.icns",
"contents": [ "contents": [
{ "x": 150, "y": 185, "type": "file" }, {
{ "x": 390, "y": 180, "type": "link", "path": "/Applications" } "x": 150,
"y": 185,
"type": "file"
},
{
"x": 390,
"y": 180,
"type": "link",
"path": "/Applications"
}
], ],
"window": { "width": 540, "height": 380 } "window": {
"width": 540,
"height": 380
}
}, },
"mas": { "mas": {
"entitlements": "resources/entitlements.mas.plist", "entitlements": "resources/entitlements.mas.plist",
"entitlementsInherit": "resources/entitlements.mas.inherit.plist", "entitlementsInherit": "resources/entitlements.mas.inherit.plist",
"hardenedRuntime": false, "hardenedRuntime": false,
"extendInfo": { "LSMinimumSystemVersion": "10.14.0" } "extendInfo": {
"LSMinimumSystemVersion": "10.14.0"
}
}, },
"nsisWeb": { "nsisWeb": {
"oneClick": false, "oneClick": false,
@@ -92,9 +123,12 @@
"allowToChangeInstallationDirectory": false, "allowToChangeInstallationDirectory": false,
"artifactName": "${productName}-Installer-${version}.${ext}", "artifactName": "${productName}-Installer-${version}.${ext}",
"uninstallDisplayName": "${productName}", "uninstallDisplayName": "${productName}",
"deleteAppDataOnUninstall": true "deleteAppDataOnUninstall": true,
"include": "installer.nsh"
},
"portable": {
"artifactName": "${productName}-Portable-${version}.${ext}"
}, },
"portable": { "artifactName": "${productName}-Portable-${version}.${ext}" },
"appx": { "appx": {
"artifactName": "${productName}-${version}-${arch}.${ext}", "artifactName": "${productName}-${version}-${arch}.${ext}",
"backgroundColor": "#175DDC", "backgroundColor": "#175DDC",
@@ -111,13 +145,22 @@
"appImage": { "appImage": {
"artifactName": "${productName}-${version}-${arch}.${ext}" "artifactName": "${productName}-${version}-${arch}.${ext}"
}, },
"rpm": { "artifactName": "${productName}-${version}-${arch}.${ext}" }, "rpm": {
"freebsd": { "artifactName": "${productName}-${version}-${arch}.${ext}" }, "artifactName": "${productName}-${version}-${arch}.${ext}"
},
"freebsd": {
"artifactName": "${productName}-${version}-${arch}.${ext}"
},
"snap": { "snap": {
"autoStart": true, "autoStart": true,
"confinement": "strict", "confinement": "strict",
"plugs": ["default", "password-manager-service"], "plugs": ["default", "password-manager-service"],
"stagePackages": ["default"] "stagePackages": ["default"]
}, },
"protocols": [{ "name": "Bitwarden", "schemes": ["bitwarden"] }] "protocols": [
{
"name": "Bitwarden",
"schemes": ["bitwarden"]
}
]
} }

View File

@@ -0,0 +1,9 @@
!macro customInit
${if} $installMode == "all"
${IfNot} ${UAC_IsAdmin}
ShowWindow $HWNDPARENT ${SW_HIDE}
!insertmacro UAC_RunElevated
Quit
${endif}
${endif}
!macroend