app-builder-lib 27.0.0-alpha.0 → 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 +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 +41 -59
- 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 +6 -1
- 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,16 +1,18 @@
|
|
|
1
|
-
import { Arch, asArray, AsyncTaskManager, exists, InvalidConfigurationError, isEmptyOrSpaces, isPullRequest, log, safeStringifyJson, serializeToYaml } from "builder-util";
|
|
2
|
-
import { getS3LikeProviderBaseUrl, githubTagPrefix, githubUrl, } from "builder-util-runtime";
|
|
1
|
+
import { Arch, asArray, AsyncTaskManager, derivePublicKeyPem, exists, InvalidConfigurationError, isEmptyOrSpaces, isPullRequest, log, safeStringifyJson, serializeToYaml, } from "builder-util";
|
|
2
|
+
import { computeUpdateManifestKeyId, getS3LikeProviderBaseUrl, githubTagPrefix, githubUrl, normalizePublicKeyList, } from "builder-util-runtime";
|
|
3
3
|
import _debug from "debug";
|
|
4
|
-
import { BitbucketPublisher, getCiTag, GitHubPublisher, GitlabPublisher, KeygenPublisher, S3Publisher, SnapStorePublisher, SpacesPublisher, } from "electron-publish";
|
|
4
|
+
import { BitbucketPublisher, getCiTag, GitHubPublisher, GitlabPublisher, KeygenPublisher, R2Publisher, S3Publisher, SnapStorePublisher, SpacesPublisher, } from "electron-publish";
|
|
5
5
|
import { MultiProgress } from "electron-publish/internal";
|
|
6
|
-
import { readFile
|
|
6
|
+
import { readFile } from "fs/promises";
|
|
7
|
+
import _fsExtra from "fs-extra";
|
|
8
|
+
const { outputFile } = _fsExtra;
|
|
7
9
|
import * as path from "path";
|
|
8
10
|
import { Platform } from "../core.js";
|
|
9
11
|
import { createUpdateInfoTasks, writeUpdateInfoFiles } from "./updateInfoBuilder.js";
|
|
10
12
|
import { resolveModule } from "../util/resolve.js";
|
|
11
13
|
import { parseUrl } from "../util/pathManager.js";
|
|
12
14
|
import { isPublishForPullRequest } from "../util/flags.js";
|
|
13
|
-
const publishForPrWarning = "There are serious security concerns with PUBLISH_FOR_PULL_REQUEST=true (see the CircleCI documentation (https://circleci.com/docs/
|
|
15
|
+
const publishForPrWarning = "There are serious security concerns with PUBLISH_FOR_PULL_REQUEST=true (see the CircleCI documentation (https://circleci.com/docs/guides/integration/oss/#pass-secrets-to-builds-from-forked-pull-requests) for details)" +
|
|
14
16
|
"\nIf you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you.";
|
|
15
17
|
const debug = _debug("electron-builder:publish");
|
|
16
18
|
function checkOptions(publishPolicy) {
|
|
@@ -20,6 +22,64 @@ function checkOptions(publishPolicy) {
|
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
}
|
|
25
|
+
/** Emitted once per feed (the url without its query) per process — app-update.yml is written for every pack, and platforms may use different feeds. */
|
|
26
|
+
const feedQueryWarnedFeeds = new Set();
|
|
27
|
+
/**
|
|
28
|
+
* electron-updater 7 adds the query string of a generic feed url (typically a token), like the credential headers, only to
|
|
29
|
+
* downloads on the feed's origin. An app whose latest*.yml points downloads at another origin that relies on that query gets
|
|
30
|
+
* 401/403 at update time, inside a shipped app, with nothing at build time saying why — `migrate-schema` prints the same advisory,
|
|
31
|
+
* but cannot be relied on to have been run. Only the query parameter names are logged, never the url or the values.
|
|
32
|
+
*
|
|
33
|
+
* @internal exported for tests
|
|
34
|
+
*/
|
|
35
|
+
export function warnAboutGenericFeedQuery(publishConfig) {
|
|
36
|
+
const url = publishConfig.provider === "generic" ? publishConfig.url : null;
|
|
37
|
+
const queryStart = typeof url === "string" ? url.indexOf("?") : -1;
|
|
38
|
+
if (queryStart < 0) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const feed = url.slice(0, queryStart);
|
|
42
|
+
if (feedQueryWarnedFeeds.has(feed)) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
feedQueryWarnedFeeds.add(feed);
|
|
46
|
+
const queryParameters = [...new Set(new URLSearchParams(url.slice(queryStart + 1).split("#")[0]).keys())];
|
|
47
|
+
log.warn({
|
|
48
|
+
queryParameters: queryParameters.length === 0 ? "(none)" : queryParameters.join(", "),
|
|
49
|
+
solution: "serve the update files from the feed origin (relative files[].url, the default) or use pre-signed URLs",
|
|
50
|
+
}, "the generic publish url has a query string. electron-updater 7 (electron-builder v27) adds it, and sends the credential headers from requestHeaders / addAuthHeader, " +
|
|
51
|
+
"only to downloads on the feed's origin (scheme, host and port): a download url in latest*.yml on another origin is requested without them. " +
|
|
52
|
+
"Nothing changes for the relative URLs electron-builder writes. " +
|
|
53
|
+
"See https://www.electron.build/docs/migration/v27-breaking-changes#update-credentials-stay-on-the-feeds-origin");
|
|
54
|
+
}
|
|
55
|
+
/** @internal exported for tests — re-arms the once-per-feed warning. */
|
|
56
|
+
export function resetGenericFeedQueryWarning() {
|
|
57
|
+
feedQueryWarnedFeeds.clear();
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* v26 published implicitly when it detected a CI tag; v27 requires an explicit `--publish` policy.
|
|
61
|
+
* Without a signal, a tagged release pipeline goes green and uploads nothing — the build looks
|
|
62
|
+
* identical to a successful publish. Only warns when the project actually looks like it wanted to
|
|
63
|
+
* publish (a tag is present and a publish target is configured), so ordinary local builds stay quiet.
|
|
64
|
+
*/
|
|
65
|
+
function warnIfImplicitPublishExpected(packager) {
|
|
66
|
+
const tag = getCiTag();
|
|
67
|
+
if (tag == null) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const config = packager.config;
|
|
71
|
+
const hasPublishConfig = config.publish != null ||
|
|
72
|
+
["mac", "win", "linux"].some(platform => {
|
|
73
|
+
const platformConfig = config[platform];
|
|
74
|
+
return platformConfig != null && platformConfig.publish != null;
|
|
75
|
+
});
|
|
76
|
+
if (!hasPublishConfig) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
log.warn({ tag, solution: "pass --publish <always|onTag|onTagOrDraft|never>, or set the `publish` policy in your build configuration" }, "a publish configuration and a CI tag are present, but no publish policy was given — nothing will be uploaded. " +
|
|
80
|
+
"electron-builder v27 removed implicit publishing (v26 auto-published when it detected a CI tag). " +
|
|
81
|
+
"See https://www.electron.build/docs/migration/v27-breaking-changes#implicit-publish-removed");
|
|
82
|
+
}
|
|
23
83
|
export class PublishManager {
|
|
24
84
|
constructor(packager, publishOptions, cancellationToken = packager.cancellationToken) {
|
|
25
85
|
this.packager = packager;
|
|
@@ -38,6 +98,9 @@ export class PublishManager {
|
|
|
38
98
|
if (this.isPublish && forcePublishForPr) {
|
|
39
99
|
log.warn(publishForPrWarning);
|
|
40
100
|
}
|
|
101
|
+
if (publishPolicy == null) {
|
|
102
|
+
warnIfImplicitPublishExpected(packager);
|
|
103
|
+
}
|
|
41
104
|
}
|
|
42
105
|
else if (publishOptions.publish !== "never") {
|
|
43
106
|
log.info({
|
|
@@ -45,6 +108,7 @@ export class PublishManager {
|
|
|
45
108
|
solution: `set env PUBLISH_FOR_PULL_REQUEST to true to force code signing\n${publishForPrWarning}`,
|
|
46
109
|
}, "publishing will be skipped");
|
|
47
110
|
}
|
|
111
|
+
packager.onTargetsCreated(plan => this.requireSigningKeysForPlannedTargets(plan));
|
|
48
112
|
packager.onAfterPack(async (event) => {
|
|
49
113
|
const packager = event.packager;
|
|
50
114
|
if (event.electronPlatformName === "darwin") {
|
|
@@ -57,9 +121,20 @@ export class PublishManager {
|
|
|
57
121
|
return;
|
|
58
122
|
}
|
|
59
123
|
}
|
|
60
|
-
|
|
124
|
+
// app-update.yml is written for every pack, from the publish settings of the pack's targets that emit a manifest
|
|
125
|
+
// (see resolvePackAppUpdatePublishConfigs) - so a manifest signed under a target-level `publish` always ships with
|
|
126
|
+
// the key that verifies it, except when the pack's targets disagree about the feed (an error when publishing, a
|
|
127
|
+
// warning and no app-update.yml otherwise). The signing requirement (the error when publishing, the advisory
|
|
128
|
+
// otherwise) only applies when a target emits a manifest - the same per-target resolution as the build-start
|
|
129
|
+
// preflight. A snap-, flatpak- or mas-only pack has none (Linux and mas are not filtered above), nor has an
|
|
130
|
+
// installer whose target-level `publish` is `null` or waived.
|
|
131
|
+
const { publishConfigs, emitsManifest } = await resolvePackAppUpdatePublishConfigs(packager, event.targets, event.arch, this.isPublish);
|
|
132
|
+
if (emitsManifest) {
|
|
133
|
+
await packager.requireUpdateSigningKeys(this.isPublish);
|
|
134
|
+
}
|
|
135
|
+
const publishConfig = await createAppUpdateConfiguration(packager, publishConfigs, this.isPublish, false);
|
|
61
136
|
if (publishConfig != null) {
|
|
62
|
-
await
|
|
137
|
+
await writeAppUpdateYaml(packager.getResourcesDir(event.appOutDir), publishConfig);
|
|
63
138
|
}
|
|
64
139
|
});
|
|
65
140
|
packager.onArtifactCreated(async (event) => {
|
|
@@ -75,6 +150,30 @@ export class PublishManager {
|
|
|
75
150
|
}
|
|
76
151
|
});
|
|
77
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Build-start preflight: enforces update-manifest signing for every target of every platform and arch that will
|
|
155
|
+
* emit update info, before anything is packed. The per-artifact check in artifactCreatedWithoutExplicitPublishConfig
|
|
156
|
+
* only stops that artifact's own upload; by then an earlier target (a portable exe, another arch, another platform)
|
|
157
|
+
* may already be uploading. Same resolution as the per-artifact path - target-level `publish` first, `null` means
|
|
158
|
+
* none, `publishAutoUpdate: false` on every provider waives it - which stays in place for targets that do not
|
|
159
|
+
* declare `writesUpdateInfo`. Each planned platform x arch is one pack, so targets of a pack that disagree about the
|
|
160
|
+
* app-update.yml feed fail here too, before anything is packed (also for a prepackaged app, which has no afterPack).
|
|
161
|
+
*/
|
|
162
|
+
async requireSigningKeysForPlannedTargets(plan) {
|
|
163
|
+
if (!this.isPublish) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
for (const { packager, arch, targets } of plan) {
|
|
167
|
+
// resolving publish configs is async: a build cancelled meanwhile stops instead of failing on a missing key
|
|
168
|
+
if (this.cancellationToken.cancelled) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const { emitsManifest } = await resolvePackAppUpdatePublishConfigs(packager, targets, arch, true);
|
|
172
|
+
if (emitsManifest && !this.cancellationToken.cancelled) {
|
|
173
|
+
await packager.requireUpdateSigningKeys(true);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
78
177
|
getAppInfo(platformPackager) {
|
|
79
178
|
return platformPackager == null ? this.packager.appInfo : platformPackager.appInfo;
|
|
80
179
|
}
|
|
@@ -119,7 +218,17 @@ export class PublishManager {
|
|
|
119
218
|
}
|
|
120
219
|
return;
|
|
121
220
|
}
|
|
221
|
+
const writesUpdateInfo = event.isWriteUpdateInfo === true && target != null && eventFile != null && (platformPackager.platform !== Platform.WINDOWS || isSuitableWindowsTarget(target));
|
|
122
222
|
if (this.isPublish) {
|
|
223
|
+
// Enforce the signing requirement before this artifact is uploaded, not only in writeUpdateInfoFiles, which runs
|
|
224
|
+
// after every upload has been awaited. The build-start preflight and onAfterPack already fail early for targets
|
|
225
|
+
// that declare `writesUpdateInfo`; this also covers a custom target that emits update info without declaring it.
|
|
226
|
+
if (writesUpdateInfo) {
|
|
227
|
+
const updateInfoConfigs = await getPublishConfigsForUpdateInfo(platformPackager, publishConfigs, event.arch);
|
|
228
|
+
if (updateInfoConfigs?.some(it => it.publishAutoUpdate !== false)) {
|
|
229
|
+
await platformPackager.requireUpdateSigningKeys(true);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
123
232
|
for (const publishConfig of publishConfigs) {
|
|
124
233
|
if (this.cancellationToken.cancelled) {
|
|
125
234
|
log.debug({ file: event.file, reason: "cancelled" }, "not published");
|
|
@@ -128,22 +237,25 @@ export class PublishManager {
|
|
|
128
237
|
await this.scheduleUpload(publishConfig, event, this.getAppInfo(platformPackager));
|
|
129
238
|
}
|
|
130
239
|
}
|
|
131
|
-
if (
|
|
132
|
-
target != null &&
|
|
133
|
-
eventFile != null &&
|
|
134
|
-
!this.cancellationToken.cancelled &&
|
|
135
|
-
(platformPackager.platform !== Platform.WINDOWS || isSuitableWindowsTarget(target))) {
|
|
240
|
+
if (writesUpdateInfo && !this.cancellationToken.cancelled) {
|
|
136
241
|
this.taskManager.addTask(createUpdateInfoTasks(event, publishConfigs).then(it => this.updateFileWriteTask.push(...it)));
|
|
137
242
|
}
|
|
138
243
|
}
|
|
139
|
-
|
|
244
|
+
getOrCreatePublisher(publishConfig, appInfo) {
|
|
140
245
|
// to not include token into cache key
|
|
141
246
|
const providerCacheKey = safeStringifyJson(publishConfig);
|
|
142
247
|
let publisher = this.nameToPublisher.get(providerCacheKey);
|
|
143
248
|
if (publisher == null) {
|
|
144
|
-
publisher =
|
|
249
|
+
publisher = createPublisher(this, appInfo.version, publishConfig, this.publishOptions, this.packager).then(it => {
|
|
250
|
+
if (it != null) {
|
|
251
|
+
log.info({ publisher: it.toString() }, "publishing");
|
|
252
|
+
}
|
|
253
|
+
return it;
|
|
254
|
+
});
|
|
255
|
+
// cache the pending promise synchronously — concurrent scheduleUpload calls must share one publisher (and thus one release) instead of racing to create duplicates
|
|
145
256
|
this.nameToPublisher.set(providerCacheKey, publisher);
|
|
146
|
-
|
|
257
|
+
// on failure, evict so that a subsequent call can retry (the rejection still propagates to the caller)
|
|
258
|
+
publisher.catch(() => this.nameToPublisher.delete(providerCacheKey));
|
|
147
259
|
}
|
|
148
260
|
return publisher;
|
|
149
261
|
}
|
|
@@ -158,12 +270,136 @@ export class PublishManager {
|
|
|
158
270
|
if (this.cancellationToken.cancelled || updateInfoFileTasks.length === 0) {
|
|
159
271
|
return;
|
|
160
272
|
}
|
|
161
|
-
await writeUpdateInfoFiles(updateInfoFileTasks, this.packager);
|
|
273
|
+
await writeUpdateInfoFiles(updateInfoFileTasks, this.packager, this.isPublish);
|
|
162
274
|
await this.taskManager.awaitTasks();
|
|
163
275
|
}
|
|
164
276
|
}
|
|
165
|
-
|
|
166
|
-
|
|
277
|
+
/**
|
|
278
|
+
* The `app-update.yml` config for a single target with the given target-specific options (`null` for none): the
|
|
279
|
+
* target's own publish settings when it emits a manifest under them, otherwise the platform/root ones - the rule of
|
|
280
|
+
* {@link getPackAppUpdatePublishConfiguration} for a pack of one target.
|
|
281
|
+
*/
|
|
282
|
+
export async function getAppUpdatePublishConfiguration(packager, targetSpecificOptions, arch,
|
|
283
|
+
/**
|
|
284
|
+
* Whether this is the publish path. Gates both publish-credential resolution and the update-manifest signing
|
|
285
|
+
* requirement. The Linux targets that write `app-update.yml` into the package pass `false`, since for them
|
|
286
|
+
* "validation will be done on publish step" - and that is exactly when signing is enforced too.
|
|
287
|
+
*/
|
|
288
|
+
isPublish,
|
|
289
|
+
/**
|
|
290
|
+
* Set when the caller has already applied the signing requirement for the targets this config is embedded for;
|
|
291
|
+
* the configs resolved here then only decide the embedded trust list, and neither enforce nor warn.
|
|
292
|
+
*/
|
|
293
|
+
signingRequirementApplied = false) {
|
|
294
|
+
const own = await getEmittingUpdateInfoPublishConfigs(packager, targetSpecificOptions, arch, isPublish);
|
|
295
|
+
const publishConfigs = own ?? (await getPlatformUpdateInfoPublishConfigs(packager, arch, isPublish));
|
|
296
|
+
return await createAppUpdateConfiguration(packager, publishConfigs, isPublish, own != null && !signingRequirementApplied);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* The `app-update.yml` config of a packed app dir, which every target built from it ships: see
|
|
300
|
+
* {@link resolvePackAppUpdatePublishConfigs}. Used by the targets that (re)write the file themselves (AppImage,
|
|
301
|
+
* deb/rpm/pacman), so they embed the same feed as PublishManager's afterPack handler - or, for a prepackaged app, any
|
|
302
|
+
* feed at all - and do not race each other with different content.
|
|
303
|
+
*/
|
|
304
|
+
export async function getPackAppUpdatePublishConfiguration(packager, targets, arch, isPublish) {
|
|
305
|
+
const { publishConfigs, emitsManifest } = await resolvePackAppUpdatePublishConfigs(packager, targets, arch, isPublish);
|
|
306
|
+
return await createAppUpdateConfiguration(packager, publishConfigs, isPublish, emitsManifest);
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* The publish configs whose first provider becomes the `app-update.yml` shared by all targets of one pack (for a
|
|
310
|
+
* manifest-emitting target, the first provider that receives its manifest - see getEmittingUpdateInfoPublishConfigs):
|
|
311
|
+
*
|
|
312
|
+
* - the targets that emit a manifest (`writesUpdateInfo`, and on Windows an electron-updater-aware one) under their
|
|
313
|
+
* own effective publish settings - target-level `publish` first, then platform, then root - decide it;
|
|
314
|
+
* - if several do, their first providers must be the same feed ({@link appUpdateFeedIdentity}: publish-only options
|
|
315
|
+
* may differ): one app dir holds one `app-update.yml`, so otherwise some installs would poll a feed that never
|
|
316
|
+
* receives their manifest. That is a configuration error;
|
|
317
|
+
* - with none (a snap-only pack, or `nsis.publish: null`), it comes from the platform/root settings, as before -
|
|
318
|
+
* including the GitHub fallback from repository info when no level configures `publish` at all.
|
|
319
|
+
*
|
|
320
|
+
* `emitsManifest` tells whether any target of the pack emits one, i.e. whether the signing requirement applies.
|
|
321
|
+
*/
|
|
322
|
+
async function resolvePackAppUpdatePublishConfigs(packager, targets, arch, isPublish) {
|
|
323
|
+
const writers = [];
|
|
324
|
+
for (const target of targets) {
|
|
325
|
+
const publishConfigs = await getTargetManifestPublishConfigs(packager, target, arch, isPublish);
|
|
326
|
+
if (publishConfigs != null) {
|
|
327
|
+
writers.push({ target, publishConfigs });
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
if (writers.length === 0) {
|
|
331
|
+
return { publishConfigs: await getPlatformUpdateInfoPublishConfigs(packager, arch, isPublish), emitsManifest: false };
|
|
332
|
+
}
|
|
333
|
+
const embedded = appUpdateFeedIdentity(writers[0].publishConfigs[0]);
|
|
334
|
+
if (writers.some(it => appUpdateFeedIdentity(it.publishConfigs[0]) !== embedded)) {
|
|
335
|
+
reportConflictingAppUpdateFeeds(packager, writers, arch, isPublish);
|
|
336
|
+
// not publishing: no app-update.yml, the same package the error would have prevented - picking one of the feeds
|
|
337
|
+
// would silently ship installs that poll a feed without their manifest
|
|
338
|
+
return { publishConfigs: null, emitsManifest: true };
|
|
339
|
+
}
|
|
340
|
+
return { publishConfigs: writers[0].publishConfigs, emitsManifest: true };
|
|
341
|
+
}
|
|
342
|
+
// keyed by platform packager (one per platform and build): afterPack and the targets writing app-update.yml themselves
|
|
343
|
+
// resolve the same pack, and every arch usually repeats the same conflict - report each one once
|
|
344
|
+
const reportedFeedConflicts = new WeakMap();
|
|
345
|
+
/**
|
|
346
|
+
* Targets of one pack resolve different app-update.yml feeds: an InvalidConfigurationError when publishing, otherwise
|
|
347
|
+
* a warning that says so, so the misconfiguration surfaces before a release is built with it.
|
|
348
|
+
*/
|
|
349
|
+
function reportConflictingAppUpdateFeeds(packager, writers, arch, isPublish) {
|
|
350
|
+
const targets = writers.map(it => `"${it.target.name}"`).join(", ");
|
|
351
|
+
const feeds = writers.map(it => `${it.target.name} -> ${it.publishConfigs[0]?.provider ?? "none"}`).join(", ");
|
|
352
|
+
const problem = `targets ${targets} are built from the same ${packager.platform.name} ${Arch[arch]} app, which holds a single app-update.yml, ` +
|
|
353
|
+
`but their publish settings resolve to different auto-update feeds (${feeds}; the first provider of each that receives the manifest is embedded)`;
|
|
354
|
+
const solution = `configure \`publish\` once at the platform level (\`${packager.platform.buildConfigurationKey}.publish\`) and remove the target-level overrides, or point their first providers at the same feed`;
|
|
355
|
+
if (isPublish) {
|
|
356
|
+
throw new InvalidConfigurationError(`${problem}. To fix it, ${solution}.`);
|
|
357
|
+
}
|
|
358
|
+
let reported = reportedFeedConflicts.get(packager);
|
|
359
|
+
if (reported == null) {
|
|
360
|
+
reported = new Set();
|
|
361
|
+
reportedFeedConflicts.set(packager, reported);
|
|
362
|
+
}
|
|
363
|
+
if (reported.has(feeds)) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
reported.add(feeds);
|
|
367
|
+
log.warn({ solution }, `${problem}. No app-update.yml is written, so installed apps get neither an update feed nor the update-manifest public key. ` +
|
|
368
|
+
"Publishing this configuration fails with an InvalidConfigurationError.");
|
|
369
|
+
}
|
|
370
|
+
// Options that only the publisher reads (the upload itself), never electron-updater, so they cannot make two otherwise
|
|
371
|
+
// identical first providers different feeds. Everything else is compared - including fields of custom providers and
|
|
372
|
+
// options such as `requestHeaders`, `token` or `private` that change how or whether the updater can read the feed.
|
|
373
|
+
const PUBLISH_ONLY_OPTIONS = new Set(["publishAutoUpdate", "timeout"]);
|
|
374
|
+
const S3_PUBLISH_ONLY_OPTIONS = new Set(["acl", "storageClass", "encryption"]);
|
|
375
|
+
/**
|
|
376
|
+
* What makes two first providers the same app-update.yml feed: the provider and every option that decides where, or
|
|
377
|
+
* how, electron-updater reads the manifest (url, bucket, region, path, owner, repo, channel, ...). Publish-only options
|
|
378
|
+
* and unset (nullish) values are left out, and key order does not matter - so `publishAutoUpdate: true` against an
|
|
379
|
+
* absent flag is the same feed, a different url or bucket is not.
|
|
380
|
+
*/
|
|
381
|
+
function appUpdateFeedIdentity(config) {
|
|
382
|
+
if (config == null) {
|
|
383
|
+
return "null";
|
|
384
|
+
}
|
|
385
|
+
const isS3Like = config.provider === "s3" || config.provider === "spaces" || config.provider === "r2";
|
|
386
|
+
const identity = Object.fromEntries(Object.entries(config).filter(([key, value]) => value != null && !PUBLISH_ONLY_OPTIONS.has(key) && !(isS3Like && S3_PUBLISH_ONLY_OPTIONS.has(key))));
|
|
387
|
+
// key order does not make two configs different feeds
|
|
388
|
+
return JSON.stringify(identity, (_key, value) => value != null && typeof value === "object" && !Array.isArray(value)
|
|
389
|
+
? Object.fromEntries(Object.keys(value)
|
|
390
|
+
.sort()
|
|
391
|
+
.map(key => [key, value[key]]))
|
|
392
|
+
: value);
|
|
393
|
+
}
|
|
394
|
+
async function getPlatformUpdateInfoPublishConfigs(packager, arch, isPublish) {
|
|
395
|
+
return await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, null, arch, isPublish), arch);
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* The embedded `app-update.yml` config (first provider, updater cache dir, Windows publisher name, manifest trust
|
|
399
|
+
* list) for already-resolved publish configs. `requireSigning` applies the update-manifest signing requirement
|
|
400
|
+
* (error when publishing, advisory otherwise) before the trust list is derived.
|
|
401
|
+
*/
|
|
402
|
+
async function createAppUpdateConfiguration(packager, publishConfigs, isPublish, requireSigning) {
|
|
167
403
|
if (publishConfigs == null || publishConfigs.length === 0) {
|
|
168
404
|
return null;
|
|
169
405
|
}
|
|
@@ -171,6 +407,7 @@ export async function getAppUpdatePublishConfiguration(packager, targetSpecificO
|
|
|
171
407
|
...publishConfigs[0],
|
|
172
408
|
updaterCacheDirName: packager.appInfo.updaterCacheDirName,
|
|
173
409
|
};
|
|
410
|
+
warnAboutGenericFeedQuery(publishConfig);
|
|
174
411
|
if (packager.platform === Platform.WINDOWS && publishConfig.publisherName == null) {
|
|
175
412
|
const winPackager = packager;
|
|
176
413
|
const publisherName = winPackager.isForceCodeSigningVerification ? await (await winPackager.signingManager.value).computedPublisherName.value : undefined;
|
|
@@ -178,8 +415,67 @@ export async function getAppUpdatePublishConfiguration(packager, targetSpecificO
|
|
|
178
415
|
publishConfig.publisherName = publisherName;
|
|
179
416
|
}
|
|
180
417
|
}
|
|
418
|
+
// Embed the update-manifest trust list so the updater can verify signed manifests. An explicit
|
|
419
|
+
// `publicKey` list wins as-is; otherwise the public half of every configured signing key is derived
|
|
420
|
+
// so the user only manages the secrets. One key is written as a plain string (byte-identical to the
|
|
421
|
+
// single-key format), several as a YAML list.
|
|
422
|
+
const updateManifestConfig = packager.updateManifestOptions;
|
|
423
|
+
// `updateManifestPublicKey` is only ever assigned right below, on this fresh copy, so a value that is
|
|
424
|
+
// already present can only have come from the user's `publish` configuration. Rejecting it (rather than
|
|
425
|
+
// taking it as-is) keeps the trust list on the single validated path and stops a stale hand-copied key
|
|
426
|
+
// from silently shadowing the derived one.
|
|
427
|
+
if (publishConfig.updateManifestPublicKey != null) {
|
|
428
|
+
throw new InvalidConfigurationError("publish.updateManifestPublicKey is managed by electron-builder and must not be set; configure updateManifest.publicKey instead");
|
|
429
|
+
}
|
|
430
|
+
// The very same keys updateInfoBuilder signs `latest*.yml` with, so env-var-only signing
|
|
431
|
+
// (no `updateManifest` config block) embeds the matching public keys too, and the two sides
|
|
432
|
+
// cannot disagree about whether signing is enabled.
|
|
433
|
+
// Whether the requirement applies was decided by the caller from the manifest-emitting targets (a publish target
|
|
434
|
+
// with `publishAutoUpdate: false` on every provider emits none, so it is waived there) - the trust list is still
|
|
435
|
+
// embedded if keys happen to be configured. Only app-update.yml is limited to the first provider:
|
|
436
|
+
// createUpdateInfoTasks writes a manifest for every configured one, so the waiver must hold for all of them.
|
|
437
|
+
const signingKeys = requireSigning ? await packager.requireUpdateSigningKeys(isPublish) : await packager.updateSigningKeys.value;
|
|
438
|
+
// `false` is the opt-out and carries no config object to read `publicKey` from
|
|
439
|
+
const explicitKeys = updateManifestConfig === false ? [] : normalizeExplicitPublicKeys(updateManifestConfig?.publicKey);
|
|
440
|
+
const trustedKeys = explicitKeys.length > 0 ? explicitKeys : signingKeys.map(derivePublicKeyPem);
|
|
441
|
+
if (trustedKeys.length > 0) {
|
|
442
|
+
publishConfig.updateManifestPublicKey = trustedKeys.length === 1 ? trustedKeys[0] : trustedKeys;
|
|
443
|
+
}
|
|
444
|
+
if (signingKeys.length > 0 && explicitKeys.length > 0) {
|
|
445
|
+
const trustedIds = new Set(trustedKeys.map(computeUpdateManifestKeyId));
|
|
446
|
+
if (!signingKeys.some(key => trustedIds.has(computeUpdateManifestKeyId(key)))) {
|
|
447
|
+
log.warn({ platform: packager.platform.name, trustedKeys: trustedKeys.length }, "none of the update-manifest signing keys is in updateManifest.publicKey: installs of this release will not be able to verify manifests signed with the current key(s). " +
|
|
448
|
+
"Intended only for a deliberate bridge release; otherwise add the current public key to updateManifest.publicKey.");
|
|
449
|
+
}
|
|
450
|
+
}
|
|
181
451
|
return publishConfig;
|
|
182
452
|
}
|
|
453
|
+
/**
|
|
454
|
+
* Normalizes the configured `updateManifest.publicKey` (string, multi-PEM string, or array) into distinct,
|
|
455
|
+
* validated Ed25519 public keys, preserving order. Duplicates and non-Ed25519 keys are configuration errors.
|
|
456
|
+
*/
|
|
457
|
+
function normalizeExplicitPublicKeys(value) {
|
|
458
|
+
const keys = normalizePublicKeyList(value);
|
|
459
|
+
const seen = new Map();
|
|
460
|
+
keys.forEach((key, index) => {
|
|
461
|
+
let keyId;
|
|
462
|
+
try {
|
|
463
|
+
keyId = computeUpdateManifestKeyId(key);
|
|
464
|
+
}
|
|
465
|
+
catch (e) {
|
|
466
|
+
throw new InvalidConfigurationError(`updateManifest.publicKey #${index + 1} is not a valid Ed25519 public key: ${e.message || e}`);
|
|
467
|
+
}
|
|
468
|
+
const previous = seen.get(keyId);
|
|
469
|
+
if (previous != null) {
|
|
470
|
+
throw new InvalidConfigurationError(`updateManifest.publicKey #${index + 1} duplicates entry #${previous + 1} (key id ${keyId}). List each trusted key once.`);
|
|
471
|
+
}
|
|
472
|
+
seen.set(keyId, index);
|
|
473
|
+
});
|
|
474
|
+
return keys;
|
|
475
|
+
}
|
|
476
|
+
export async function writeAppUpdateYaml(resourcesDir, publishConfig) {
|
|
477
|
+
await outputFile(path.join(resourcesDir, "app-update.yml"), serializeToYaml(publishConfig));
|
|
478
|
+
}
|
|
183
479
|
export async function getPublishConfigsForUpdateInfo(packager, publishConfigs, arch) {
|
|
184
480
|
if (publishConfigs === null) {
|
|
185
481
|
return null;
|
|
@@ -265,6 +561,8 @@ async function requireProviderClass(provider, packager) {
|
|
|
265
561
|
return SnapStorePublisher;
|
|
266
562
|
case "spaces":
|
|
267
563
|
return SpacesPublisher;
|
|
564
|
+
case "r2":
|
|
565
|
+
return R2Publisher;
|
|
268
566
|
case "bitbucket":
|
|
269
567
|
return BitbucketPublisher;
|
|
270
568
|
default: {
|
|
@@ -361,6 +659,29 @@ async function resolvePublishConfigurations(publishers, platformPackager, arch,
|
|
|
361
659
|
debug(`Explicit publish provider: ${safeStringifyJson(publishers)}`);
|
|
362
660
|
return (await Promise.all(asArray(publishers).map(it => getResolvedPublishConfig(platformPackager, typeof it === "string" ? { provider: it } : it, arch, errorIfCannot, fallbackPackager))));
|
|
363
661
|
}
|
|
662
|
+
/**
|
|
663
|
+
* The update-info publish configs `target` emits an auto-update manifest for under its own effective publish settings,
|
|
664
|
+
* else `null`: target-level `publish` first, `null` means none, and `publishAutoUpdate: false` on every provider means
|
|
665
|
+
* no manifest.
|
|
666
|
+
*/
|
|
667
|
+
async function getTargetManifestPublishConfigs(packager, target, arch, errorIfCannot) {
|
|
668
|
+
if (!target.writesUpdateInfo || (packager.platform === Platform.WINDOWS && !isSuitableWindowsTarget(target))) {
|
|
669
|
+
return null;
|
|
670
|
+
}
|
|
671
|
+
return await getEmittingUpdateInfoPublishConfigs(packager, target.options, arch, errorIfCannot);
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* The update-info publish configs that receive a manifest, resolved for the given target-specific options (target,
|
|
675
|
+
* then platform, then root; GitHub from repository info when none configures `publish`), or `null` when they emit
|
|
676
|
+
* none: `publish: null`, or `publishAutoUpdate: false` on every provider. Providers with `publishAutoUpdate: false`
|
|
677
|
+
* are left out - writeUpdateInfoFiles writes no `latest*.yml` for them - so the first provider, the one embedded in
|
|
678
|
+
* app-update.yml, is always one the manifest is uploaded to.
|
|
679
|
+
*/
|
|
680
|
+
async function getEmittingUpdateInfoPublishConfigs(packager, targetSpecificOptions, arch, errorIfCannot) {
|
|
681
|
+
const updateInfoConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, targetSpecificOptions, arch, errorIfCannot), arch);
|
|
682
|
+
const emitting = updateInfoConfigs?.filter(it => it.publishAutoUpdate !== false) ?? [];
|
|
683
|
+
return emitting.length === 0 ? null : emitting;
|
|
684
|
+
}
|
|
364
685
|
function isSuitableWindowsTarget(target) {
|
|
365
686
|
if (target.name === "appx" && target.options != null && target.options.electronUpdaterAware) {
|
|
366
687
|
return true;
|
|
@@ -383,6 +704,44 @@ function isDetectUpdateChannel(platformSpecificConfiguration, configuration) {
|
|
|
383
704
|
const value = platformSpecificConfiguration == null ? null : platformSpecificConfiguration.detectUpdateChannel;
|
|
384
705
|
return value == null ? configuration.detectUpdateChannel !== false : value;
|
|
385
706
|
}
|
|
707
|
+
// keyed by the build's CancellationToken (one instance per Packager) so that a build reports a given feed once - getResolvedPublishConfig
|
|
708
|
+
// is called per target and arch - without leaking state between programmatic builds running in the same process
|
|
709
|
+
const reportedInferredUpdateFeeds = new WeakMap();
|
|
710
|
+
/** @internal */
|
|
711
|
+
export function parseGithubRepoShorthand(repo) {
|
|
712
|
+
const separator = repo.indexOf("/");
|
|
713
|
+
return separator > 0 ? { owner: repo.substring(0, separator), repo: repo.substring(separator + 1) } : null;
|
|
714
|
+
}
|
|
715
|
+
// the inferred repository becomes the publish/update destination and, for auto-update-capable targets, is written
|
|
716
|
+
// verbatim into app-update.yml inside every shipped build as its permanent update feed - so the developer has to be
|
|
717
|
+
// told which repository they are committing to. A repository taken from package.json "repository" is deliberate
|
|
718
|
+
// configuration (info); one picked up from the CI environment or .git/config is not (warn).
|
|
719
|
+
function logInferredUpdateFeed(buildId, provider, owner, project, source, inferredFields) {
|
|
720
|
+
let reported = reportedInferredUpdateFeeds.get(buildId);
|
|
721
|
+
if (reported == null) {
|
|
722
|
+
reported = new Set();
|
|
723
|
+
reportedInferredUpdateFeeds.set(buildId, reported);
|
|
724
|
+
}
|
|
725
|
+
const feed = `${provider}:${owner}/${project}`;
|
|
726
|
+
if (reported.has(feed)) {
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
reported.add(feed);
|
|
730
|
+
const fields = {
|
|
731
|
+
reason: `${inferredFields.join(" and ")} not specified in the publish configuration`,
|
|
732
|
+
source: source ?? "unknown",
|
|
733
|
+
provider,
|
|
734
|
+
owner,
|
|
735
|
+
...(provider === "bitbucket" ? { slug: project } : { repo: project }),
|
|
736
|
+
};
|
|
737
|
+
const message = "update feed inferred from repository info; it will be used as the publish/update destination (written to app-update.yml in auto-update-capable targets) - specify it explicitly to be sure it stays under your control";
|
|
738
|
+
if (source === "package.json") {
|
|
739
|
+
log.info(fields, message);
|
|
740
|
+
}
|
|
741
|
+
else {
|
|
742
|
+
log.warn(fields, message);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
386
745
|
async function getResolvedPublishConfig(platformPackager, options, arch, errorIfCannot, fallbackPackager) {
|
|
387
746
|
options = { ...options };
|
|
388
747
|
expandPublishConfig(options, platformPackager, arch);
|
|
@@ -421,11 +780,10 @@ async function getResolvedPublishConfig(platformPackager, options, arch, errorIf
|
|
|
421
780
|
let owner = isGithub ? options.owner : options.owner;
|
|
422
781
|
let project = isGithub ? options.repo : options.slug;
|
|
423
782
|
if (isGithub && owner == null && project != null) {
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
|
|
427
|
-
project = repo
|
|
428
|
-
owner = repo.substring(index + 1);
|
|
783
|
+
const shorthand = parseGithubRepoShorthand(project);
|
|
784
|
+
if (shorthand != null) {
|
|
785
|
+
owner = shorthand.owner;
|
|
786
|
+
project = shorthand.repo;
|
|
429
787
|
}
|
|
430
788
|
}
|
|
431
789
|
async function getInfo() {
|
|
@@ -448,22 +806,28 @@ async function getResolvedPublishConfig(platformPackager, options, arch, errorIf
|
|
|
448
806
|
if (info == null) {
|
|
449
807
|
return null;
|
|
450
808
|
}
|
|
809
|
+
const inferredFields = [];
|
|
451
810
|
if (!owner) {
|
|
452
811
|
owner = info.user;
|
|
812
|
+
inferredFields.push("owner");
|
|
453
813
|
}
|
|
454
814
|
if (!project) {
|
|
455
815
|
project = info.project;
|
|
816
|
+
inferredFields.push(isGithub ? "repo" : "slug");
|
|
456
817
|
}
|
|
818
|
+
logInferredUpdateFeed(ctx.cancellationToken, provider, owner, project, info.source, inferredFields);
|
|
457
819
|
}
|
|
458
820
|
if (isGithub) {
|
|
459
821
|
if (options.token != null && !options.private) {
|
|
460
822
|
log.warn('"token" specified in the github publish options. It should be used only for [setFeedURL](module:electron-updater/out/AppUpdater.AppUpdater+setFeedURL).');
|
|
461
823
|
}
|
|
462
824
|
//tslint:disable-next-line:no-object-literal-type-assertion
|
|
825
|
+
// oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- required by the TS 5.1 that typescript-json-schema bundles (pnpm generate:schema)
|
|
463
826
|
return { owner, repo: project, ...options };
|
|
464
827
|
}
|
|
465
828
|
else {
|
|
466
829
|
//tslint:disable-next-line:no-object-literal-type-assertion
|
|
830
|
+
// oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- required by the TS 5.1 that typescript-json-schema bundles (pnpm generate:schema)
|
|
467
831
|
return { owner, slug: project, ...options };
|
|
468
832
|
}
|
|
469
833
|
}
|