app-builder-lib 27.0.0-alpha.1 → 27.0.0-alpha.11
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/asarAlign.d.ts +35 -0
- package/dist/asar/asarAlign.d.ts.map +1 -0
- package/dist/asar/asarAlign.js +149 -0
- package/dist/asar/asarAlign.js.map +1 -0
- 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.d.ts +15 -1
- package/dist/asar/asarUtil.d.ts.map +1 -1
- package/dist/asar/asarUtil.js +132 -72
- 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 +233 -166
- 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 +55 -3
- package/dist/fileMatcher.d.ts.map +1 -1
- package/dist/fileMatcher.js +274 -28
- package/dist/fileMatcher.js.map +1 -1
- package/dist/index.d.ts +13 -7
- 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 +20 -8
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +19 -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 +147 -12
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SnapOptions.d.ts +59 -32
- 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 +61 -30
- 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 +123 -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 +55 -4
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +160 -22
- package/dist/platformPackager.js.map +1 -1
- package/dist/presets/rectCra.js +3 -1
- package/dist/presets/rectCra.js.map +1 -1
- package/dist/publish/PublishManager.d.ts +40 -2
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +365 -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 +108 -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 +13 -4
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts +39 -2
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +114 -30
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/blockmap/blockmap.d.ts +44 -3
- package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
- package/dist/targets/blockmap/blockmap.js +142 -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 +17 -0
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +245 -45
- 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 +92 -12
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts +13 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +81 -61
- 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 +20 -15
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts +8 -2
- package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.js +16 -9
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.d.ts +6 -0
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.js +18 -20
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
- package/dist/targets/linux/flatpakBundle.d.ts +43 -0
- package/dist/targets/linux/flatpakBundle.d.ts.map +1 -0
- package/dist/targets/linux/flatpakBundle.js +210 -0
- package/dist/targets/linux/flatpakBundle.js.map +1 -0
- 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 +13 -2
- package/dist/targets/linux/snap/core24.d.ts.map +1 -1
- package/dist/targets/linux/snap/core24.js +107 -95
- 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 +10 -3
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +37 -18
- 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/snapPlugs.d.ts +76 -0
- package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapPlugs.js +242 -0
- package/dist/targets/linux/snap/snapPlugs.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 +4 -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 +64 -3
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +277 -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 +58 -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 +148 -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 +409 -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 +24 -21
- 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/AppFileWalker.js +9 -1
- package/dist/util/AppFileWalker.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 +67 -2
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +244 -32
- 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 +2 -1
- package/dist/util/config/config.d.ts.map +1 -1
- package/dist/util/config/config.js +42 -20
- package/dist/util/config/config.js.map +1 -1
- package/dist/util/config/fileOptions.d.ts +30 -0
- package/dist/util/config/fileOptions.d.ts.map +1 -0
- package/dist/util/config/fileOptions.js +120 -0
- package/dist/util/config/fileOptions.js.map +1 -0
- 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 +214 -0
- package/dist/util/config/legacyConfigGuard.js.map +1 -0
- package/dist/util/config/legacyOptions.d.ts +86 -0
- package/dist/util/config/legacyOptions.d.ts.map +1 -0
- package/dist/util/config/legacyOptions.js +413 -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 +43 -32
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +390 -137
- 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/removedEnvVars.d.ts +25 -0
- package/dist/util/removedEnvVars.d.ts.map +1 -0
- package/dist/util/removedEnvVars.js +54 -0
- package/dist/util/removedEnvVars.js.map +1 -0
- 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/util/trustedSourceRoots.d.ts +59 -0
- package/dist/util/trustedSourceRoots.d.ts.map +1 -0
- package/dist/util/trustedSourceRoots.js +127 -0
- package/dist/util/trustedSourceRoots.js.map +1 -0
- 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 +20 -20
- package/scheme.json +2112 -1495
- 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 +94 -53
- 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, prepareFixedNameWrite, 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,54 @@ function checkOptions(publishPolicy) {
|
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* electron-updater 7 adds the query string of a generic feed url (typically a token), like the credential headers, only to
|
|
27
|
+
* downloads on the feed's origin. An app whose latest*.yml points downloads at another origin that relies on that query gets
|
|
28
|
+
* 401/403 at update time, inside a shipped app, with nothing at build time saying why — `migrate-schema` prints the same advisory,
|
|
29
|
+
* but cannot be relied on to have been run. Only the query parameter names are logged, never the url or the values.
|
|
30
|
+
*
|
|
31
|
+
* @internal exported for tests
|
|
32
|
+
*/
|
|
33
|
+
export function warnAboutGenericFeedQuery(publishConfig) {
|
|
34
|
+
const url = publishConfig.provider === "generic" ? publishConfig.url : null;
|
|
35
|
+
const queryStart = typeof url === "string" ? url.indexOf("?") : -1;
|
|
36
|
+
if (queryStart < 0) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
// once per feed (the url without its query) per process — app-update.yml is written for every pack, and platforms may use different feeds
|
|
40
|
+
const queryParameters = [...new Set(new URLSearchParams(url.slice(queryStart + 1).split("#")[0]).keys())];
|
|
41
|
+
log.once(`generic-feed-query:${url.slice(0, queryStart)}`).warn({
|
|
42
|
+
queryParameters: queryParameters.length === 0 ? "(none)" : queryParameters.join(", "),
|
|
43
|
+
solution: "serve the update files from the feed origin (relative files[].url, the default) or use pre-signed URLs",
|
|
44
|
+
}, "the generic publish url has a query string. electron-updater 7 (electron-builder v27) adds it, and sends the credential headers from requestHeaders / addAuthHeader, " +
|
|
45
|
+
"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. " +
|
|
46
|
+
"Nothing changes for the relative URLs electron-builder writes. " +
|
|
47
|
+
"See https://www.electron.build/docs/migration/v27-breaking-changes#update-credentials-stay-on-the-feeds-origin");
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* v26 published implicitly when it detected a CI tag; v27 requires an explicit `--publish` policy.
|
|
51
|
+
* Without a signal, a tagged release pipeline goes green and uploads nothing — the build looks
|
|
52
|
+
* identical to a successful publish. Only warns when the project actually looks like it wanted to
|
|
53
|
+
* publish (a tag is present and a publish target is configured), so ordinary local builds stay quiet.
|
|
54
|
+
*/
|
|
55
|
+
function warnIfImplicitPublishExpected(packager) {
|
|
56
|
+
const tag = getCiTag();
|
|
57
|
+
if (tag == null) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const config = packager.config;
|
|
61
|
+
const hasPublishConfig = config.publish != null ||
|
|
62
|
+
["mac", "win", "linux"].some(platform => {
|
|
63
|
+
const platformConfig = config[platform];
|
|
64
|
+
return platformConfig != null && platformConfig.publish != null;
|
|
65
|
+
});
|
|
66
|
+
if (!hasPublishConfig) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
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. " +
|
|
70
|
+
"electron-builder v27 removed implicit publishing (v26 auto-published when it detected a CI tag). " +
|
|
71
|
+
"See https://www.electron.build/docs/migration/v27-breaking-changes#implicit-publish-removed");
|
|
72
|
+
}
|
|
23
73
|
export class PublishManager {
|
|
24
74
|
constructor(packager, publishOptions, cancellationToken = packager.cancellationToken) {
|
|
25
75
|
this.packager = packager;
|
|
@@ -38,6 +88,9 @@ export class PublishManager {
|
|
|
38
88
|
if (this.isPublish && forcePublishForPr) {
|
|
39
89
|
log.warn(publishForPrWarning);
|
|
40
90
|
}
|
|
91
|
+
if (publishPolicy == null) {
|
|
92
|
+
warnIfImplicitPublishExpected(packager);
|
|
93
|
+
}
|
|
41
94
|
}
|
|
42
95
|
else if (publishOptions.publish !== "never") {
|
|
43
96
|
log.info({
|
|
@@ -45,6 +98,7 @@ export class PublishManager {
|
|
|
45
98
|
solution: `set env PUBLISH_FOR_PULL_REQUEST to true to force code signing\n${publishForPrWarning}`,
|
|
46
99
|
}, "publishing will be skipped");
|
|
47
100
|
}
|
|
101
|
+
packager.onTargetsCreated(plan => this.requireSigningKeysForPlannedTargets(plan));
|
|
48
102
|
packager.onAfterPack(async (event) => {
|
|
49
103
|
const packager = event.packager;
|
|
50
104
|
if (event.electronPlatformName === "darwin") {
|
|
@@ -57,9 +111,20 @@ export class PublishManager {
|
|
|
57
111
|
return;
|
|
58
112
|
}
|
|
59
113
|
}
|
|
60
|
-
|
|
114
|
+
// app-update.yml is written for every pack, from the publish settings of the pack's targets that emit a manifest
|
|
115
|
+
// (see resolvePackAppUpdatePublishConfigs) - so a manifest signed under a target-level `publish` always ships with
|
|
116
|
+
// the key that verifies it, except when the pack's targets disagree about the feed (an error when publishing, a
|
|
117
|
+
// warning and no app-update.yml otherwise). The signing requirement (the error when publishing, the advisory
|
|
118
|
+
// otherwise) only applies when a target emits a manifest - the same per-target resolution as the build-start
|
|
119
|
+
// preflight. A snap-, flatpak- or mas-only pack has none (Linux and mas are not filtered above), nor has an
|
|
120
|
+
// installer whose target-level `publish` is `null` or waived.
|
|
121
|
+
const { publishConfigs, emitsManifest } = await resolvePackAppUpdatePublishConfigs(packager, event.targets, event.arch, this.isPublish);
|
|
122
|
+
if (emitsManifest) {
|
|
123
|
+
await packager.requireUpdateSigningKeys(this.isPublish);
|
|
124
|
+
}
|
|
125
|
+
const publishConfig = await createAppUpdateConfiguration(packager, publishConfigs, this.isPublish, false);
|
|
61
126
|
if (publishConfig != null) {
|
|
62
|
-
await
|
|
127
|
+
await writeAppUpdateYaml(packager.getResourcesDir(event.appOutDir), publishConfig, event.appOutDir);
|
|
63
128
|
}
|
|
64
129
|
});
|
|
65
130
|
packager.onArtifactCreated(async (event) => {
|
|
@@ -75,6 +140,30 @@ export class PublishManager {
|
|
|
75
140
|
}
|
|
76
141
|
});
|
|
77
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Build-start preflight: enforces update-manifest signing for every target of every platform and arch that will
|
|
145
|
+
* emit update info, before anything is packed. The per-artifact check in artifactCreatedWithoutExplicitPublishConfig
|
|
146
|
+
* only stops that artifact's own upload; by then an earlier target (a portable exe, another arch, another platform)
|
|
147
|
+
* may already be uploading. Same resolution as the per-artifact path - target-level `publish` first, `null` means
|
|
148
|
+
* none, `publishAutoUpdate: false` on every provider waives it - which stays in place for targets that do not
|
|
149
|
+
* declare `writesUpdateInfo`. Each planned platform x arch is one pack, so targets of a pack that disagree about the
|
|
150
|
+
* app-update.yml feed fail here too, before anything is packed (also for a prepackaged app, which has no afterPack).
|
|
151
|
+
*/
|
|
152
|
+
async requireSigningKeysForPlannedTargets(plan) {
|
|
153
|
+
if (!this.isPublish) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
for (const { packager, arch, targets } of plan) {
|
|
157
|
+
// resolving publish configs is async: a build cancelled meanwhile stops instead of failing on a missing key
|
|
158
|
+
if (this.cancellationToken.cancelled) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const { emitsManifest } = await resolvePackAppUpdatePublishConfigs(packager, targets, arch, true);
|
|
162
|
+
if (emitsManifest && !this.cancellationToken.cancelled) {
|
|
163
|
+
await packager.requireUpdateSigningKeys(true);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
78
167
|
getAppInfo(platformPackager) {
|
|
79
168
|
return platformPackager == null ? this.packager.appInfo : platformPackager.appInfo;
|
|
80
169
|
}
|
|
@@ -119,7 +208,17 @@ export class PublishManager {
|
|
|
119
208
|
}
|
|
120
209
|
return;
|
|
121
210
|
}
|
|
211
|
+
const writesUpdateInfo = event.isWriteUpdateInfo === true && target != null && eventFile != null && (platformPackager.platform !== Platform.WINDOWS || isSuitableWindowsTarget(target));
|
|
122
212
|
if (this.isPublish) {
|
|
213
|
+
// Enforce the signing requirement before this artifact is uploaded, not only in writeUpdateInfoFiles, which runs
|
|
214
|
+
// after every upload has been awaited. The build-start preflight and onAfterPack already fail early for targets
|
|
215
|
+
// that declare `writesUpdateInfo`; this also covers a custom target that emits update info without declaring it.
|
|
216
|
+
if (writesUpdateInfo) {
|
|
217
|
+
const updateInfoConfigs = await getPublishConfigsForUpdateInfo(platformPackager, publishConfigs, event.arch);
|
|
218
|
+
if (updateInfoConfigs?.some(it => it.publishAutoUpdate !== false)) {
|
|
219
|
+
await platformPackager.requireUpdateSigningKeys(true);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
123
222
|
for (const publishConfig of publishConfigs) {
|
|
124
223
|
if (this.cancellationToken.cancelled) {
|
|
125
224
|
log.debug({ file: event.file, reason: "cancelled" }, "not published");
|
|
@@ -128,22 +227,25 @@ export class PublishManager {
|
|
|
128
227
|
await this.scheduleUpload(publishConfig, event, this.getAppInfo(platformPackager));
|
|
129
228
|
}
|
|
130
229
|
}
|
|
131
|
-
if (
|
|
132
|
-
target != null &&
|
|
133
|
-
eventFile != null &&
|
|
134
|
-
!this.cancellationToken.cancelled &&
|
|
135
|
-
(platformPackager.platform !== Platform.WINDOWS || isSuitableWindowsTarget(target))) {
|
|
230
|
+
if (writesUpdateInfo && !this.cancellationToken.cancelled) {
|
|
136
231
|
this.taskManager.addTask(createUpdateInfoTasks(event, publishConfigs).then(it => this.updateFileWriteTask.push(...it)));
|
|
137
232
|
}
|
|
138
233
|
}
|
|
139
|
-
|
|
234
|
+
getOrCreatePublisher(publishConfig, appInfo) {
|
|
140
235
|
// to not include token into cache key
|
|
141
236
|
const providerCacheKey = safeStringifyJson(publishConfig);
|
|
142
237
|
let publisher = this.nameToPublisher.get(providerCacheKey);
|
|
143
238
|
if (publisher == null) {
|
|
144
|
-
publisher =
|
|
239
|
+
publisher = createPublisher(this, appInfo.version, publishConfig, this.publishOptions, this.packager).then(it => {
|
|
240
|
+
if (it != null) {
|
|
241
|
+
log.info({ publisher: it.toString() }, "publishing");
|
|
242
|
+
}
|
|
243
|
+
return it;
|
|
244
|
+
});
|
|
245
|
+
// cache the pending promise synchronously — concurrent scheduleUpload calls must share one publisher (and thus one release) instead of racing to create duplicates
|
|
145
246
|
this.nameToPublisher.set(providerCacheKey, publisher);
|
|
146
|
-
|
|
247
|
+
// on failure, evict so that a subsequent call can retry (the rejection still propagates to the caller)
|
|
248
|
+
publisher.catch(() => this.nameToPublisher.delete(providerCacheKey));
|
|
147
249
|
}
|
|
148
250
|
return publisher;
|
|
149
251
|
}
|
|
@@ -158,12 +260,128 @@ export class PublishManager {
|
|
|
158
260
|
if (this.cancellationToken.cancelled || updateInfoFileTasks.length === 0) {
|
|
159
261
|
return;
|
|
160
262
|
}
|
|
161
|
-
await writeUpdateInfoFiles(updateInfoFileTasks, this.packager);
|
|
263
|
+
await writeUpdateInfoFiles(updateInfoFileTasks, this.packager, this.isPublish);
|
|
162
264
|
await this.taskManager.awaitTasks();
|
|
163
265
|
}
|
|
164
266
|
}
|
|
165
|
-
|
|
166
|
-
|
|
267
|
+
/**
|
|
268
|
+
* The `app-update.yml` config for a single target with the given target-specific options (`null` for none): the
|
|
269
|
+
* target's own publish settings when it emits a manifest under them, otherwise the platform/root ones - the rule of
|
|
270
|
+
* {@link getPackAppUpdatePublishConfiguration} for a pack of one target.
|
|
271
|
+
*/
|
|
272
|
+
export async function getAppUpdatePublishConfiguration(packager, targetSpecificOptions, arch,
|
|
273
|
+
/**
|
|
274
|
+
* Whether this is the publish path. Gates both publish-credential resolution and the update-manifest signing
|
|
275
|
+
* requirement. The Linux targets that write `app-update.yml` into the package pass `false`, since for them
|
|
276
|
+
* "validation will be done on publish step" - and that is exactly when signing is enforced too.
|
|
277
|
+
*/
|
|
278
|
+
isPublish,
|
|
279
|
+
/**
|
|
280
|
+
* Set when the caller has already applied the signing requirement for the targets this config is embedded for;
|
|
281
|
+
* the configs resolved here then only decide the embedded trust list, and neither enforce nor warn.
|
|
282
|
+
*/
|
|
283
|
+
signingRequirementApplied = false) {
|
|
284
|
+
const own = await getEmittingUpdateInfoPublishConfigs(packager, targetSpecificOptions, arch, isPublish);
|
|
285
|
+
const publishConfigs = own ?? (await getPlatformUpdateInfoPublishConfigs(packager, arch, isPublish));
|
|
286
|
+
return await createAppUpdateConfiguration(packager, publishConfigs, isPublish, own != null && !signingRequirementApplied);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* The `app-update.yml` config of a packed app dir, which every target built from it ships: see
|
|
290
|
+
* {@link resolvePackAppUpdatePublishConfigs}. Used by the targets that (re)write the file themselves (AppImage,
|
|
291
|
+
* deb/rpm/pacman), so they embed the same feed as PublishManager's afterPack handler - or, for a prepackaged app, any
|
|
292
|
+
* feed at all - and do not race each other with different content.
|
|
293
|
+
*/
|
|
294
|
+
export async function getPackAppUpdatePublishConfiguration(packager, targets, arch, isPublish) {
|
|
295
|
+
const { publishConfigs, emitsManifest } = await resolvePackAppUpdatePublishConfigs(packager, targets, arch, isPublish);
|
|
296
|
+
return await createAppUpdateConfiguration(packager, publishConfigs, isPublish, emitsManifest);
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* The publish configs whose first provider becomes the `app-update.yml` shared by all targets of one pack (for a
|
|
300
|
+
* manifest-emitting target, the first provider that receives its manifest - see getEmittingUpdateInfoPublishConfigs):
|
|
301
|
+
*
|
|
302
|
+
* - the targets that emit a manifest (`writesUpdateInfo`, and on Windows an electron-updater-aware one) under their
|
|
303
|
+
* own effective publish settings - target-level `publish` first, then platform, then root - decide it;
|
|
304
|
+
* - if several do, their first providers must be the same feed ({@link appUpdateFeedIdentity}: publish-only options
|
|
305
|
+
* may differ): one app dir holds one `app-update.yml`, so otherwise some installs would poll a feed that never
|
|
306
|
+
* receives their manifest. That is a configuration error;
|
|
307
|
+
* - with none (a snap-only pack, or `nsis.publish: null`), it comes from the platform/root settings, as before -
|
|
308
|
+
* including the GitHub fallback from repository info when no level configures `publish` at all.
|
|
309
|
+
*
|
|
310
|
+
* `emitsManifest` tells whether any target of the pack emits one, i.e. whether the signing requirement applies.
|
|
311
|
+
*/
|
|
312
|
+
async function resolvePackAppUpdatePublishConfigs(packager, targets, arch, isPublish) {
|
|
313
|
+
const writers = [];
|
|
314
|
+
for (const target of targets) {
|
|
315
|
+
const publishConfigs = await getTargetManifestPublishConfigs(packager, target, arch, isPublish);
|
|
316
|
+
if (publishConfigs != null) {
|
|
317
|
+
writers.push({ target, publishConfigs });
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
if (writers.length === 0) {
|
|
321
|
+
return { publishConfigs: await getPlatformUpdateInfoPublishConfigs(packager, arch, isPublish), emitsManifest: false };
|
|
322
|
+
}
|
|
323
|
+
const embedded = appUpdateFeedIdentity(writers[0].publishConfigs[0]);
|
|
324
|
+
if (writers.some(it => appUpdateFeedIdentity(it.publishConfigs[0]) !== embedded)) {
|
|
325
|
+
reportConflictingAppUpdateFeeds(packager, writers, arch, isPublish);
|
|
326
|
+
// not publishing: no app-update.yml, the same package the error would have prevented - picking one of the feeds
|
|
327
|
+
// would silently ship installs that poll a feed without their manifest
|
|
328
|
+
return { publishConfigs: null, emitsManifest: true };
|
|
329
|
+
}
|
|
330
|
+
return { publishConfigs: writers[0].publishConfigs, emitsManifest: true };
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Targets of one pack resolve different app-update.yml feeds: an InvalidConfigurationError when publishing, otherwise
|
|
334
|
+
* a warning that says so, so the misconfiguration surfaces before a release is built with it.
|
|
335
|
+
*/
|
|
336
|
+
function reportConflictingAppUpdateFeeds(packager, writers, arch, isPublish) {
|
|
337
|
+
const targets = writers.map(it => `"${it.target.name}"`).join(", ");
|
|
338
|
+
const feeds = writers.map(it => `${it.target.name} -> ${it.publishConfigs[0]?.provider ?? "none"}`).join(", ");
|
|
339
|
+
const problem = `targets ${targets} are built from the same ${packager.platform.name} ${Arch[arch]} app, which holds a single app-update.yml, ` +
|
|
340
|
+
`but their publish settings resolve to different auto-update feeds (${feeds}; the first provider of each that receives the manifest is embedded)`;
|
|
341
|
+
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`;
|
|
342
|
+
if (isPublish) {
|
|
343
|
+
throw new InvalidConfigurationError(`${problem}. To fix it, ${solution}.`);
|
|
344
|
+
}
|
|
345
|
+
// scoped to the platform packager (one per platform and build): afterPack and the targets writing app-update.yml themselves
|
|
346
|
+
// resolve the same pack, and every arch usually repeats the same conflict - report each one once
|
|
347
|
+
log
|
|
348
|
+
.once(`conflicting-app-update-feeds:${feeds}`, packager)
|
|
349
|
+
.warn({ solution }, `${problem}. No app-update.yml is written, so installed apps get neither an update feed nor the update-manifest public key. ` +
|
|
350
|
+
"Publishing this configuration fails with an InvalidConfigurationError.");
|
|
351
|
+
}
|
|
352
|
+
// Options that only the publisher reads (the upload itself), never electron-updater, so they cannot make two otherwise
|
|
353
|
+
// identical first providers different feeds. Everything else is compared - including fields of custom providers and
|
|
354
|
+
// options such as `requestHeaders`, `token` or `private` that change how or whether the updater can read the feed.
|
|
355
|
+
const PUBLISH_ONLY_OPTIONS = new Set(["publishAutoUpdate", "timeout"]);
|
|
356
|
+
const S3_PUBLISH_ONLY_OPTIONS = new Set(["acl", "storageClass", "encryption"]);
|
|
357
|
+
/**
|
|
358
|
+
* What makes two first providers the same app-update.yml feed: the provider and every option that decides where, or
|
|
359
|
+
* how, electron-updater reads the manifest (url, bucket, region, path, owner, repo, channel, ...). Publish-only options
|
|
360
|
+
* and unset (nullish) values are left out, and key order does not matter - so `publishAutoUpdate: true` against an
|
|
361
|
+
* absent flag is the same feed, a different url or bucket is not.
|
|
362
|
+
*/
|
|
363
|
+
function appUpdateFeedIdentity(config) {
|
|
364
|
+
if (config == null) {
|
|
365
|
+
return "null";
|
|
366
|
+
}
|
|
367
|
+
const isS3Like = config.provider === "s3" || config.provider === "spaces" || config.provider === "r2";
|
|
368
|
+
const identity = Object.fromEntries(Object.entries(config).filter(([key, value]) => value != null && !PUBLISH_ONLY_OPTIONS.has(key) && !(isS3Like && S3_PUBLISH_ONLY_OPTIONS.has(key))));
|
|
369
|
+
// key order does not make two configs different feeds
|
|
370
|
+
return JSON.stringify(identity, (_key, value) => value != null && typeof value === "object" && !Array.isArray(value)
|
|
371
|
+
? Object.fromEntries(Object.keys(value)
|
|
372
|
+
.sort()
|
|
373
|
+
.map(key => [key, value[key]]))
|
|
374
|
+
: value);
|
|
375
|
+
}
|
|
376
|
+
async function getPlatformUpdateInfoPublishConfigs(packager, arch, isPublish) {
|
|
377
|
+
return await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, null, arch, isPublish), arch);
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* The embedded `app-update.yml` config (first provider, updater cache dir, Windows publisher name, manifest trust
|
|
381
|
+
* list) for already-resolved publish configs. `requireSigning` applies the update-manifest signing requirement
|
|
382
|
+
* (error when publishing, advisory otherwise) before the trust list is derived.
|
|
383
|
+
*/
|
|
384
|
+
async function createAppUpdateConfiguration(packager, publishConfigs, isPublish, requireSigning) {
|
|
167
385
|
if (publishConfigs == null || publishConfigs.length === 0) {
|
|
168
386
|
return null;
|
|
169
387
|
}
|
|
@@ -171,6 +389,7 @@ export async function getAppUpdatePublishConfiguration(packager, targetSpecificO
|
|
|
171
389
|
...publishConfigs[0],
|
|
172
390
|
updaterCacheDirName: packager.appInfo.updaterCacheDirName,
|
|
173
391
|
};
|
|
392
|
+
warnAboutGenericFeedQuery(publishConfig);
|
|
174
393
|
if (packager.platform === Platform.WINDOWS && publishConfig.publisherName == null) {
|
|
175
394
|
const winPackager = packager;
|
|
176
395
|
const publisherName = winPackager.isForceCodeSigningVerification ? await (await winPackager.signingManager.value).computedPublisherName.value : undefined;
|
|
@@ -178,8 +397,73 @@ export async function getAppUpdatePublishConfiguration(packager, targetSpecificO
|
|
|
178
397
|
publishConfig.publisherName = publisherName;
|
|
179
398
|
}
|
|
180
399
|
}
|
|
400
|
+
// Embed the update-manifest trust list so the updater can verify signed manifests. An explicit
|
|
401
|
+
// `publicKey` list wins as-is; otherwise the public half of every configured signing key is derived
|
|
402
|
+
// so the user only manages the secrets. One key is written as a plain string (byte-identical to the
|
|
403
|
+
// single-key format), several as a YAML list.
|
|
404
|
+
const updateManifestConfig = packager.updateManifestOptions;
|
|
405
|
+
// `updateManifestPublicKey` is only ever assigned right below, on this fresh copy, so a value that is
|
|
406
|
+
// already present can only have come from the user's `publish` configuration. Rejecting it (rather than
|
|
407
|
+
// taking it as-is) keeps the trust list on the single validated path and stops a stale hand-copied key
|
|
408
|
+
// from silently shadowing the derived one.
|
|
409
|
+
if (publishConfig.updateManifestPublicKey != null) {
|
|
410
|
+
throw new InvalidConfigurationError("publish.updateManifestPublicKey is managed by electron-builder and must not be set; configure updateManifest.publicKey instead");
|
|
411
|
+
}
|
|
412
|
+
// The very same keys updateInfoBuilder signs `latest*.yml` with, so env-var-only signing
|
|
413
|
+
// (no `updateManifest` config block) embeds the matching public keys too, and the two sides
|
|
414
|
+
// cannot disagree about whether signing is enabled.
|
|
415
|
+
// Whether the requirement applies was decided by the caller from the manifest-emitting targets (a publish target
|
|
416
|
+
// with `publishAutoUpdate: false` on every provider emits none, so it is waived there) - the trust list is still
|
|
417
|
+
// embedded if keys happen to be configured. Only app-update.yml is limited to the first provider:
|
|
418
|
+
// createUpdateInfoTasks writes a manifest for every configured one, so the waiver must hold for all of them.
|
|
419
|
+
const signingKeys = requireSigning ? await packager.requireUpdateSigningKeys(isPublish) : await packager.updateSigningKeys.value;
|
|
420
|
+
// `false` is the opt-out and carries no config object to read `publicKey` from
|
|
421
|
+
const explicitKeys = updateManifestConfig === false ? [] : normalizeExplicitPublicKeys(updateManifestConfig?.publicKey);
|
|
422
|
+
const trustedKeys = explicitKeys.length > 0 ? explicitKeys : signingKeys.map(derivePublicKeyPem);
|
|
423
|
+
if (trustedKeys.length > 0) {
|
|
424
|
+
publishConfig.updateManifestPublicKey = trustedKeys.length === 1 ? trustedKeys[0] : trustedKeys;
|
|
425
|
+
}
|
|
426
|
+
if (signingKeys.length > 0 && explicitKeys.length > 0) {
|
|
427
|
+
const trustedIds = new Set(trustedKeys.map(computeUpdateManifestKeyId));
|
|
428
|
+
if (!signingKeys.some(key => trustedIds.has(computeUpdateManifestKeyId(key)))) {
|
|
429
|
+
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). " +
|
|
430
|
+
"Intended only for a deliberate bridge release; otherwise add the current public key to updateManifest.publicKey.");
|
|
431
|
+
}
|
|
432
|
+
}
|
|
181
433
|
return publishConfig;
|
|
182
434
|
}
|
|
435
|
+
/**
|
|
436
|
+
* Normalizes the configured `updateManifest.publicKey` (string, multi-PEM string, or array) into distinct,
|
|
437
|
+
* validated Ed25519 public keys, preserving order. Duplicates and non-Ed25519 keys are configuration errors.
|
|
438
|
+
*/
|
|
439
|
+
function normalizeExplicitPublicKeys(value) {
|
|
440
|
+
const keys = normalizePublicKeyList(value);
|
|
441
|
+
const seen = new Map();
|
|
442
|
+
keys.forEach((key, index) => {
|
|
443
|
+
let keyId;
|
|
444
|
+
try {
|
|
445
|
+
keyId = computeUpdateManifestKeyId(key);
|
|
446
|
+
}
|
|
447
|
+
catch (e) {
|
|
448
|
+
throw new InvalidConfigurationError(`updateManifest.publicKey #${index + 1} is not a valid Ed25519 public key: ${e.message || e}`);
|
|
449
|
+
}
|
|
450
|
+
const previous = seen.get(keyId);
|
|
451
|
+
if (previous != null) {
|
|
452
|
+
throw new InvalidConfigurationError(`updateManifest.publicKey #${index + 1} duplicates entry #${previous + 1} (key id ${keyId}). List each trusted key once.`);
|
|
453
|
+
}
|
|
454
|
+
seen.set(keyId, index);
|
|
455
|
+
});
|
|
456
|
+
return keys;
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* Writes `app-update.yml` into the resources directory. Untrusted files (extraResources, the app directory) were copied there before,
|
|
460
|
+
* so the write is confined to `containmentRoot` by real path and replaces, rather than follows, a symlink already at the file name.
|
|
461
|
+
*/
|
|
462
|
+
export async function writeAppUpdateYaml(resourcesDir, publishConfig, containmentRoot = resourcesDir) {
|
|
463
|
+
const file = path.join(resourcesDir, "app-update.yml");
|
|
464
|
+
await prepareFixedNameWrite(containmentRoot, file, "auto-update configuration");
|
|
465
|
+
await outputFile(file, serializeToYaml(publishConfig));
|
|
466
|
+
}
|
|
183
467
|
export async function getPublishConfigsForUpdateInfo(packager, publishConfigs, arch) {
|
|
184
468
|
if (publishConfigs === null) {
|
|
185
469
|
return null;
|
|
@@ -265,6 +549,8 @@ async function requireProviderClass(provider, packager) {
|
|
|
265
549
|
return SnapStorePublisher;
|
|
266
550
|
case "spaces":
|
|
267
551
|
return SpacesPublisher;
|
|
552
|
+
case "r2":
|
|
553
|
+
return R2Publisher;
|
|
268
554
|
case "bitbucket":
|
|
269
555
|
return BitbucketPublisher;
|
|
270
556
|
default: {
|
|
@@ -361,6 +647,29 @@ async function resolvePublishConfigurations(publishers, platformPackager, arch,
|
|
|
361
647
|
debug(`Explicit publish provider: ${safeStringifyJson(publishers)}`);
|
|
362
648
|
return (await Promise.all(asArray(publishers).map(it => getResolvedPublishConfig(platformPackager, typeof it === "string" ? { provider: it } : it, arch, errorIfCannot, fallbackPackager))));
|
|
363
649
|
}
|
|
650
|
+
/**
|
|
651
|
+
* The update-info publish configs `target` emits an auto-update manifest for under its own effective publish settings,
|
|
652
|
+
* else `null`: target-level `publish` first, `null` means none, and `publishAutoUpdate: false` on every provider means
|
|
653
|
+
* no manifest.
|
|
654
|
+
*/
|
|
655
|
+
async function getTargetManifestPublishConfigs(packager, target, arch, errorIfCannot) {
|
|
656
|
+
if (!target.writesUpdateInfo || (packager.platform === Platform.WINDOWS && !isSuitableWindowsTarget(target))) {
|
|
657
|
+
return null;
|
|
658
|
+
}
|
|
659
|
+
return await getEmittingUpdateInfoPublishConfigs(packager, target.options, arch, errorIfCannot);
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* The update-info publish configs that receive a manifest, resolved for the given target-specific options (target,
|
|
663
|
+
* then platform, then root; GitHub from repository info when none configures `publish`), or `null` when they emit
|
|
664
|
+
* none: `publish: null`, or `publishAutoUpdate: false` on every provider. Providers with `publishAutoUpdate: false`
|
|
665
|
+
* are left out - writeUpdateInfoFiles writes no `latest*.yml` for them - so the first provider, the one embedded in
|
|
666
|
+
* app-update.yml, is always one the manifest is uploaded to.
|
|
667
|
+
*/
|
|
668
|
+
async function getEmittingUpdateInfoPublishConfigs(packager, targetSpecificOptions, arch, errorIfCannot) {
|
|
669
|
+
const updateInfoConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, targetSpecificOptions, arch, errorIfCannot), arch);
|
|
670
|
+
const emitting = updateInfoConfigs?.filter(it => it.publishAutoUpdate !== false) ?? [];
|
|
671
|
+
return emitting.length === 0 ? null : emitting;
|
|
672
|
+
}
|
|
364
673
|
function isSuitableWindowsTarget(target) {
|
|
365
674
|
if (target.name === "appx" && target.options != null && target.options.electronUpdaterAware) {
|
|
366
675
|
return true;
|
|
@@ -383,6 +692,34 @@ function isDetectUpdateChannel(platformSpecificConfiguration, configuration) {
|
|
|
383
692
|
const value = platformSpecificConfiguration == null ? null : platformSpecificConfiguration.detectUpdateChannel;
|
|
384
693
|
return value == null ? configuration.detectUpdateChannel !== false : value;
|
|
385
694
|
}
|
|
695
|
+
/** @internal */
|
|
696
|
+
export function parseGithubRepoShorthand(repo) {
|
|
697
|
+
const separator = repo.indexOf("/");
|
|
698
|
+
return separator > 0 ? { owner: repo.substring(0, separator), repo: repo.substring(separator + 1) } : null;
|
|
699
|
+
}
|
|
700
|
+
// the inferred repository becomes the publish/update destination and, for auto-update-capable targets, is written
|
|
701
|
+
// verbatim into app-update.yml inside every shipped build as its permanent update feed - so the developer has to be
|
|
702
|
+
// told which repository they are committing to. A repository taken from package.json "repository" is deliberate
|
|
703
|
+
// configuration (info); one picked up from the CI environment or .git/config is not (warn).
|
|
704
|
+
function logInferredUpdateFeed(buildId, provider, owner, project, source, inferredFields) {
|
|
705
|
+
// scoped to the build's CancellationToken (one instance per Packager) so that a build reports a given feed once - getResolvedPublishConfig
|
|
706
|
+
// is called per target and arch - without leaking state between programmatic builds running in the same process
|
|
707
|
+
const limited = log.once(`inferred-update-feed:${provider}:${owner}/${project}`, buildId);
|
|
708
|
+
const fields = {
|
|
709
|
+
reason: `${inferredFields.join(" and ")} not specified in the publish configuration`,
|
|
710
|
+
source: source ?? "unknown",
|
|
711
|
+
provider,
|
|
712
|
+
owner,
|
|
713
|
+
...(provider === "bitbucket" ? { slug: project } : { repo: project }),
|
|
714
|
+
};
|
|
715
|
+
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";
|
|
716
|
+
if (source === "package.json") {
|
|
717
|
+
limited.info(fields, message);
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
limited.warn(fields, message);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
386
723
|
async function getResolvedPublishConfig(platformPackager, options, arch, errorIfCannot, fallbackPackager) {
|
|
387
724
|
options = { ...options };
|
|
388
725
|
expandPublishConfig(options, platformPackager, arch);
|
|
@@ -421,11 +758,10 @@ async function getResolvedPublishConfig(platformPackager, options, arch, errorIf
|
|
|
421
758
|
let owner = isGithub ? options.owner : options.owner;
|
|
422
759
|
let project = isGithub ? options.repo : options.slug;
|
|
423
760
|
if (isGithub && owner == null && project != null) {
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
|
|
427
|
-
project = repo
|
|
428
|
-
owner = repo.substring(index + 1);
|
|
761
|
+
const shorthand = parseGithubRepoShorthand(project);
|
|
762
|
+
if (shorthand != null) {
|
|
763
|
+
owner = shorthand.owner;
|
|
764
|
+
project = shorthand.repo;
|
|
429
765
|
}
|
|
430
766
|
}
|
|
431
767
|
async function getInfo() {
|
|
@@ -448,22 +784,28 @@ async function getResolvedPublishConfig(platformPackager, options, arch, errorIf
|
|
|
448
784
|
if (info == null) {
|
|
449
785
|
return null;
|
|
450
786
|
}
|
|
787
|
+
const inferredFields = [];
|
|
451
788
|
if (!owner) {
|
|
452
789
|
owner = info.user;
|
|
790
|
+
inferredFields.push("owner");
|
|
453
791
|
}
|
|
454
792
|
if (!project) {
|
|
455
793
|
project = info.project;
|
|
794
|
+
inferredFields.push(isGithub ? "repo" : "slug");
|
|
456
795
|
}
|
|
796
|
+
logInferredUpdateFeed(ctx.cancellationToken, provider, owner, project, info.source, inferredFields);
|
|
457
797
|
}
|
|
458
798
|
if (isGithub) {
|
|
459
799
|
if (options.token != null && !options.private) {
|
|
460
800
|
log.warn('"token" specified in the github publish options. It should be used only for [setFeedURL](module:electron-updater/out/AppUpdater.AppUpdater+setFeedURL).');
|
|
461
801
|
}
|
|
462
802
|
//tslint:disable-next-line:no-object-literal-type-assertion
|
|
803
|
+
// oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- required by the TS 5.1 that typescript-json-schema bundles (pnpm generate:schema)
|
|
463
804
|
return { owner, repo: project, ...options };
|
|
464
805
|
}
|
|
465
806
|
else {
|
|
466
807
|
//tslint:disable-next-line:no-object-literal-type-assertion
|
|
808
|
+
// oxlint-disable-next-line typescript/no-unnecessary-type-assertion -- required by the TS 5.1 that typescript-json-schema bundles (pnpm generate:schema)
|
|
467
809
|
return { owner, slug: project, ...options };
|
|
468
810
|
}
|
|
469
811
|
}
|