app-builder-lib 27.0.0-alpha.1 → 27.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Framework.d.ts +2 -0
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js.map +1 -1
- package/dist/appInfo.d.ts +1 -1
- package/dist/appInfo.d.ts.map +1 -1
- package/dist/appInfo.js +3 -3
- package/dist/appInfo.js.map +1 -1
- package/dist/asar/asar.js.map +1 -1
- package/dist/asar/asarFileChecker.d.ts +4 -2
- package/dist/asar/asarFileChecker.d.ts.map +1 -1
- package/dist/asar/asarFileChecker.js +2 -3
- package/dist/asar/asarFileChecker.js.map +1 -1
- package/dist/asar/asarUtil.js +21 -11
- package/dist/asar/asarUtil.js.map +1 -1
- package/dist/codeSign/certInfo.d.ts +14 -0
- package/dist/codeSign/certInfo.d.ts.map +1 -1
- package/dist/codeSign/certInfo.js +49 -0
- package/dist/codeSign/certInfo.js.map +1 -1
- package/dist/codeSign/mac/macCodeSign.d.ts +3 -3
- package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
- package/dist/codeSign/mac/macCodeSign.js +50 -25
- package/dist/codeSign/mac/macCodeSign.js.map +1 -1
- package/dist/codeSign/signResult.d.ts +26 -0
- package/dist/codeSign/signResult.d.ts.map +1 -0
- package/dist/codeSign/signResult.js +12 -0
- package/dist/codeSign/signResult.js.map +1 -0
- package/dist/codeSign/win/hsmSignManager.d.ts +10 -0
- package/dist/codeSign/win/hsmSignManager.d.ts.map +1 -0
- package/dist/codeSign/win/hsmSignManager.js +50 -0
- package/dist/codeSign/win/hsmSignManager.js.map +1 -0
- package/dist/codeSign/win/pkcs11SignManager.d.ts +14 -0
- package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -0
- package/dist/codeSign/win/pkcs11SignManager.js +82 -0
- package/dist/codeSign/win/pkcs11SignManager.js.map +1 -0
- package/dist/codeSign/win/signManager.d.ts +17 -0
- package/dist/codeSign/win/signManager.d.ts.map +1 -0
- package/dist/codeSign/win/signManager.js +19 -0
- package/dist/codeSign/win/signManager.js.map +1 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts +95 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -0
- package/dist/codeSign/win/signtoolBaseSignManager.js +507 -0
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -0
- package/dist/codeSign/win/windowsCodeSign.d.ts +2 -1
- package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -1
- package/dist/codeSign/win/windowsCodeSign.js +22 -8
- package/dist/codeSign/win/windowsCodeSign.js.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.d.ts +11 -4
- package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.js +142 -37
- package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
- package/dist/codeSign/win/windowsSignToolManager.d.ts +1 -58
- package/dist/codeSign/win/windowsSignToolManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignToolManager.js +3 -363
- package/dist/codeSign/win/windowsSignToolManager.js.map +1 -1
- package/dist/configuration.d.ts +228 -163
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js +11 -1
- package/dist/configuration.js.map +1 -1
- package/dist/core.d.ts +14 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +11 -0
- package/dist/core.js.map +1 -1
- package/dist/electron/ElectronFramework.d.ts +3 -3
- package/dist/electron/ElectronFramework.d.ts.map +1 -1
- package/dist/electron/ElectronFramework.js +60 -61
- package/dist/electron/ElectronFramework.js.map +1 -1
- package/dist/electron/electronArchSupport.d.ts +12 -0
- package/dist/electron/electronArchSupport.d.ts.map +1 -0
- package/dist/electron/electronArchSupport.js +58 -0
- package/dist/electron/electronArchSupport.js.map +1 -0
- package/dist/electron/electronVersion.d.ts.map +1 -1
- package/dist/electron/electronVersion.js +1 -11
- package/dist/electron/electronVersion.js.map +1 -1
- package/dist/electron/injectFFMPEG.js +2 -2
- package/dist/electron/injectFFMPEG.js.map +1 -1
- package/dist/electron/mac/electronMac.js +24 -35
- package/dist/electron/mac/electronMac.js.map +1 -1
- package/dist/electron/mac/electronMacUtils.d.ts +24 -0
- package/dist/electron/mac/electronMacUtils.d.ts.map +1 -0
- package/dist/electron/mac/electronMacUtils.js +42 -0
- package/dist/electron/mac/electronMacUtils.js.map +1 -0
- package/dist/electron/win/electronWin.js +2 -2
- package/dist/electron/win/electronWin.js.map +1 -1
- package/dist/fileMatcher.d.ts +42 -2
- package/dist/fileMatcher.d.ts.map +1 -1
- package/dist/fileMatcher.js +246 -18
- package/dist/fileMatcher.js.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +19 -8
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +18 -7
- package/dist/indexInternal.js.map +1 -1
- package/dist/linuxPackager.d.ts.map +1 -1
- package/dist/linuxPackager.js +19 -1
- package/dist/linuxPackager.js.map +1 -1
- package/dist/macPackager.d.ts +31 -14
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +236 -147
- package/dist/macPackager.js.map +1 -1
- package/dist/node-module-collector/index.d.ts.map +1 -1
- package/dist/node-module-collector/index.js +47 -16
- package/dist/node-module-collector/index.js.map +1 -1
- package/dist/node-module-collector/moduleManager.d.ts +11 -2
- package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
- package/dist/node-module-collector/moduleManager.js +34 -14
- package/dist/node-module-collector/moduleManager.js.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts +47 -26
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +157 -142
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/packageManager.js +1 -1
- package/dist/node-module-collector/packageManager.js.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +90 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +325 -25
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/types.d.ts +4 -0
- package/dist/node-module-collector/types.d.ts.map +1 -1
- package/dist/node-module-collector/types.js.map +1 -1
- package/dist/options/FuseOptionsV1.d.ts +137 -0
- package/dist/options/FuseOptionsV1.d.ts.map +1 -0
- package/dist/options/FuseOptionsV1.js +2 -0
- package/dist/options/FuseOptionsV1.js.map +1 -0
- package/dist/options/MsixOptions.d.ts +126 -0
- package/dist/options/MsixOptions.d.ts.map +1 -0
- package/dist/options/MsixOptions.js +2 -0
- package/dist/options/MsixOptions.js.map +1 -0
- package/dist/options/PlatformSpecificBuildOptions.d.ts +55 -9
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SnapOptions.d.ts +23 -17
- package/dist/options/SnapOptions.d.ts.map +1 -1
- package/dist/options/SnapOptions.js.map +1 -1
- package/dist/options/SquirrelWindowsOptions.d.ts +0 -5
- package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -1
- package/dist/options/SquirrelWindowsOptions.js.map +1 -1
- package/dist/options/linuxOptions.d.ts +8 -12
- package/dist/options/linuxOptions.d.ts.map +1 -1
- package/dist/options/linuxOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +113 -131
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/pkgOptions.d.ts +1 -1
- package/dist/options/pkgOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +282 -70
- package/dist/options/winOptions.d.ts.map +1 -1
- package/dist/options/winOptions.js +12 -1
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.d.ts +6 -1
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +121 -40
- package/dist/packager.js.map +1 -1
- package/dist/packagerApi.d.ts +10 -1
- package/dist/packagerApi.d.ts.map +1 -1
- package/dist/packagerApi.js.map +1 -1
- package/dist/platformPackager.d.ts +49 -3
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +130 -17
- package/dist/platformPackager.js.map +1 -1
- package/dist/publish/PublishManager.d.ts +36 -2
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +387 -23
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +110 -32
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/targets/ArchiveTarget.d.ts +1 -0
- package/dist/targets/ArchiveTarget.d.ts.map +1 -1
- package/dist/targets/ArchiveTarget.js +6 -3
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts +33 -2
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +109 -29
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/blockmap/blockmap.d.ts +43 -3
- package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
- package/dist/targets/blockmap/blockmap.js +141 -15
- package/dist/targets/blockmap/blockmap.js.map +1 -1
- package/dist/targets/blockmap/verbatimRange.d.ts +44 -0
- package/dist/targets/blockmap/verbatimRange.d.ts.map +1 -0
- package/dist/targets/blockmap/verbatimRange.js +117 -0
- package/dist/targets/blockmap/verbatimRange.js.map +1 -0
- package/dist/targets/differentialUpdateInfoBuilder.d.ts +28 -2
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.js +75 -6
- package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +13 -3
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts +14 -0
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +86 -10
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts +15 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +54 -59
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.d.ts +2 -0
- package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.js +16 -15
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts +5 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.js +14 -7
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.js +5 -11
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
- package/dist/targets/linux/launcherScript.d.ts +32 -0
- package/dist/targets/linux/launcherScript.d.ts.map +1 -0
- package/dist/targets/linux/launcherScript.js +24 -0
- package/dist/targets/linux/launcherScript.js.map +1 -0
- package/dist/targets/linux/snap/SnapTarget.d.ts +1 -1
- package/dist/targets/linux/snap/SnapTarget.d.ts.map +1 -1
- package/dist/targets/linux/snap/SnapTarget.js +23 -1
- package/dist/targets/linux/snap/SnapTarget.js.map +1 -1
- package/dist/targets/linux/snap/core24.d.ts +30 -1
- package/dist/targets/linux/snap/core24.d.ts.map +1 -1
- package/dist/targets/linux/snap/core24.js +146 -70
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/linux/snap/coreCustom.d.ts +1 -1
- package/dist/targets/linux/snap/coreCustom.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreCustom.js +2 -2
- package/dist/targets/linux/snap/coreCustom.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.d.ts +3 -3
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +12 -12
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/linux/snap/snapCommand.d.ts +13 -0
- package/dist/targets/linux/snap/snapCommand.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapCommand.js +21 -0
- package/dist/targets/linux/snap/snapCommand.js.map +1 -0
- package/dist/targets/linux/snap/snapcraft.d.ts +190 -0
- package/dist/targets/linux/snap/snapcraft.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapcraft.js +11 -0
- package/dist/targets/linux/snap/snapcraft.js.map +1 -0
- package/dist/targets/linux/snap/snapcraftBuilder.d.ts +7 -1
- package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -1
- package/dist/targets/linux/snap/snapcraftBuilder.js +57 -20
- package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -1
- package/dist/targets/mac/MacTargetHelper.d.ts +146 -14
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +485 -91
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts +16 -0
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +31 -5
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/targetFactory.d.ts +7 -0
- package/dist/targets/targetFactory.d.ts.map +1 -1
- package/dist/targets/targetFactory.js +28 -0
- package/dist/targets/targetFactory.js.map +1 -1
- package/dist/targets/win/AppxTarget.d.ts +1 -2
- package/dist/targets/win/AppxTarget.d.ts.map +1 -1
- package/dist/targets/win/AppxTarget.js +37 -314
- package/dist/targets/win/AppxTarget.js.map +1 -1
- package/dist/targets/win/MsiTarget.d.ts.map +1 -1
- package/dist/targets/win/MsiTarget.js +13 -13
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/targets/win/MsixTarget.d.ts +22 -0
- package/dist/targets/win/MsixTarget.d.ts.map +1 -0
- package/dist/targets/win/MsixTarget.js +214 -0
- package/dist/targets/win/MsixTarget.js.map +1 -0
- package/dist/targets/win/nsis/Defines.d.ts +3 -0
- package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
- package/dist/targets/win/nsis/Defines.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts +57 -3
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +252 -113
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/WebInstallerTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/WebInstallerTarget.js +23 -12
- package/dist/targets/win/nsis/WebInstallerTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.d.ts +56 -48
- package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.js +4 -3
- package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.d.ts +17 -2
- package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.js +143 -41
- package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
- package/dist/targets/win/nsis/progId.d.ts +21 -0
- package/dist/targets/win/nsis/progId.d.ts.map +1 -0
- package/dist/targets/win/nsis/progId.js +60 -0
- package/dist/targets/win/nsis/progId.js.map +1 -0
- package/dist/targets/win/winAppUtil.d.ts +115 -0
- package/dist/targets/win/winAppUtil.d.ts.map +1 -0
- package/dist/targets/win/winAppUtil.js +407 -0
- package/dist/targets/win/winAppUtil.js.map +1 -0
- package/dist/toolsets/7zip.d.ts +32 -0
- package/dist/toolsets/7zip.d.ts.map +1 -1
- package/dist/toolsets/7zip.js +39 -11
- package/dist/toolsets/7zip.js.map +1 -1
- package/dist/toolsets/appimage.d.ts +3 -3
- package/dist/toolsets/appimage.d.ts.map +1 -1
- package/dist/toolsets/appimage.js +9 -6
- package/dist/toolsets/appimage.js.map +1 -1
- package/dist/toolsets/custom.d.ts +2 -3
- package/dist/toolsets/custom.d.ts.map +1 -1
- package/dist/toolsets/custom.js +67 -149
- package/dist/toolsets/custom.js.map +1 -1
- package/dist/toolsets/fpm.d.ts.map +1 -1
- package/dist/toolsets/fpm.js +11 -5
- package/dist/toolsets/fpm.js.map +1 -1
- package/dist/toolsets/icons.d.ts.map +1 -1
- package/dist/toolsets/icons.js +17 -3
- package/dist/toolsets/icons.js.map +1 -1
- package/dist/toolsets/linuxToolsMac.d.ts.map +1 -1
- package/dist/toolsets/linuxToolsMac.js +17 -4
- package/dist/toolsets/linuxToolsMac.js.map +1 -1
- package/dist/toolsets/nsis.d.ts +5 -0
- package/dist/toolsets/nsis.d.ts.map +1 -1
- package/dist/toolsets/nsis.js +20 -4
- package/dist/toolsets/nsis.js.map +1 -1
- package/dist/toolsets/version.d.ts +12 -0
- package/dist/toolsets/version.d.ts.map +1 -0
- package/dist/toolsets/version.js +13 -0
- package/dist/toolsets/version.js.map +1 -0
- package/dist/toolsets/winCodeSign.d.ts +56 -3
- package/dist/toolsets/winCodeSign.d.ts.map +1 -1
- package/dist/toolsets/winCodeSign.js +125 -42
- package/dist/toolsets/winCodeSign.js.map +1 -1
- package/dist/toolsets/wine.d.ts +2 -1
- package/dist/toolsets/wine.d.ts.map +1 -1
- package/dist/toolsets/wine.js +31 -15
- package/dist/toolsets/wine.js.map +1 -1
- package/dist/util/NodeModuleCopyHelper.js +14 -6
- package/dist/util/NodeModuleCopyHelper.js.map +1 -1
- package/dist/util/appFileCopier.d.ts +52 -0
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +221 -21
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/archCompatibility.d.ts +42 -0
- package/dist/util/archCompatibility.d.ts.map +1 -0
- package/dist/util/archCompatibility.js +202 -0
- package/dist/util/archCompatibility.js.map +1 -0
- package/dist/util/checksum.d.ts +36 -0
- package/dist/util/checksum.d.ts.map +1 -0
- package/dist/util/checksum.js +48 -0
- package/dist/util/checksum.js.map +1 -0
- package/dist/util/config/config.d.ts +1 -0
- package/dist/util/config/config.d.ts.map +1 -1
- package/dist/util/config/config.js +8 -1
- package/dist/util/config/config.js.map +1 -1
- package/dist/util/config/legacyConfigGuard.d.ts +7 -0
- package/dist/util/config/legacyConfigGuard.d.ts.map +1 -0
- package/dist/util/config/legacyConfigGuard.js +187 -0
- package/dist/util/config/legacyConfigGuard.js.map +1 -0
- package/dist/util/config/legacyOptions.d.ts +75 -0
- package/dist/util/config/legacyOptions.d.ts.map +1 -0
- package/dist/util/config/legacyOptions.js +399 -0
- package/dist/util/config/legacyOptions.js.map +1 -0
- package/dist/util/config/load.d.ts +2 -2
- package/dist/util/config/load.d.ts.map +1 -1
- package/dist/util/config/load.js +3 -12
- package/dist/util/config/load.js.map +1 -1
- package/dist/util/config/schemaValidator.d.ts.map +1 -1
- package/dist/util/config/schemaValidator.js +26 -3
- package/dist/util/config/schemaValidator.js.map +1 -1
- package/dist/util/electronGet.d.ts +30 -32
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +359 -129
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/flags.d.ts +5 -5
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +124 -16
- package/dist/util/flags.js.map +1 -1
- package/dist/util/hash.d.ts +1 -1
- package/dist/util/hash.d.ts.map +1 -1
- package/dist/util/hash.js +1 -15
- package/dist/util/hash.js.map +1 -1
- package/dist/util/installOrRebuild.d.ts +44 -0
- package/dist/util/installOrRebuild.d.ts.map +1 -0
- package/dist/util/installOrRebuild.js +276 -0
- package/dist/util/installOrRebuild.js.map +1 -0
- package/dist/util/langs.d.ts.map +1 -1
- package/dist/util/langs.js +1 -0
- package/dist/util/langs.js.map +1 -1
- package/dist/util/license.d.ts.map +1 -1
- package/dist/util/license.js +4 -1
- package/dist/util/license.js.map +1 -1
- package/dist/util/mac/macosIconComposer.d.ts +2 -1
- package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
- package/dist/util/mac/macosIconComposer.js +40 -58
- package/dist/util/mac/macosIconComposer.js.map +1 -1
- package/dist/util/mac/macosVersion.d.ts +0 -1
- package/dist/util/mac/macosVersion.d.ts.map +1 -1
- package/dist/util/mac/macosVersion.js +0 -3
- package/dist/util/mac/macosVersion.js.map +1 -1
- package/dist/util/mac/plist.d.ts +1 -1
- package/dist/util/mac/plist.d.ts.map +1 -1
- package/dist/util/mac/plist.js +5 -0
- package/dist/util/mac/plist.js.map +1 -1
- package/dist/util/nativeBinaryVerifier.d.ts +40 -0
- package/dist/util/nativeBinaryVerifier.d.ts.map +1 -0
- package/dist/util/nativeBinaryVerifier.js +381 -0
- package/dist/util/nativeBinaryVerifier.js.map +1 -0
- package/dist/util/packageMetadata.js +57 -31
- package/dist/util/packageMetadata.js.map +1 -1
- package/dist/util/repositoryInfo.js +6 -3
- package/dist/util/repositoryInfo.js.map +1 -1
- package/dist/util/resolve.js +1 -1
- package/dist/util/resolve.js.map +1 -1
- package/dist/util/streamSpawnToFile.d.ts +47 -0
- package/dist/util/streamSpawnToFile.d.ts.map +1 -0
- package/dist/util/streamSpawnToFile.js +110 -0
- package/dist/util/streamSpawnToFile.js.map +1 -0
- package/dist/util/toolsetLock.d.ts +2 -0
- package/dist/util/toolsetLock.d.ts.map +1 -1
- package/dist/util/toolsetLock.js +31 -5
- package/dist/util/toolsetLock.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/vm/ParallelsVm.d.ts.map +1 -1
- package/dist/vm/ParallelsVm.js +29 -3
- package/dist/vm/ParallelsVm.js.map +1 -1
- package/dist/vm/vm.d.ts +2 -0
- package/dist/vm/vm.d.ts.map +1 -1
- package/dist/vm/vm.js +29 -6
- package/dist/vm/vm.js.map +1 -1
- package/dist/winPackager.d.ts +6 -5
- package/dist/winPackager.d.ts.map +1 -1
- package/dist/winPackager.js +45 -39
- package/dist/winPackager.js.map +1 -1
- package/package.json +19 -18
- package/scheme.json +1731 -961
- package/templates/appx/appxmanifest.xml +2 -3
- package/templates/entitlements.mac.adhoc.plist +15 -0
- package/templates/entitlements.mac.plist +9 -6
- package/templates/msix/appxmanifest.xml +45 -0
- package/templates/nsis/assistedMessages.yml +17 -0
- package/templates/nsis/common.nsh +2 -2
- package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +96 -13
- package/templates/nsis/include/extractAppPackage.nsh +5 -2
- package/templates/nsis/include/installUtil.nsh +2 -2
- package/templates/nsis/include/installer.nsh +88 -50
- package/templates/nsis/include/webPackage.nsh +52 -27
- package/templates/nsis/installSection.nsh +29 -0
- package/templates/nsis/installer.nsi +1 -1
- package/templates/nsis/messages.yml +5 -0
- package/templates/nsis/multiUserUi.nsh +1 -1
- package/dist/codeSign/signManager.d.ts +0 -14
- package/dist/codeSign/signManager.d.ts.map +0 -1
- package/dist/codeSign/signManager.js +0 -2
- package/dist/codeSign/signManager.js.map +0 -1
- package/dist/util/yarn.d.ts +0 -23
- package/dist/util/yarn.d.ts.map +0 -1
- package/dist/util/yarn.js +0 -153
- package/dist/util/yarn.js.map +0 -1
|
@@ -1,29 +1,45 @@
|
|
|
1
|
-
import { Arch, asArray, AsyncTaskManager,
|
|
1
|
+
import { Arch, asArray, AsyncTaskManager, ensureNotBusy, exists, spawnAndWriteWithOutput, generateKsuid, getArchSuffix, getPlatformIconFileName, InvalidConfigurationError, log, statOrNull, use, walk, } from "builder-util";
|
|
2
2
|
import { CURRENT_APP_INSTALLER_FILE_NAME, CURRENT_APP_PACKAGE_FILE_NAME, deepAssign, sleep, UUID } from "builder-util-runtime";
|
|
3
3
|
import _debug from "debug";
|
|
4
|
-
import * as fs from "fs";
|
|
5
4
|
import * as path from "path";
|
|
6
5
|
import { Target } from "../../../core.js";
|
|
7
6
|
import { DesktopShortcutCreationPolicy, getEffectiveOptions } from "../../../options/CommonWindowsInstallerConfiguration.js";
|
|
8
7
|
import { chooseNotNull, computeSafeArtifactNameIfNeeded, normalizeExt } from "../../../platformPackager.js";
|
|
9
8
|
import { hashFile } from "../../../util/hash.js";
|
|
10
|
-
import { isMacOsCatalina } from "../../../util/mac/macosVersion.js";
|
|
11
9
|
import { time } from "../../../util/timer.js";
|
|
12
|
-
import { WineVmManager } from "../../../vm/WineVm.js";
|
|
13
10
|
import { archive } from "../../archive.js";
|
|
14
|
-
import { appendBlockmap, configureDifferentialAwareArchiveOptions, createBlockmap, createNsisWebDifferentialUpdateInfo } from "../../differentialUpdateInfoBuilder.js";
|
|
11
|
+
import { appendBlockmap, configureDifferentialAwareArchiveOptions, createBlockmap, createNsisWebDifferentialUpdateInfo, locateStoredMemberRegions, toBlockMapOptions, } from "../../differentialUpdateInfoBuilder.js";
|
|
15
12
|
import { getWindowsInstallationAppPackageName, getWindowsInstallationDirName } from "../../targetUtil.js";
|
|
16
13
|
import { addCustomMessageFileInclude, createAddLangsMacro, LangConfigurator } from "./nsisLang.js";
|
|
17
14
|
import { computeLicensePage } from "./nsisLicense.js";
|
|
18
15
|
import { NsisScriptGenerator, nsisEscapeString } from "./nsisScriptGenerator.js";
|
|
19
|
-
import {
|
|
16
|
+
import { ELECTRON_BUILDER_NS_UUID, ProgIdMaker } from "./progId.js";
|
|
17
|
+
import { assertInstallerDebugLoggingSupported, getMakeNsisPath, getNsisPluginsPath } from "../../../toolsets/nsis.js";
|
|
20
18
|
import { nsisTemplatesDir, UninstallerReader } from "./nsisUtil.js";
|
|
21
19
|
import { checkMakensisOutput, verifyInstallerSize } from "./nsisValidation.js";
|
|
22
20
|
import _fsExtra from "fs-extra";
|
|
23
21
|
const { readFile, stat, unlink } = _fsExtra;
|
|
24
22
|
const debug = _debug("electron-builder:nsis");
|
|
25
|
-
|
|
26
|
-
const
|
|
23
|
+
/** The member `differentialPackage: "store-asar"` keeps uncompressed in the app package, relative to the unpacked app dir. */
|
|
24
|
+
export const STORED_ASAR_PATH = "resources/app.asar";
|
|
25
|
+
/**
|
|
26
|
+
* The `archive()` options `buildAppPackage` packages the unpacked app with, before the differential-aware
|
|
27
|
+
* adjustments of `configureDifferentialAwareArchiveOptions`. Exported so the benchmark
|
|
28
|
+
* (`test/src/differentialOneLineBenchTest.ts`) packages exactly like a real build instead of copying these.
|
|
29
|
+
*/
|
|
30
|
+
export function createAppPackageArchiveOptions(compression, excluded, storedPaths) {
|
|
31
|
+
return {
|
|
32
|
+
withoutDir: true,
|
|
33
|
+
compression,
|
|
34
|
+
// The install-time Nsis7z extractor only decodes plain LZMA2/Copy and single-stream BCJ — not
|
|
35
|
+
// the CPU branch converters modern 7za applies to executables (BCJ2 on x86/x64, ARM64 on
|
|
36
|
+
// arm64), which it silently skips, dropping the main exe and every native binary from the
|
|
37
|
+
// install. Pin the payload to a filter it can decode. See #9983.
|
|
38
|
+
installTimeDecodable: true,
|
|
39
|
+
excluded,
|
|
40
|
+
storedPaths,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
27
43
|
const USE_NSIS_BUILT_IN_COMPRESSOR = false;
|
|
28
44
|
export class NsisTarget extends Target {
|
|
29
45
|
constructor(packager, outDir, targetName, packageHelper) {
|
|
@@ -34,6 +50,8 @@ export class NsisTarget extends Target {
|
|
|
34
50
|
/** @private */
|
|
35
51
|
this.archs = new Map();
|
|
36
52
|
this.isAsyncSupported = false;
|
|
53
|
+
this.storeAsarChecked = false;
|
|
54
|
+
this.progIdWarningEmitted = false;
|
|
37
55
|
this.packageHelper.refCount++;
|
|
38
56
|
this.options =
|
|
39
57
|
targetName === "portable"
|
|
@@ -45,10 +63,22 @@ export class NsisTarget extends Target {
|
|
|
45
63
|
if (targetName !== "nsis") {
|
|
46
64
|
deepAssign(this.options, this.packager.config[targetName === "nsis-web" ? "nsisWeb" : targetName]);
|
|
47
65
|
}
|
|
66
|
+
// Fails before packaging rather than when makensis rejects LogSet. Portable has no such option (its template never logs).
|
|
67
|
+
if (this.options.installerDebugLogging === true) {
|
|
68
|
+
assertInstallerDebugLoggingSupported(this.packager.config.toolsets?.nsis, this.name);
|
|
69
|
+
}
|
|
48
70
|
const deps = packager.metadata.dependencies;
|
|
49
71
|
if (deps != null && deps["electron-squirrel-startup"] != null) {
|
|
50
72
|
log.warn('"electron-squirrel-startup" dependency is not required for NSIS');
|
|
51
73
|
}
|
|
74
|
+
if (this.options.useZip === true && !this.isZipPayload) {
|
|
75
|
+
if (this.isWebInstaller) {
|
|
76
|
+
log.warn({ target: this.name, solution: "useZip only applies to the nsis and portable targets" }, "useZip is ignored because the web installer always uses a 7z package");
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
log.warn({ target: this.name, solution: "set differentialPackage: false to get a zip payload" }, "useZip is ignored because differential-aware builds always use a 7z payload");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
52
82
|
}
|
|
53
83
|
get shouldBuildUniversalInstaller() {
|
|
54
84
|
const buildSeparateInstallers = this.options.buildUniversalInstaller === false;
|
|
@@ -64,42 +94,119 @@ export class NsisTarget extends Target {
|
|
|
64
94
|
get isBuildDifferentialAware() {
|
|
65
95
|
return !this.isPortable && this.options.differentialPackage !== false;
|
|
66
96
|
}
|
|
97
|
+
// Single source of truth for the payload format: the archive written in buildAppPackage and the
|
|
98
|
+
// extractor selected by the ZIP_COMPRESSION / COMPRESSION_METHOD defines must never disagree.
|
|
99
|
+
// The web installer's download/extract path only handles 7z, so it never gets a zip package.
|
|
100
|
+
get isZipPayload() {
|
|
101
|
+
return !this.isWebInstaller && !this.isBuildDifferentialAware && this.options.useZip === true;
|
|
102
|
+
}
|
|
103
|
+
get isStoreAsar() {
|
|
104
|
+
return this.isBuildDifferentialAware && this.options.differentialPackage === "store-asar";
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Everything that makes buildAppPackage's archive differ between targets. Targets sharing an
|
|
108
|
+
* AppPackageHelper (nsis + portable) reuse one app package per arch only when this key matches,
|
|
109
|
+
* so a target never embeds an archive whose format or layout was chosen by another target.
|
|
110
|
+
* @private
|
|
111
|
+
*/
|
|
112
|
+
get appPackageCacheKey() {
|
|
113
|
+
const options = this.options;
|
|
114
|
+
return JSON.stringify({
|
|
115
|
+
format: this.isZipPayload ? "zip" : "7z",
|
|
116
|
+
differentialAware: this.isBuildDifferentialAware,
|
|
117
|
+
storeAsar: this.isStoreAsar,
|
|
118
|
+
excluded: this.getPreCompressedFileExtensions(),
|
|
119
|
+
// mirrors CopyElevateHelper's per-target packElevateHelper / perMachine resolution
|
|
120
|
+
elevate: options.packElevateHelper !== false || options.perMachine === true,
|
|
121
|
+
blockmap: this.isBuildDifferentialAware && this.isWebInstaller,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
67
124
|
getPreCompressedFileExtensions() {
|
|
68
125
|
const result = this.isWebInstaller ? null : this.options.preCompressedFileExtensions;
|
|
69
126
|
return result == null ? null : asArray(result).map(it => (it.startsWith(".") ? it : `.${it}`));
|
|
70
127
|
}
|
|
71
|
-
/**
|
|
72
|
-
|
|
73
|
-
|
|
128
|
+
/**
|
|
129
|
+
* @private
|
|
130
|
+
* @returns the package file info plus the absolute source paths of the members stored verbatim in it
|
|
131
|
+
* (`storedMemberFiles`, empty unless `differentialPackage` is `"store-asar"`).
|
|
132
|
+
*/
|
|
133
|
+
async buildAppPackage(appOutDir, arch, elevateHelper, fileNameSuffix = "") {
|
|
74
134
|
const packager = this.packager;
|
|
75
135
|
const isBuildDifferentialAware = this.isBuildDifferentialAware;
|
|
76
|
-
const format =
|
|
77
|
-
const archiveFile = path.join(this.outDir, `${packager.appInfo.sanitizedName}-${packager.appInfo.version}-${Arch[arch]}.nsis.${format}`);
|
|
136
|
+
const format = this.isZipPayload ? "zip" : "7z";
|
|
137
|
+
const archiveFile = path.join(this.outDir, `${packager.appInfo.sanitizedName}-${packager.appInfo.version}-${Arch[arch]}${fileNameSuffix}.nsis.${format}`);
|
|
78
138
|
const preCompressedFileExtensions = this.getPreCompressedFileExtensions();
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
139
|
+
const isStoreAsar = this.isStoreAsar;
|
|
140
|
+
if (isStoreAsar) {
|
|
141
|
+
await this.warnIfStoreAsarHasNoAsar(appOutDir);
|
|
142
|
+
}
|
|
143
|
+
// Opt-in via differentialPackage: "store-asar" — keep the asar a byte-stable Copy member so a
|
|
144
|
+
// differential update pays only for its changed blocks instead of re-downloading the whole
|
|
145
|
+
// recompressed asar (see nsisOptions docs). The blockmap chunks these verbatim bytes finer.
|
|
146
|
+
const storedPaths = isStoreAsar ? [STORED_ASAR_PATH] : null;
|
|
147
|
+
// archive() skips a stored path that does not exist (e.g. `asar: false`, warned about above), so
|
|
148
|
+
// only the members that really end up in the package are located in it for the block map.
|
|
149
|
+
const storedMemberFiles = [];
|
|
150
|
+
for (const storedPath of storedPaths ?? []) {
|
|
151
|
+
const memberFile = path.join(appOutDir, storedPath);
|
|
152
|
+
if (await exists(memberFile)) {
|
|
153
|
+
storedMemberFiles.push(memberFile);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const archiveOptions = createAppPackageArchiveOptions(packager.compression, preCompressedFileExtensions == null ? null : preCompressedFileExtensions.map(it => `*${it}`), storedPaths);
|
|
84
157
|
const timer = time(`nsis package, ${Arch[arch]}`);
|
|
85
158
|
await archive(format, archiveFile, appOutDir, isBuildDifferentialAware ? configureDifferentialAwareArchiveOptions(archiveOptions) : archiveOptions);
|
|
86
159
|
timer.end();
|
|
160
|
+
// Inject elevate.exe into the archive via a temp staging dir, never by mutating appOutDir
|
|
161
|
+
// during packaging. The copy into win-unpacked is deferred until all targets finish, so
|
|
162
|
+
// concurrent targets (Squirrel, ZIP, etc.) never pick up elevate.exe non-deterministically.
|
|
163
|
+
// `archiveOptions` was mutated in place by configureDifferentialAwareArchiveOptions above
|
|
164
|
+
// (when differential-aware), so it already reflects the effective compression settings.
|
|
165
|
+
if (elevateHelper) {
|
|
166
|
+
await elevateHelper.addToArchive(archiveFile, this, format, archiveOptions, appOutDir);
|
|
167
|
+
}
|
|
87
168
|
if (isBuildDifferentialAware && this.isWebInstaller) {
|
|
88
|
-
const
|
|
169
|
+
const regions = await locateStoredMemberRegions(archiveFile, storedMemberFiles);
|
|
170
|
+
const data = await appendBlockmap(archiveFile, toBlockMapOptions(regions));
|
|
89
171
|
return {
|
|
90
|
-
|
|
91
|
-
|
|
172
|
+
fileInfo: {
|
|
173
|
+
...data,
|
|
174
|
+
path: archiveFile,
|
|
175
|
+
},
|
|
176
|
+
storedMemberFiles,
|
|
92
177
|
};
|
|
93
178
|
}
|
|
94
179
|
else {
|
|
95
|
-
return await createPackageFileInfo(archiveFile);
|
|
180
|
+
return { fileInfo: await createPackageFileInfo(archiveFile), storedMemberFiles };
|
|
96
181
|
}
|
|
97
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* `archive()` silently skips stored paths that don't exist, so without an asar (e.g. `asar: false`)
|
|
185
|
+
* "store-asar" would do nothing unnoticed. The fallback is harmless — the differential package is
|
|
186
|
+
* non-solid, so each unpacked file is already its own block — but say so once per target.
|
|
187
|
+
* @private
|
|
188
|
+
*/
|
|
189
|
+
async warnIfStoreAsarHasNoAsar(appOutDir) {
|
|
190
|
+
// every arch is packaged with the same asar setting, so checking the first one is enough (and
|
|
191
|
+
// flagging before the await keeps concurrent per-arch packaging from warning twice)
|
|
192
|
+
if (this.storeAsarChecked) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
this.storeAsarChecked = true;
|
|
196
|
+
const asarFile = path.join(appOutDir, STORED_ASAR_PATH);
|
|
197
|
+
if (await exists(asarFile)) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
log.warn({ reason: `${STORED_ASAR_PATH} not found (e.g. asar is disabled)`, file: log.filePath(asarFile) }, 'differentialPackage "store-asar" has no effect, the app package is compressed normally');
|
|
201
|
+
}
|
|
98
202
|
installerFilenamePattern(primaryArch, defaultArch) {
|
|
99
203
|
const setupText = this.isPortable ? "" : "Setup ";
|
|
100
204
|
const archSuffix = !this.shouldBuildUniversalInstaller && primaryArch != null ? getArchSuffix(primaryArch, defaultArch) : "";
|
|
101
205
|
return "${productName} " + setupText + "${version}" + archSuffix + ".${ext}";
|
|
102
206
|
}
|
|
207
|
+
get writesUpdateInfo() {
|
|
208
|
+
return !this.isPortable;
|
|
209
|
+
}
|
|
103
210
|
get isPortable() {
|
|
104
211
|
return this.name === "portable";
|
|
105
212
|
}
|
|
@@ -125,6 +232,9 @@ export class NsisTarget extends Target {
|
|
|
125
232
|
await this.packageHelper.finishBuild();
|
|
126
233
|
}
|
|
127
234
|
}
|
|
235
|
+
get appGuid() {
|
|
236
|
+
return this.options.guid || UUID.v5(this.packager.appInfo.id, ELECTRON_BUILDER_NS_UUID);
|
|
237
|
+
}
|
|
128
238
|
async buildInstaller(archs) {
|
|
129
239
|
const primaryArch = archs.size === 1 ? (archs.keys().next().value ?? null) : null;
|
|
130
240
|
const packager = this.packager;
|
|
@@ -151,11 +261,10 @@ export class NsisTarget extends Target {
|
|
|
151
261
|
file: installerPath,
|
|
152
262
|
arch: primaryArch,
|
|
153
263
|
}, logFields);
|
|
154
|
-
const
|
|
155
|
-
const uninstallAppKey = guid.replace(/\\/g, " - ");
|
|
264
|
+
const uninstallAppKey = this.appGuid.replace(/\\/g, " - ");
|
|
156
265
|
const defines = {
|
|
157
266
|
APP_ID: appInfo.id,
|
|
158
|
-
APP_GUID:
|
|
267
|
+
APP_GUID: this.appGuid,
|
|
159
268
|
// Windows bug - entry in Software\Microsoft\Windows\CurrentVersion\Uninstall cannot have \ symbols (dir)
|
|
160
269
|
UNINSTALL_APP_KEY: uninstallAppKey,
|
|
161
270
|
PRODUCT_NAME: appInfo.productName,
|
|
@@ -167,11 +276,11 @@ export class NsisTarget extends Target {
|
|
|
167
276
|
BUILD_RESOURCES_DIR: packager.buildResourcesDir,
|
|
168
277
|
APP_PACKAGE_NAME: getWindowsInstallationAppPackageName(appInfo.name),
|
|
169
278
|
};
|
|
170
|
-
if (options.
|
|
279
|
+
if (options.installerDebugLogging === true) {
|
|
171
280
|
defines.ENABLE_LOGGING_ELECTRON_BUILDER = null;
|
|
172
281
|
}
|
|
173
|
-
if (uninstallAppKey !==
|
|
174
|
-
defines.UNINSTALL_REGISTRY_KEY_2 = `Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${
|
|
282
|
+
if (uninstallAppKey !== this.appGuid) {
|
|
283
|
+
defines.UNINSTALL_REGISTRY_KEY_2 = `Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\${this.appGuid}`;
|
|
175
284
|
}
|
|
176
285
|
const { homepage } = this.packager.metadata;
|
|
177
286
|
use(options.uninstallUrlHelp || homepage, it => (defines.UNINSTALL_URL_HELP = it));
|
|
@@ -195,7 +304,7 @@ export class NsisTarget extends Target {
|
|
|
195
304
|
defines.MUI_UNICON = iconPath;
|
|
196
305
|
}
|
|
197
306
|
}
|
|
198
|
-
const { packageFiles, estimatedSize } = await this.resolveArchPackageFiles(archs, defines, packager);
|
|
307
|
+
const { packageFiles, estimatedSize, storedMemberFiles } = await this.resolveArchPackageFiles(archs, defines, packager);
|
|
199
308
|
this.configureDefinesForAllTypeOfInstaller(defines);
|
|
200
309
|
if (isPortable) {
|
|
201
310
|
const { unpackDirName, requestExecutionLevel, splashImage } = options;
|
|
@@ -264,9 +373,15 @@ export class NsisTarget extends Target {
|
|
|
264
373
|
updateInfo = createNsisWebDifferentialUpdateInfo(installerPath, packageFiles);
|
|
265
374
|
}
|
|
266
375
|
else if (this.isBuildDifferentialAware) {
|
|
267
|
-
|
|
376
|
+
// Every arch package is embedded verbatim in the installer (SetCompress off), so the stored
|
|
377
|
+
// members of all of them sit verbatim in the signed installer too; locate them there.
|
|
378
|
+
const regions = await locateStoredMemberRegions(installerPath, storedMemberFiles);
|
|
379
|
+
updateInfo = await createBlockmap(installerPath, this, packager, safeArtifactName, primaryArch, toBlockMapOptions(regions));
|
|
268
380
|
}
|
|
269
|
-
|
|
381
|
+
// a per-machine build always packs elevate.exe (see CopyElevateHelper), unless the framework has no elevate helper
|
|
382
|
+
if (isPerMachine && packager.framework.isCopyElevateHelper) {
|
|
383
|
+
// without a blockmap (`differentialPackage: false`), the update info of the installer is only its checksum
|
|
384
|
+
updateInfo ??= { sha512: await hashFile(installerPath) };
|
|
270
385
|
updateInfo.isAdminRightsRequired = true;
|
|
271
386
|
}
|
|
272
387
|
await packager.emitArtifactBuildCompleted({
|
|
@@ -282,6 +397,8 @@ export class NsisTarget extends Target {
|
|
|
282
397
|
}
|
|
283
398
|
async resolveArchPackageFiles(archs, defines, packager) {
|
|
284
399
|
const packageFiles = {};
|
|
400
|
+
// stored (Copy) members of every arch package, to be located in the installer for its block map
|
|
401
|
+
const storedMemberFiles = [];
|
|
285
402
|
let estimatedSize = 0;
|
|
286
403
|
const options = this.options;
|
|
287
404
|
if (this.isPortable && options.useZip) {
|
|
@@ -295,7 +412,8 @@ export class NsisTarget extends Target {
|
|
|
295
412
|
}
|
|
296
413
|
else {
|
|
297
414
|
await Promise.all(Array.from(archs.keys()).map(async (arch) => {
|
|
298
|
-
const { fileInfo, unpackedSize } = await this.packageHelper.packArch(arch, this);
|
|
415
|
+
const { fileInfo, unpackedSize, storedMemberFiles: archStoredMemberFiles } = await this.packageHelper.packArch(arch, this);
|
|
416
|
+
storedMemberFiles.push(...archStoredMemberFiles);
|
|
299
417
|
const file = fileInfo.path;
|
|
300
418
|
const defineKey = arch === Arch.x64 ? "APP_64" : arch === Arch.arm64 ? "APP_ARM64" : "APP_32";
|
|
301
419
|
defines[defineKey] = file;
|
|
@@ -317,7 +435,7 @@ export class NsisTarget extends Target {
|
|
|
317
435
|
estimatedSize += unpackedSize;
|
|
318
436
|
}));
|
|
319
437
|
}
|
|
320
|
-
return { packageFiles, estimatedSize };
|
|
438
|
+
return { packageFiles, estimatedSize, storedMemberFiles };
|
|
321
439
|
}
|
|
322
440
|
generateGitHubInstallerName(primaryArch, defaultArch) {
|
|
323
441
|
const appInfo = this.packager.appInfo;
|
|
@@ -347,27 +465,14 @@ export class NsisTarget extends Target {
|
|
|
347
465
|
defines.BUILD_UNINSTALLER = null;
|
|
348
466
|
defines.UNINSTALLER_OUT_FILE = isWin ? uninstallerPath : path.win32.join("Z:", uninstallerPath);
|
|
349
467
|
await this.executeMakensis(defines, commands, sharedHeader + (await this.computeFinalScript(script, false, archs)));
|
|
350
|
-
//
|
|
351
|
-
//
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
await UninstallerReader.exec(installerPath, uninstallerPath);
|
|
355
|
-
}
|
|
356
|
-
catch (error) {
|
|
357
|
-
log.warn(`packager.vm is used: ${error.message}`);
|
|
358
|
-
const vm = await packager.vm.value;
|
|
359
|
-
await vm.exec(installerPath, []);
|
|
360
|
-
// Parallels VM can exit after command execution, but NSIS continue to be running
|
|
361
|
-
let i = 0;
|
|
362
|
-
while (!(await exists(uninstallerPath)) && i++ < 100) {
|
|
363
|
-
// noinspection JSUnusedLocalSymbols
|
|
364
|
-
await sleep(300);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
468
|
+
// The uninstaller is extracted from the installer in JS, emulating what NSIS `WriteUninstaller` does, and verified with the NSIS CRC check.
|
|
469
|
+
// Running the installer (natively, via wine or in a VM) is only a fallback, e.g. for solid compression or `!uninstfinalize`.
|
|
470
|
+
try {
|
|
471
|
+
await UninstallerReader.exec(installerPath, uninstallerPath);
|
|
367
472
|
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
await
|
|
473
|
+
catch (error) {
|
|
474
|
+
log.warn({ reason: error.message }, "cannot extract uninstaller from installer, running installer to write it instead");
|
|
475
|
+
await this.runInstallerToWriteUninstaller(installerPath, uninstallerPath);
|
|
371
476
|
}
|
|
372
477
|
await packager.signIf(uninstallerPath);
|
|
373
478
|
delete defines.BUILD_UNINSTALLER;
|
|
@@ -375,6 +480,17 @@ export class NsisTarget extends Target {
|
|
|
375
480
|
defines.UNINSTALLER_OUT_FILE = uninstallerPath;
|
|
376
481
|
return { script, isCustomScript: false };
|
|
377
482
|
}
|
|
483
|
+
async runInstallerToWriteUninstaller(installerPath, uninstallerPath) {
|
|
484
|
+
const vm = await this.packager.execVm.value;
|
|
485
|
+
// explicit timeout (2 minutes, as WineVmManager defaults to), so a stuck installer fails the build instead of hanging it on any host
|
|
486
|
+
await vm.exec(installerPath, [], { env: { __COMPAT_LAYER: "RunAsInvoker" }, timeout: 120 * 1000 });
|
|
487
|
+
// Parallels VM can exit after command execution, but NSIS continue to be running
|
|
488
|
+
let i = 0;
|
|
489
|
+
while (!(await exists(uninstallerPath)) && i++ < 100) {
|
|
490
|
+
// noinspection JSUnusedLocalSymbols
|
|
491
|
+
await sleep(300);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
378
494
|
computeVersionKey(short = false) {
|
|
379
495
|
// Error: invalid VIProductVersion format, should be X.X.X.X
|
|
380
496
|
// so, we must strip beta
|
|
@@ -502,11 +618,10 @@ export class NsisTarget extends Target {
|
|
|
502
618
|
defines.APP_INSTALLER_STORE_FILE = `${appInfo.updaterCacheDirName}\\${CURRENT_APP_INSTALLER_FILE_NAME}`;
|
|
503
619
|
}
|
|
504
620
|
if (!this.isWebInstaller && defines.APP_BUILD_DIR == null) {
|
|
505
|
-
|
|
506
|
-
if (options.useZip) {
|
|
621
|
+
if (this.isZipPayload) {
|
|
507
622
|
defines.ZIP_COMPRESSION = null;
|
|
508
623
|
}
|
|
509
|
-
defines.COMPRESSION_METHOD =
|
|
624
|
+
defines.COMPRESSION_METHOD = this.isZipPayload ? "zip" : "7z";
|
|
510
625
|
}
|
|
511
626
|
}
|
|
512
627
|
async executeMakensis(defines, commands, script, opts = {}) {
|
|
@@ -523,9 +638,9 @@ export class NsisTarget extends Target {
|
|
|
523
638
|
// would terminate the current script line and let whatever follows
|
|
524
639
|
// be parsed as a new preprocessor directive (e.g. !system, !include).
|
|
525
640
|
// 2. bare $ → escaped to $$; unescaped $ in a define value would cause
|
|
526
|
-
// NSIS to expand an unintended variable reference. ${...}
|
|
527
|
-
//
|
|
528
|
-
// expand correctly.
|
|
641
|
+
// NSIS to expand an unintended variable reference. ${...} define
|
|
642
|
+
// references (e.g. ${NSISDIR}) and $(...) LangString references
|
|
643
|
+
// (e.g. $(customSN)) are left intact so they still expand correctly.
|
|
529
644
|
// 3. " chars → escaped to $\"; an unescaped " would break out of
|
|
530
645
|
// double-quoted NSIS string literals where ${DEFINE} is expanded.
|
|
531
646
|
args.push(`-D${name}=${nsisEscapeString(String(value))}`);
|
|
@@ -575,36 +690,90 @@ export class NsisTarget extends Target {
|
|
|
575
690
|
scriptGenerator.include(path.join(nsisTemplatesDir, "include", "StdUtils.nsh"));
|
|
576
691
|
const includeDir = path.join(nsisTemplatesDir, "include");
|
|
577
692
|
scriptGenerator.addIncludeDir(includeDir);
|
|
693
|
+
// allow custom scripts to `!include` sibling files from the build resources directory
|
|
694
|
+
scriptGenerator.addIncludeDir(packager.buildResourcesDir);
|
|
578
695
|
scriptGenerator.flags(["updated", "force-run", "keep-shortcuts", "no-desktop-shortcut", "delete-app-data", "allusers", "currentuser"]);
|
|
579
696
|
createAddLangsMacro(scriptGenerator, langConfigurator);
|
|
580
697
|
const taskManager = new AsyncTaskManager(packager.cancellationToken);
|
|
581
|
-
const
|
|
582
|
-
taskManager.add(async () => {
|
|
583
|
-
scriptGenerator.addPluginDir(pluginArch, path.join(await getNsisPluginsPath(this.packager.config.toolsets?.nsis, this.packager.buildResourcesDir), pluginArch));
|
|
584
|
-
});
|
|
698
|
+
const bundledPluginArch = this.isUnicodeEnabled ? "x86-unicode" : "x86-ansi";
|
|
585
699
|
taskManager.add(async () => {
|
|
586
|
-
|
|
587
|
-
const stat = await statOrNull(userPluginDir);
|
|
588
|
-
if (stat != null && stat.isDirectory()) {
|
|
589
|
-
scriptGenerator.addPluginDir(pluginArch, userPluginDir);
|
|
590
|
-
}
|
|
700
|
+
scriptGenerator.addPluginDir(bundledPluginArch, path.join(await getNsisPluginsPath(this.packager.config.toolsets?.nsis, this.packager.buildResourcesDir), bundledPluginArch));
|
|
591
701
|
});
|
|
592
|
-
|
|
593
|
-
if (!this.isPortable) {
|
|
594
|
-
if (options.oneClick === false) {
|
|
595
|
-
taskManager.addTask(addCustomMessageFileInclude("assistedMessages.yml", packager, scriptGenerator, langConfigurator));
|
|
596
|
-
}
|
|
702
|
+
for (const pluginArch of ["x86-unicode", "x86-ansi"]) {
|
|
597
703
|
taskManager.add(async () => {
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
scriptGenerator.
|
|
704
|
+
const userPluginDir = path.join(packager.buildResourcesDir, pluginArch);
|
|
705
|
+
const stat = await statOrNull(userPluginDir);
|
|
706
|
+
if (stat != null && stat.isDirectory()) {
|
|
707
|
+
scriptGenerator.addPluginDir(pluginArch, userPluginDir);
|
|
602
708
|
}
|
|
603
709
|
});
|
|
604
710
|
}
|
|
711
|
+
taskManager.addTask(addCustomMessageFileInclude("messages.yml", packager, scriptGenerator, langConfigurator));
|
|
712
|
+
if (!this.isPortable && options.oneClick === false) {
|
|
713
|
+
taskManager.addTask(addCustomMessageFileInclude("assistedMessages.yml", packager, scriptGenerator, langConfigurator));
|
|
714
|
+
}
|
|
715
|
+
taskManager.add(async () => {
|
|
716
|
+
for (const customInclude of await this.resolveCustomIncludes()) {
|
|
717
|
+
scriptGenerator.include(customInclude);
|
|
718
|
+
}
|
|
719
|
+
});
|
|
605
720
|
await taskManager.awaitTasks();
|
|
606
721
|
return scriptGenerator.build();
|
|
607
722
|
}
|
|
723
|
+
/**
|
|
724
|
+
* Resolves the `include` option to a list of NSIS script paths.
|
|
725
|
+
*
|
|
726
|
+
* `include` may be a single path or an array of paths — each is resolved relative to the build resources directory first and then relative to the project directory.
|
|
727
|
+
* When the option is not set, `build/installer.nsh` is auto-discovered — except for the portable target, which only ever includes explicitly configured scripts
|
|
728
|
+
* (an auto-discovered `installer.nsh` is usually written for the installer target and must not silently leak into portable builds).
|
|
729
|
+
*/
|
|
730
|
+
async resolveCustomIncludes() {
|
|
731
|
+
const include = this.options.include;
|
|
732
|
+
if (Array.isArray(include)) {
|
|
733
|
+
const result = [];
|
|
734
|
+
for (const entry of include) {
|
|
735
|
+
const resolved = await this.packager.getResource(entry);
|
|
736
|
+
if (resolved != null) {
|
|
737
|
+
result.push(resolved);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
return result;
|
|
741
|
+
}
|
|
742
|
+
if (this.isPortable && include == null) {
|
|
743
|
+
return [];
|
|
744
|
+
}
|
|
745
|
+
const resolved = this.isPortable ? await this.packager.getResource(include) : await this.packager.getResource(include, "installer.nsh");
|
|
746
|
+
return resolved == null ? [] : [resolved];
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* v27 registers each file association under a generated ProgID instead of the association name or
|
|
750
|
+
* extension verbatim, so the old value could collide with an unrelated app. Nothing needs to change
|
|
751
|
+
* in config — but a custom NSIS script that hard-codes the old ProgID to add shell verbs or extra
|
|
752
|
+
* registry entries now writes them under a key nothing reads.
|
|
753
|
+
*
|
|
754
|
+
* Only warns when a custom script is actually supplied; the generated ProgID is invisible otherwise.
|
|
755
|
+
*/
|
|
756
|
+
async warnAboutProgIdFormatChange(fileAssociations, progIdMaker) {
|
|
757
|
+
if (this.progIdWarningEmitted) {
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
const packager = this.packager;
|
|
761
|
+
const hasCustomScript = (await this.resolveCustomIncludes()).length > 0 || (await packager.getResource(this.options.script, "installer.nsi")) != null;
|
|
762
|
+
if (!hasCustomScript) {
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
this.progIdWarningEmitted = true;
|
|
766
|
+
const examples = fileAssociations
|
|
767
|
+
.slice(0, 3)
|
|
768
|
+
.map(item => {
|
|
769
|
+
const ext = asArray(item.ext).map(normalizeExt)[0];
|
|
770
|
+
return `${item.name || ext} -> ${progIdMaker.progId(item.name || ext)}`;
|
|
771
|
+
})
|
|
772
|
+
.join(", ");
|
|
773
|
+
log.warn({ progIds: examples, solution: "update any registry keys, shell verbs, or external tooling that references the old ProgID" }, "NSIS file associations now register a generated ProgID instead of the association name or extension. " +
|
|
774
|
+
"You ship a custom NSIS script (nsis.include / nsis.script), which may reference the old value. " +
|
|
775
|
+
"See https://www.electron.build/docs/migration/v27-breaking-changes#nsis-file-association-progid-format-changed");
|
|
776
|
+
}
|
|
608
777
|
async computeFinalScript(originalScript, isInstaller, archs) {
|
|
609
778
|
const packager = this.packager;
|
|
610
779
|
const options = this.options;
|
|
@@ -628,6 +797,8 @@ export class NsisTarget extends Target {
|
|
|
628
797
|
const fileAssociations = packager.fileAssociations;
|
|
629
798
|
if (fileAssociations.length !== 0) {
|
|
630
799
|
scriptGenerator.include(path.join(path.join(nsisTemplatesDir, "include"), "FileAssociation.nsh"));
|
|
800
|
+
const progIdMaker = new ProgIdMaker(this.appGuid, packager.appInfo.productFilename);
|
|
801
|
+
await this.warnAboutProgIdFormatChange(fileAssociations, progIdMaker);
|
|
631
802
|
if (isInstaller) {
|
|
632
803
|
const registerFileAssociationsScript = new NsisScriptGenerator();
|
|
633
804
|
for (const item of fileAssociations) {
|
|
@@ -639,10 +810,11 @@ export class NsisTarget extends Target {
|
|
|
639
810
|
installedIconPath = `$INSTDIR\\resources\\${nsisEscapeString(path.basename(customIcon))}`;
|
|
640
811
|
registerFileAssociationsScript.file(installedIconPath, customIcon);
|
|
641
812
|
}
|
|
813
|
+
const progID = progIdMaker.progId(item.name || ext);
|
|
642
814
|
const icon = `"${installedIconPath}"`;
|
|
643
815
|
const commandText = `"Open with ${nsisEscapeString(packager.appInfo.productName)}"`;
|
|
644
816
|
const command = '"$appExe $\\"%1$\\""';
|
|
645
|
-
registerFileAssociationsScript.insertMacro("APP_ASSOCIATE", `"${nsisEscapeString(ext)}" "${
|
|
817
|
+
registerFileAssociationsScript.insertMacro("APP_ASSOCIATE", `"${nsisEscapeString(ext)}" "${progID}" "${nsisEscapeString(item.description || "")}" ${icon} ${commandText} ${command}`);
|
|
646
818
|
}
|
|
647
819
|
}
|
|
648
820
|
scriptGenerator.macro("registerFileAssociations", registerFileAssociationsScript);
|
|
@@ -650,8 +822,8 @@ export class NsisTarget extends Target {
|
|
|
650
822
|
else {
|
|
651
823
|
const unregisterFileAssociationsScript = new NsisScriptGenerator();
|
|
652
824
|
for (const item of fileAssociations) {
|
|
653
|
-
for (const ext of asArray(item.ext)) {
|
|
654
|
-
unregisterFileAssociationsScript.insertMacro("APP_UNASSOCIATE", `"${
|
|
825
|
+
for (const ext of asArray(item.ext).map(normalizeExt)) {
|
|
826
|
+
unregisterFileAssociationsScript.insertMacro("APP_UNASSOCIATE", `"${nsisEscapeString(ext)}" "${progIdMaker.progId(item.name || ext)}"`);
|
|
655
827
|
}
|
|
656
828
|
}
|
|
657
829
|
scriptGenerator.macro("unregisterFileAssociations", unregisterFileAssociationsScript);
|
|
@@ -683,39 +855,6 @@ async function generateForPreCompressed(preCompressedFileExtensions, dir, arch,
|
|
|
683
855
|
scriptGenerator.macro(`customFiles_${Arch[arch]}`, macro);
|
|
684
856
|
}
|
|
685
857
|
}
|
|
686
|
-
async function ensureNotBusy(outFile) {
|
|
687
|
-
function isBusy(wasBusyBefore) {
|
|
688
|
-
return new Promise((resolve, reject) => {
|
|
689
|
-
fs.open(outFile, "r+", (error, fd) => {
|
|
690
|
-
try {
|
|
691
|
-
if (error != null && error.code === "EBUSY") {
|
|
692
|
-
if (!wasBusyBefore) {
|
|
693
|
-
log.info({}, "output file is locked for writing (maybe by virus scanner) => waiting for unlock...");
|
|
694
|
-
}
|
|
695
|
-
resolve(false);
|
|
696
|
-
}
|
|
697
|
-
else if (fd == null) {
|
|
698
|
-
resolve(true);
|
|
699
|
-
}
|
|
700
|
-
else {
|
|
701
|
-
fs.close(fd, () => resolve(true));
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
catch (error) {
|
|
705
|
-
reject(error);
|
|
706
|
-
}
|
|
707
|
-
});
|
|
708
|
-
}).then(result => {
|
|
709
|
-
if (result) {
|
|
710
|
-
return true;
|
|
711
|
-
}
|
|
712
|
-
else {
|
|
713
|
-
return sleep(2000).then(() => isBusy(true));
|
|
714
|
-
}
|
|
715
|
-
});
|
|
716
|
-
}
|
|
717
|
-
await isBusy(false);
|
|
718
|
-
}
|
|
719
858
|
async function createPackageFileInfo(file) {
|
|
720
859
|
return {
|
|
721
860
|
path: file,
|