app-builder-lib 26.15.3 → 27.0.0-alpha.1
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 +40 -0
- package/dist/Framework.d.ts.map +1 -0
- package/dist/Framework.js +4 -0
- package/dist/Framework.js.map +1 -0
- package/dist/appInfo.d.ts +32 -0
- package/dist/appInfo.d.ts.map +1 -0
- package/dist/appInfo.js +145 -0
- package/dist/appInfo.js.map +1 -0
- package/dist/asar/asar.d.ts +39 -0
- package/dist/asar/asar.d.ts.map +1 -0
- package/dist/asar/asar.js +155 -0
- package/dist/asar/asar.js.map +1 -0
- package/dist/asar/asarFileChecker.d.ts +3 -0
- package/dist/asar/asarFileChecker.d.ts.map +1 -0
- package/dist/asar/asarFileChecker.js +22 -0
- package/dist/asar/asarFileChecker.js.map +1 -0
- package/dist/asar/asarUtil.d.ts +2 -0
- package/dist/asar/asarUtil.d.ts.map +1 -0
- package/dist/asar/asarUtil.js +278 -0
- package/dist/asar/asarUtil.js.map +1 -0
- package/dist/asar/integrity.d.ts +16 -0
- package/dist/asar/integrity.d.ts.map +1 -0
- package/dist/asar/integrity.js +59 -0
- package/dist/asar/integrity.js.map +1 -0
- package/dist/asar/unpackDetector.d.ts +2 -0
- package/dist/asar/unpackDetector.d.ts.map +1 -0
- package/dist/asar/unpackDetector.js +39 -0
- package/dist/asar/unpackDetector.js.map +1 -0
- package/dist/codeSign/certInfo.d.ts +55 -0
- package/dist/codeSign/certInfo.d.ts.map +1 -0
- package/dist/codeSign/certInfo.js +459 -0
- package/dist/codeSign/certInfo.js.map +1 -0
- package/dist/codeSign/codesign.d.ts +4 -0
- package/dist/codeSign/codesign.d.ts.map +1 -0
- package/dist/codeSign/codesign.js +32 -0
- package/dist/codeSign/codesign.js.map +1 -0
- package/dist/codeSign/mac/macCodeSign.d.ts +29 -0
- package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -0
- package/dist/codeSign/mac/macCodeSign.js +273 -0
- package/dist/codeSign/mac/macCodeSign.js.map +1 -0
- package/dist/codeSign/signManager.d.ts +14 -0
- package/dist/codeSign/signManager.d.ts.map +1 -0
- package/dist/codeSign/signManager.js +2 -0
- package/dist/codeSign/signManager.js.map +1 -0
- package/dist/codeSign/win/windowsCodeSign.d.ts +8 -0
- package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -0
- package/dist/codeSign/win/windowsCodeSign.js +34 -0
- package/dist/codeSign/win/windowsCodeSign.js.map +1 -0
- package/dist/codeSign/win/windowsSignAzureManager.d.ts +18 -0
- package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -0
- package/dist/codeSign/win/windowsSignAzureManager.js +68 -0
- package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -0
- package/dist/codeSign/win/windowsSignToolManager.d.ts +59 -0
- package/dist/codeSign/win/windowsSignToolManager.d.ts.map +1 -0
- package/dist/codeSign/win/windowsSignToolManager.js +364 -0
- package/dist/codeSign/win/windowsSignToolManager.js.map +1 -0
- package/dist/configuration.d.ts +1010 -0
- package/dist/configuration.d.ts.map +1 -0
- package/dist/configuration.js +2 -0
- package/dist/configuration.js.map +1 -0
- package/dist/core.d.ts +61 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +61 -0
- package/dist/core.js.map +1 -0
- package/dist/electron/ElectronFramework.d.ts +17 -0
- package/dist/electron/ElectronFramework.d.ts.map +1 -0
- package/dist/electron/ElectronFramework.js +236 -0
- package/dist/electron/ElectronFramework.js.map +1 -0
- package/dist/electron/electronVersion.d.ts +7 -0
- package/dist/electron/electronVersion.d.ts.map +1 -0
- package/dist/electron/electronVersion.js +119 -0
- package/dist/electron/electronVersion.js.map +1 -0
- package/dist/electron/injectFFMPEG.d.ts +12 -0
- package/dist/electron/injectFFMPEG.d.ts.map +1 -0
- package/dist/electron/injectFFMPEG.js +53 -0
- package/dist/electron/injectFFMPEG.js.map +1 -0
- package/dist/electron/mac/electronMac.d.ts +2 -0
- package/dist/electron/mac/electronMac.d.ts.map +1 -0
- package/dist/electron/mac/electronMac.js +254 -0
- package/dist/electron/mac/electronMac.js.map +1 -0
- package/dist/electron/search-module.d.ts +24 -0
- package/dist/electron/search-module.d.ts.map +1 -0
- package/dist/electron/search-module.js +68 -0
- package/dist/electron/search-module.js.map +1 -0
- package/dist/electron/win/electronWin.d.ts +2 -0
- package/dist/electron/win/electronWin.d.ts.map +1 -0
- package/dist/electron/win/electronWin.js +36 -0
- package/dist/electron/win/electronWin.js.map +1 -0
- package/dist/errorMessages.d.ts +2 -0
- package/dist/errorMessages.d.ts.map +1 -0
- package/dist/errorMessages.js +8 -0
- package/dist/errorMessages.js.map +1 -0
- package/dist/fileMatcher.d.ts +31 -0
- package/dist/fileMatcher.d.ts.map +1 -0
- package/dist/fileMatcher.js +277 -0
- package/dist/fileMatcher.js.map +1 -0
- package/dist/fileTransformer.d.ts +2 -0
- package/dist/fileTransformer.d.ts.map +1 -0
- package/dist/fileTransformer.js +82 -0
- package/dist/fileTransformer.js.map +1 -0
- package/dist/forge-maker.d.ts +6 -0
- package/dist/forge-maker.d.ts.map +1 -0
- package/dist/forge-maker.js +20 -0
- package/dist/forge-maker.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -0
- package/dist/indexInternal.d.ts +46 -0
- package/dist/indexInternal.d.ts.map +1 -0
- package/dist/indexInternal.js +39 -0
- package/dist/indexInternal.js.map +1 -0
- package/dist/linuxPackager.d.ts +13 -0
- package/dist/linuxPackager.d.ts.map +1 -0
- package/dist/linuxPackager.js +75 -0
- package/dist/linuxPackager.js.map +1 -0
- package/dist/macPackager.d.ts +50 -0
- package/dist/macPackager.d.ts.map +1 -0
- package/dist/macPackager.js +442 -0
- package/dist/macPackager.js.map +1 -0
- package/dist/node-module-collector/bunNodeModulesCollector.d.ts +11 -0
- package/dist/node-module-collector/bunNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/bunNodeModulesCollector.js +14 -0
- package/dist/node-module-collector/bunNodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/hoist.d.ts +124 -0
- package/dist/node-module-collector/hoist.d.ts.map +1 -0
- package/dist/node-module-collector/hoist.js +880 -0
- package/dist/node-module-collector/hoist.js.map +1 -0
- package/dist/node-module-collector/index.d.ts +21 -0
- package/dist/node-module-collector/index.d.ts.map +1 -0
- package/dist/node-module-collector/index.js +124 -0
- package/dist/node-module-collector/index.js.map +1 -0
- package/dist/node-module-collector/moduleManager.d.ts +94 -0
- package/dist/node-module-collector/moduleManager.d.ts.map +1 -0
- package/dist/node-module-collector/moduleManager.js +314 -0
- package/dist/node-module-collector/moduleManager.js.map +1 -0
- package/dist/node-module-collector/nodeModulesCollector.d.ts +138 -0
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/nodeModulesCollector.js +421 -0
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/npmNodeModulesCollector.d.ts +15 -0
- package/dist/node-module-collector/npmNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/npmNodeModulesCollector.js +75 -0
- package/dist/node-module-collector/npmNodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/packageManager.d.ts +18 -0
- package/dist/node-module-collector/packageManager.d.ts.map +1 -0
- package/dist/node-module-collector/packageManager.js +137 -0
- package/dist/node-module-collector/packageManager.js.map +1 -0
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +45 -0
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +184 -0
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/traversalNodeModulesCollector.d.ts +19 -0
- package/dist/node-module-collector/traversalNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/traversalNodeModulesCollector.js +118 -0
- package/dist/node-module-collector/traversalNodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/types.d.ts +53 -0
- package/dist/node-module-collector/types.d.ts.map +1 -0
- package/dist/node-module-collector/types.js +2 -0
- package/dist/node-module-collector/yarnBerryNodeModulesCollector.d.ts +16 -0
- package/dist/node-module-collector/yarnBerryNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/yarnBerryNodeModulesCollector.js +87 -0
- package/dist/node-module-collector/yarnBerryNodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/yarnNodeModulesCollector.d.ts +11 -0
- package/dist/node-module-collector/yarnNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/yarnNodeModulesCollector.js +18 -0
- package/dist/node-module-collector/yarnNodeModulesCollector.js.map +1 -0
- package/dist/options/AppXOptions.d.ts +106 -0
- package/dist/options/AppXOptions.d.ts.map +1 -0
- package/dist/options/AppXOptions.js +2 -0
- package/dist/options/AppXOptions.js.map +1 -0
- package/dist/options/CommonWindowsInstallerConfiguration.d.ts +48 -0
- package/dist/options/CommonWindowsInstallerConfiguration.d.ts.map +1 -0
- package/dist/options/CommonWindowsInstallerConfiguration.js +47 -0
- package/dist/options/CommonWindowsInstallerConfiguration.js.map +1 -0
- package/dist/options/FileAssociation.d.ts +46 -0
- package/dist/options/FileAssociation.d.ts.map +1 -0
- package/dist/options/FileAssociation.js +2 -0
- package/dist/options/MsiOptions.d.ts +27 -0
- package/dist/options/MsiOptions.d.ts.map +1 -0
- package/dist/options/MsiOptions.js +2 -0
- package/dist/options/MsiOptions.js.map +1 -0
- package/dist/options/MsiWrappedOptions.d.ts +27 -0
- package/dist/options/MsiWrappedOptions.d.ts.map +1 -0
- package/dist/options/MsiWrappedOptions.js +2 -0
- package/dist/options/MsiWrappedOptions.js.map +1 -0
- package/dist/options/PlatformSpecificBuildOptions.d.ts +261 -0
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -0
- package/dist/options/PlatformSpecificBuildOptions.js +2 -0
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -0
- package/dist/options/SnapOptions.d.ts +480 -0
- package/dist/options/SnapOptions.d.ts.map +1 -0
- package/dist/options/SnapOptions.js +2 -0
- package/dist/options/SnapOptions.js.map +1 -0
- package/dist/options/SquirrelWindowsOptions.d.ts +47 -0
- package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -0
- package/dist/options/SquirrelWindowsOptions.js +2 -0
- package/dist/options/SquirrelWindowsOptions.js.map +1 -0
- package/dist/options/linuxOptions.d.ts +289 -0
- package/dist/options/linuxOptions.d.ts.map +1 -0
- package/dist/options/linuxOptions.js +2 -0
- package/dist/options/linuxOptions.js.map +1 -0
- package/dist/options/macOptions.d.ts +390 -0
- package/dist/options/macOptions.d.ts.map +1 -0
- package/dist/options/macOptions.js +2 -0
- package/dist/options/macOptions.js.map +1 -0
- package/dist/options/metadata.d.ts +54 -0
- package/dist/options/metadata.d.ts.map +1 -0
- package/dist/options/metadata.js +2 -0
- package/dist/options/metadata.js.map +1 -0
- package/dist/options/pkgOptions.d.ts +137 -0
- package/dist/options/pkgOptions.d.ts.map +1 -0
- package/dist/options/pkgOptions.js +2 -0
- package/dist/options/pkgOptions.js.map +1 -0
- package/dist/options/winOptions.d.ts +166 -0
- package/dist/options/winOptions.d.ts.map +1 -0
- package/dist/options/winOptions.js +2 -0
- package/dist/options/winOptions.js.map +1 -0
- package/dist/packager.d.ts +100 -0
- package/dist/packager.d.ts.map +1 -0
- package/dist/packager.js +491 -0
- package/dist/packager.js.map +1 -0
- package/dist/packagerApi.d.ts +32 -0
- package/dist/packagerApi.d.ts.map +1 -0
- package/dist/packagerApi.js +2 -0
- package/dist/packagerApi.js.map +1 -0
- package/dist/platformPackager.d.ts +132 -0
- package/dist/platformPackager.d.ts.map +1 -0
- package/dist/platformPackager.js +761 -0
- package/dist/platformPackager.js.map +1 -0
- package/dist/presets/rectCra.d.ts +2 -0
- package/dist/presets/rectCra.d.ts.map +1 -0
- package/dist/presets/rectCra.js +19 -0
- package/dist/presets/rectCra.js.map +1 -0
- package/dist/publish/PublishManager.d.ts +33 -0
- package/dist/publish/PublishManager.d.ts.map +1 -0
- package/dist/publish/PublishManager.js +470 -0
- package/dist/publish/PublishManager.js.map +1 -0
- package/dist/publish/updateInfoBuilder.d.ts +15 -0
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -0
- package/dist/publish/updateInfoBuilder.js +221 -0
- package/dist/publish/updateInfoBuilder.js.map +1 -0
- package/dist/targets/ArchiveTarget.d.ts +12 -0
- package/dist/targets/ArchiveTarget.d.ts.map +1 -0
- package/dist/targets/ArchiveTarget.js +93 -0
- package/dist/targets/ArchiveTarget.js.map +1 -0
- package/dist/targets/archive.d.ts +27 -0
- package/dist/targets/archive.d.ts.map +1 -0
- package/dist/targets/archive.js +174 -0
- package/dist/targets/archive.js.map +1 -0
- package/dist/targets/blockmap/blockmap.d.ts +17 -0
- package/dist/targets/blockmap/blockmap.d.ts.map +1 -0
- package/dist/targets/blockmap/blockmap.js +150 -0
- package/dist/targets/blockmap/blockmap.js.map +1 -0
- package/dist/targets/differentialUpdateInfoBuilder.d.ts +16 -0
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -0
- package/dist/targets/differentialUpdateInfoBuilder.js +73 -0
- package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -0
- package/dist/targets/linux/FlatpakTarget.d.ts +21 -0
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -0
- package/dist/targets/linux/FlatpakTarget.js +156 -0
- package/dist/targets/linux/FlatpakTarget.js.map +1 -0
- package/dist/targets/linux/FpmTarget.d.ts +23 -0
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -0
- package/dist/targets/linux/FpmTarget.js +365 -0
- package/dist/targets/linux/FpmTarget.js.map +1 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts +24 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -0
- package/dist/targets/linux/LinuxTargetHelper.js +332 -0
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -0
- package/dist/targets/linux/appimage/AppImageTarget.d.ts +16 -0
- package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -0
- package/dist/targets/linux/appimage/AppImageTarget.js +141 -0
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -0
- package/dist/targets/linux/appimage/appImageUtil.d.ts +57 -0
- package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -0
- package/dist/targets/linux/appimage/appImageUtil.js +317 -0
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -0
- package/dist/targets/linux/appimage/appLauncher.d.ts +4 -0
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -0
- package/dist/targets/linux/appimage/appLauncher.js +91 -0
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -0
- package/dist/targets/linux/snap/SnapTarget.d.ts +37 -0
- package/dist/targets/linux/snap/SnapTarget.d.ts.map +1 -0
- package/dist/targets/linux/snap/SnapTarget.js +96 -0
- package/dist/targets/linux/snap/SnapTarget.js.map +1 -0
- package/dist/targets/linux/snap/core24.d.ts +53 -0
- package/dist/targets/linux/snap/core24.d.ts.map +1 -0
- package/dist/targets/linux/snap/core24.js +444 -0
- package/dist/targets/linux/snap/core24.js.map +1 -0
- package/dist/targets/linux/snap/coreCustom.d.ts +29 -0
- package/dist/targets/linux/snap/coreCustom.d.ts.map +1 -0
- package/dist/targets/linux/snap/coreCustom.js +60 -0
- package/dist/targets/linux/snap/coreCustom.js.map +1 -0
- package/dist/targets/linux/snap/coreLegacy.d.ts +46 -0
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -0
- package/dist/targets/linux/snap/coreLegacy.js +402 -0
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -0
- package/dist/targets/linux/snap/snapcraftBuilder.d.ts +40 -0
- package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapcraftBuilder.js +414 -0
- package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -0
- package/dist/targets/mac/MacTargetHelper.d.ts +30 -0
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -0
- package/dist/targets/mac/MacTargetHelper.js +267 -0
- package/dist/targets/mac/MacTargetHelper.js.map +1 -0
- package/dist/targets/mac/pkg.d.ts +31 -0
- package/dist/targets/mac/pkg.d.ts.map +1 -0
- package/dist/targets/mac/pkg.js +271 -0
- package/dist/targets/mac/pkg.js.map +1 -0
- package/dist/targets/targetFactory.d.ts +13 -0
- package/dist/targets/targetFactory.d.ts.map +1 -0
- package/dist/targets/targetFactory.js +94 -0
- package/dist/targets/targetFactory.js.map +1 -0
- package/dist/targets/targetUtil.d.ts +16 -0
- package/dist/targets/targetUtil.d.ts.map +1 -0
- package/dist/targets/targetUtil.js +40 -0
- package/dist/targets/targetUtil.js.map +1 -0
- package/dist/targets/win/AppxCapabilities.d.ts +9 -0
- package/dist/targets/win/AppxCapabilities.d.ts.map +1 -0
- package/dist/targets/win/AppxCapabilities.js +254 -0
- package/dist/targets/win/AppxCapabilities.js.map +1 -0
- package/dist/targets/win/AppxTarget.d.ts +18 -0
- package/dist/targets/win/AppxTarget.d.ts.map +1 -0
- package/dist/targets/win/AppxTarget.js +398 -0
- package/dist/targets/win/AppxTarget.js.map +1 -0
- package/dist/targets/win/MsiTarget.d.ts +29 -0
- package/dist/targets/win/MsiTarget.d.ts.map +1 -0
- package/dist/targets/win/MsiTarget.js +268 -0
- package/dist/targets/win/MsiTarget.js.map +1 -0
- package/dist/targets/win/MsiWrappedTarget.d.ts +20 -0
- package/dist/targets/win/MsiWrappedTarget.d.ts.map +1 -0
- package/dist/targets/win/MsiWrappedTarget.js +77 -0
- package/dist/targets/win/MsiWrappedTarget.js.map +1 -0
- package/dist/targets/win/nsis/Commands.d.ts +10 -0
- package/dist/targets/win/nsis/Commands.d.ts.map +1 -0
- package/dist/targets/win/nsis/Commands.js +2 -0
- package/dist/targets/win/nsis/Commands.js.map +1 -0
- package/dist/targets/win/nsis/Defines.d.ts +81 -0
- package/dist/targets/win/nsis/Defines.d.ts.map +1 -0
- package/dist/targets/win/nsis/Defines.js +2 -0
- package/dist/targets/win/nsis/Defines.js.map +1 -0
- package/dist/targets/win/nsis/NsisTarget.d.ts +43 -0
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -0
- package/dist/targets/win/nsis/NsisTarget.js +726 -0
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -0
- package/dist/targets/win/nsis/WebInstallerTarget.d.ts +14 -0
- package/dist/targets/win/nsis/WebInstallerTarget.d.ts.map +1 -0
- package/dist/targets/win/nsis/WebInstallerTarget.js +43 -0
- package/dist/targets/win/nsis/WebInstallerTarget.js.map +1 -0
- package/dist/targets/win/nsis/nsisLang.d.ts +11 -0
- package/dist/targets/win/nsis/nsisLang.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisLang.js +94 -0
- package/dist/targets/win/nsis/nsisLang.js.map +1 -0
- package/dist/targets/win/nsis/nsisLicense.d.ts +5 -0
- package/dist/targets/win/nsis/nsisLicense.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisLicense.js +73 -0
- package/dist/targets/win/nsis/nsisLicense.js.map +1 -0
- package/dist/targets/win/nsis/nsisOptions.d.ts +275 -0
- package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisOptions.js +2 -0
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -0
- package/dist/targets/win/nsis/nsisScriptGenerator.d.ts +13 -0
- package/dist/targets/win/nsis/nsisScriptGenerator.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisScriptGenerator.js +59 -0
- package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -0
- package/dist/targets/win/nsis/nsisUtil.d.ts +26 -0
- package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisUtil.js +218 -0
- package/dist/targets/win/nsis/nsisUtil.js.map +1 -0
- package/dist/targets/win/nsis/nsisValidation.d.ts +19 -0
- package/dist/targets/win/nsis/nsisValidation.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisValidation.js +49 -0
- package/dist/targets/win/nsis/nsisValidation.js.map +1 -0
- package/dist/toolsets/7zip.d.ts +9 -0
- package/dist/toolsets/7zip.d.ts.map +1 -0
- package/dist/toolsets/7zip.js +80 -0
- package/dist/toolsets/7zip.js.map +1 -0
- package/dist/toolsets/appimage.d.ts +20 -0
- package/dist/toolsets/appimage.d.ts.map +1 -0
- package/dist/toolsets/appimage.js +67 -0
- package/dist/toolsets/appimage.js.map +1 -0
- package/dist/toolsets/custom.d.ts +5 -0
- package/dist/toolsets/custom.d.ts.map +1 -0
- package/dist/toolsets/custom.js +200 -0
- package/dist/toolsets/custom.js.map +1 -0
- package/dist/toolsets/fpm.d.ts +3 -0
- package/dist/toolsets/fpm.d.ts.map +1 -0
- package/dist/toolsets/fpm.js +49 -0
- package/dist/toolsets/fpm.js.map +1 -0
- package/dist/toolsets/icons.d.ts +12 -0
- package/dist/toolsets/icons.d.ts.map +1 -0
- package/dist/toolsets/icons.js +36 -0
- package/dist/toolsets/icons.js.map +1 -0
- package/dist/toolsets/linuxToolsMac.d.ts +8 -0
- package/dist/toolsets/linuxToolsMac.d.ts.map +1 -0
- package/dist/toolsets/linuxToolsMac.js +31 -0
- package/dist/toolsets/linuxToolsMac.js.map +1 -0
- package/dist/toolsets/nsis.d.ts +13 -0
- package/dist/toolsets/nsis.d.ts.map +1 -0
- package/dist/toolsets/nsis.js +100 -0
- package/dist/toolsets/nsis.js.map +1 -0
- package/dist/toolsets/winCodeSign.d.ts +42 -0
- package/dist/toolsets/winCodeSign.d.ts.map +1 -0
- package/dist/toolsets/winCodeSign.js +142 -0
- package/dist/toolsets/winCodeSign.js.map +1 -0
- package/dist/toolsets/wine.d.ts +6 -0
- package/dist/toolsets/wine.d.ts.map +1 -0
- package/dist/toolsets/wine.js +79 -0
- package/dist/toolsets/wine.js.map +1 -0
- package/dist/util/AppFileWalker.d.ts +14 -0
- package/dist/util/AppFileWalker.d.ts.map +1 -0
- package/dist/util/AppFileWalker.js +69 -0
- package/dist/util/AppFileWalker.js.map +1 -0
- package/dist/util/NodeModuleCopyHelper.d.ts +2 -0
- package/dist/util/NodeModuleCopyHelper.d.ts.map +1 -0
- package/dist/util/NodeModuleCopyHelper.js +160 -0
- package/dist/util/NodeModuleCopyHelper.js.map +1 -0
- package/dist/util/appFileCopier.d.ts +17 -0
- package/dist/util/appFileCopier.d.ts.map +1 -0
- package/dist/util/appFileCopier.js +190 -0
- package/dist/util/appFileCopier.js.map +1 -0
- package/dist/util/asyncEventEmitter.d.ts +34 -0
- package/dist/util/asyncEventEmitter.d.ts.map +1 -0
- package/dist/util/asyncEventEmitter.js +56 -0
- package/dist/util/asyncEventEmitter.js.map +1 -0
- package/dist/util/bundledTool.d.ts +8 -0
- package/dist/util/bundledTool.d.ts.map +1 -0
- package/dist/util/bundledTool.js +16 -0
- package/dist/util/bundledTool.js.map +1 -0
- package/dist/util/cacheManager.d.ts +19 -0
- package/dist/util/cacheManager.d.ts.map +1 -0
- package/dist/util/cacheManager.js +65 -0
- package/dist/util/cacheManager.js.map +1 -0
- package/dist/util/cacheState.d.ts +29 -0
- package/dist/util/cacheState.d.ts.map +1 -0
- package/dist/util/cacheState.js +134 -0
- package/dist/util/cacheState.js.map +1 -0
- package/dist/util/config/config.d.ts +13 -0
- package/dist/util/config/config.d.ts.map +1 -0
- package/dist/util/config/config.js +236 -0
- package/dist/util/config/config.js.map +1 -0
- package/dist/util/config/load.d.ts +20 -0
- package/dist/util/config/load.d.ts.map +1 -0
- package/dist/util/config/load.js +122 -0
- package/dist/util/config/load.js.map +1 -0
- package/dist/util/config/schemaValidator.d.ts +8 -0
- package/dist/util/config/schemaValidator.d.ts.map +1 -0
- package/dist/util/config/schemaValidator.js +161 -0
- package/dist/util/config/schemaValidator.js.map +1 -0
- package/dist/util/dynamicImport.d.ts +2 -0
- package/dist/util/dynamicImport.d.ts.map +1 -0
- package/dist/util/dynamicImport.js +9 -0
- package/dist/util/dynamicImport.js.map +1 -0
- package/dist/util/electronGet.d.ts +68 -0
- package/dist/util/electronGet.d.ts.map +1 -0
- package/dist/util/electronGet.js +560 -0
- package/dist/util/electronGet.js.map +1 -0
- package/dist/util/filter.d.ts +2 -0
- package/dist/util/filter.d.ts.map +1 -0
- package/dist/util/filter.js +64 -0
- package/dist/util/filter.js.map +1 -0
- package/dist/util/flags.d.ts +16 -0
- package/dist/util/flags.d.ts.map +1 -0
- package/dist/util/flags.js +53 -0
- package/dist/util/flags.js.map +1 -0
- package/dist/util/hash.d.ts +2 -0
- package/dist/util/hash.d.ts.map +1 -0
- package/dist/util/hash.js +16 -0
- package/dist/util/hash.js.map +1 -0
- package/dist/util/iconConverter.d.ts +29 -0
- package/dist/util/iconConverter.d.ts.map +1 -0
- package/dist/util/iconConverter.js +255 -0
- package/dist/util/iconConverter.js.map +1 -0
- package/dist/util/langs.d.ts +190 -0
- package/dist/util/langs.d.ts.map +1 -0
- package/dist/util/langs.js +432 -0
- package/dist/util/langs.js.map +1 -0
- package/dist/util/license.d.ts +17 -0
- package/dist/util/license.d.ts.map +1 -0
- package/dist/util/license.js +42 -0
- package/dist/util/license.js.map +1 -0
- package/dist/util/mac/macosIconComposer.d.ts +11 -0
- package/dist/util/mac/macosIconComposer.d.ts.map +1 -0
- package/dist/util/mac/macosIconComposer.js +99 -0
- package/dist/util/mac/macosIconComposer.js.map +1 -0
- package/dist/util/mac/macosVersion.d.ts +4 -0
- package/dist/util/mac/macosVersion.d.ts.map +1 -0
- package/dist/util/mac/macosVersion.js +31 -0
- package/dist/util/mac/macosVersion.js.map +1 -0
- package/dist/util/mac/plist.d.ts +8 -0
- package/dist/util/mac/plist.d.ts.map +1 -0
- package/dist/util/mac/plist.js +27 -0
- package/dist/util/mac/plist.js.map +1 -0
- package/dist/util/macroExpander.d.ts +4 -0
- package/dist/util/macroExpander.d.ts.map +1 -0
- package/dist/util/macroExpander.js +61 -0
- package/dist/util/macroExpander.js.map +1 -0
- package/dist/util/normalizePackageData.d.ts +2 -0
- package/dist/util/normalizePackageData.d.ts.map +1 -0
- package/dist/util/normalizePackageData.js +323 -0
- package/dist/util/normalizePackageData.js.map +1 -0
- package/dist/util/packageMetadata.d.ts +2 -0
- package/dist/util/packageMetadata.d.ts.map +1 -0
- package/dist/util/packageMetadata.js +118 -0
- package/dist/util/packageMetadata.js.map +1 -0
- package/dist/util/pathManager.d.ts +4 -0
- package/dist/util/pathManager.d.ts.map +1 -0
- package/dist/util/pathManager.js +17 -0
- package/dist/util/pathManager.js.map +1 -0
- package/dist/util/rebuild.d.ts +3 -0
- package/dist/util/rebuild.d.ts.map +1 -0
- package/dist/util/rebuild.js +54 -0
- package/dist/util/rebuild.js.map +1 -0
- package/dist/util/repositoryInfo.d.ts +4 -0
- package/dist/util/repositoryInfo.d.ts.map +1 -0
- package/dist/util/repositoryInfo.js +76 -0
- package/dist/util/repositoryInfo.js.map +1 -0
- package/dist/util/resolve.d.ts +3 -0
- package/dist/util/resolve.d.ts.map +1 -0
- package/dist/util/resolve.js +56 -0
- package/dist/util/resolve.js.map +1 -0
- package/dist/util/timer.d.ts +12 -0
- package/dist/util/timer.d.ts.map +1 -0
- package/dist/util/timer.js +23 -0
- package/dist/util/timer.js.map +1 -0
- package/dist/util/toolsetLock.d.ts +2 -0
- package/dist/util/toolsetLock.d.ts.map +1 -0
- package/dist/util/toolsetLock.js +20 -0
- package/dist/util/toolsetLock.js.map +1 -0
- package/dist/util/win/resEdit.d.ts +11 -0
- package/dist/util/win/resEdit.d.ts.map +1 -0
- package/dist/util/win/resEdit.js +46 -0
- package/dist/util/win/resEdit.js.map +1 -0
- package/dist/util/yarn.d.ts +23 -0
- package/dist/util/yarn.d.ts.map +1 -0
- package/dist/util/yarn.js +153 -0
- package/dist/util/yarn.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/vm/MonoVm.d.ts +9 -0
- package/dist/vm/MonoVm.d.ts.map +1 -0
- package/dist/vm/MonoVm.js +16 -0
- package/dist/vm/MonoVm.js.map +1 -0
- package/dist/vm/ParallelsVm.d.ts +24 -0
- package/dist/vm/ParallelsVm.d.ts.map +1 -0
- package/dist/vm/ParallelsVm.js +107 -0
- package/dist/vm/ParallelsVm.js.map +1 -0
- package/dist/vm/PwshVm.d.ts +7 -0
- package/dist/vm/PwshVm.d.ts.map +1 -0
- package/dist/vm/PwshVm.js +21 -0
- package/dist/vm/PwshVm.js.map +1 -0
- package/dist/vm/WineVm.d.ts +14 -0
- package/dist/vm/WineVm.d.ts.map +1 -0
- package/dist/vm/WineVm.js +35 -0
- package/dist/vm/WineVm.js.map +1 -0
- package/dist/vm/vm.d.ts +15 -0
- package/dist/vm/vm.d.ts.map +1 -0
- package/dist/vm/vm.js +81 -0
- package/dist/vm/vm.js.map +1 -0
- package/dist/winPackager.d.ts +30 -0
- package/dist/winPackager.d.ts.map +1 -0
- package/dist/winPackager.js +270 -0
- package/dist/winPackager.js.map +1 -0
- package/helpers/package.json +6 -0
- package/helpers/remote-rebuild.js +2 -4
- package/package.json +30 -33
- package/scheme.json +379 -721
- package/out/Framework.d.ts +0 -36
- package/out/Framework.js +0 -7
- package/out/Framework.js.map +0 -1
- package/out/ProtonFramework.d.ts +0 -10
- package/out/ProtonFramework.js +0 -94
- package/out/ProtonFramework.js.map +0 -1
- package/out/appInfo.d.ts +0 -31
- package/out/appInfo.js +0 -152
- package/out/appInfo.js.map +0 -1
- package/out/asar/asar.d.ts +0 -38
- package/out/asar/asar.js +0 -163
- package/out/asar/asar.js.map +0 -1
- package/out/asar/asarFileChecker.d.ts +0 -2
- package/out/asar/asarFileChecker.js +0 -25
- package/out/asar/asarFileChecker.js.map +0 -1
- package/out/asar/asarUtil.d.ts +0 -1
- package/out/asar/asarUtil.js +0 -285
- package/out/asar/asarUtil.js.map +0 -1
- package/out/asar/integrity.d.ts +0 -15
- package/out/asar/integrity.js +0 -62
- package/out/asar/integrity.js.map +0 -1
- package/out/asar/unpackDetector.d.ts +0 -1
- package/out/asar/unpackDetector.js +0 -43
- package/out/asar/unpackDetector.js.map +0 -1
- package/out/binDownload.d.ts +0 -5
- package/out/binDownload.js +0 -105
- package/out/binDownload.js.map +0 -1
- package/out/codeSign/certInfo.d.ts +0 -54
- package/out/codeSign/certInfo.js +0 -466
- package/out/codeSign/certInfo.js.map +0 -1
- package/out/codeSign/codesign.d.ts +0 -3
- package/out/codeSign/codesign.js +0 -33
- package/out/codeSign/codesign.js.map +0 -1
- package/out/codeSign/macCodeSign.d.ts +0 -28
- package/out/codeSign/macCodeSign.js +0 -284
- package/out/codeSign/macCodeSign.js.map +0 -1
- package/out/codeSign/signManager.d.ts +0 -13
- package/out/codeSign/signManager.js +0 -3
- package/out/codeSign/signManager.js.map +0 -1
- package/out/codeSign/windowsCodeSign.d.ts +0 -7
- package/out/codeSign/windowsCodeSign.js +0 -38
- package/out/codeSign/windowsCodeSign.js.map +0 -1
- package/out/codeSign/windowsSignAzureManager.d.ts +0 -17
- package/out/codeSign/windowsSignAzureManager.js +0 -73
- package/out/codeSign/windowsSignAzureManager.js.map +0 -1
- package/out/codeSign/windowsSignToolManager.d.ts +0 -58
- package/out/codeSign/windowsSignToolManager.js +0 -376
- package/out/codeSign/windowsSignToolManager.js.map +0 -1
- package/out/configuration.d.ts +0 -532
- package/out/configuration.js +0 -3
- package/out/configuration.js.map +0 -1
- package/out/core.d.ts +0 -60
- package/out/core.js +0 -66
- package/out/core.js.map +0 -1
- package/out/electron/ElectronFramework.d.ts +0 -16
- package/out/electron/ElectronFramework.js +0 -242
- package/out/electron/ElectronFramework.js.map +0 -1
- package/out/electron/electronMac.d.ts +0 -1
- package/out/electron/electronMac.js +0 -262
- package/out/electron/electronMac.js.map +0 -1
- package/out/electron/electronVersion.d.ts +0 -6
- package/out/electron/electronVersion.js +0 -125
- package/out/electron/electronVersion.js.map +0 -1
- package/out/electron/electronWin.d.ts +0 -1
- package/out/electron/electronWin.js +0 -38
- package/out/electron/electronWin.js.map +0 -1
- package/out/electron/injectFFMPEG.d.ts +0 -11
- package/out/electron/injectFFMPEG.js +0 -57
- package/out/electron/injectFFMPEG.js.map +0 -1
- package/out/electron/search-module.d.ts +0 -23
- package/out/electron/search-module.js +0 -73
- package/out/electron/search-module.js.map +0 -1
- package/out/errorMessages.d.ts +0 -1
- package/out/errorMessages.js +0 -11
- package/out/errorMessages.js.map +0 -1
- package/out/fileMatcher.d.ts +0 -29
- package/out/fileMatcher.js +0 -292
- package/out/fileMatcher.js.map +0 -1
- package/out/fileTransformer.d.ts +0 -1
- package/out/fileTransformer.js +0 -107
- package/out/fileTransformer.js.map +0 -1
- package/out/forge-maker.d.ts +0 -5
- package/out/forge-maker.js +0 -23
- package/out/forge-maker.js.map +0 -1
- package/out/frameworks/LibUiFramework.d.ts +0 -47
- package/out/frameworks/LibUiFramework.js +0 -197
- package/out/frameworks/LibUiFramework.js.map +0 -1
- package/out/index.d.ts +0 -39
- package/out/index.js +0 -99
- package/out/index.js.map +0 -1
- package/out/linuxPackager.d.ts +0 -12
- package/out/linuxPackager.js +0 -77
- package/out/linuxPackager.js.map +0 -1
- package/out/mac/MacTargetHelper.d.ts +0 -29
- package/out/mac/MacTargetHelper.js +0 -273
- package/out/mac/MacTargetHelper.js.map +0 -1
- package/out/macPackager.d.ts +0 -49
- package/out/macPackager.js +0 -445
- package/out/macPackager.js.map +0 -1
- package/out/node-module-collector/bunNodeModulesCollector.d.ts +0 -10
- package/out/node-module-collector/bunNodeModulesCollector.js +0 -18
- package/out/node-module-collector/bunNodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/hoist.d.ts +0 -123
- package/out/node-module-collector/hoist.js +0 -884
- package/out/node-module-collector/hoist.js.map +0 -1
- package/out/node-module-collector/index.d.ts +0 -18
- package/out/node-module-collector/index.js +0 -130
- package/out/node-module-collector/index.js.map +0 -1
- package/out/node-module-collector/moduleManager.d.ts +0 -93
- package/out/node-module-collector/moduleManager.js +0 -321
- package/out/node-module-collector/moduleManager.js.map +0 -1
- package/out/node-module-collector/nodeModulesCollector.d.ts +0 -137
- package/out/node-module-collector/nodeModulesCollector.js +0 -428
- package/out/node-module-collector/nodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/npmNodeModulesCollector.d.ts +0 -14
- package/out/node-module-collector/npmNodeModulesCollector.js +0 -80
- package/out/node-module-collector/npmNodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/packageManager.d.ts +0 -17
- package/out/node-module-collector/packageManager.js +0 -144
- package/out/node-module-collector/packageManager.js.map +0 -1
- package/out/node-module-collector/pnpmNodeModulesCollector.d.ts +0 -44
- package/out/node-module-collector/pnpmNodeModulesCollector.js +0 -191
- package/out/node-module-collector/pnpmNodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/traversalNodeModulesCollector.d.ts +0 -18
- package/out/node-module-collector/traversalNodeModulesCollector.js +0 -122
- package/out/node-module-collector/traversalNodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/types.d.ts +0 -52
- package/out/node-module-collector/types.js +0 -3
- package/out/node-module-collector/yarnBerryNodeModulesCollector.d.ts +0 -15
- package/out/node-module-collector/yarnBerryNodeModulesCollector.js +0 -93
- package/out/node-module-collector/yarnBerryNodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/yarnNodeModulesCollector.d.ts +0 -10
- package/out/node-module-collector/yarnNodeModulesCollector.js +0 -22
- package/out/node-module-collector/yarnNodeModulesCollector.js.map +0 -1
- package/out/options/AppXOptions.d.ts +0 -105
- package/out/options/AppXOptions.js +0 -3
- package/out/options/AppXOptions.js.map +0 -1
- package/out/options/CommonWindowsInstallerConfiguration.d.ts +0 -47
- package/out/options/CommonWindowsInstallerConfiguration.js +0 -51
- package/out/options/CommonWindowsInstallerConfiguration.js.map +0 -1
- package/out/options/FileAssociation.d.ts +0 -45
- package/out/options/FileAssociation.js +0 -3
- package/out/options/MsiOptions.d.ts +0 -26
- package/out/options/MsiOptions.js +0 -3
- package/out/options/MsiOptions.js.map +0 -1
- package/out/options/MsiWrappedOptions.d.ts +0 -26
- package/out/options/MsiWrappedOptions.js +0 -3
- package/out/options/MsiWrappedOptions.js.map +0 -1
- package/out/options/PlatformSpecificBuildOptions.d.ts +0 -238
- package/out/options/PlatformSpecificBuildOptions.js +0 -3
- package/out/options/PlatformSpecificBuildOptions.js.map +0 -1
- package/out/options/SnapOptions.d.ts +0 -500
- package/out/options/SnapOptions.js +0 -3
- package/out/options/SnapOptions.js.map +0 -1
- package/out/options/SquirrelWindowsOptions.d.ts +0 -46
- package/out/options/SquirrelWindowsOptions.js +0 -3
- package/out/options/SquirrelWindowsOptions.js.map +0 -1
- package/out/options/linuxOptions.d.ts +0 -287
- package/out/options/linuxOptions.js +0 -3
- package/out/options/linuxOptions.js.map +0 -1
- package/out/options/macOptions.d.ts +0 -388
- package/out/options/macOptions.js +0 -3
- package/out/options/macOptions.js.map +0 -1
- package/out/options/metadata.d.ts +0 -53
- package/out/options/metadata.js +0 -3
- package/out/options/metadata.js.map +0 -1
- package/out/options/pkgOptions.d.ts +0 -136
- package/out/options/pkgOptions.js +0 -3
- package/out/options/pkgOptions.js.map +0 -1
- package/out/options/winOptions.d.ts +0 -164
- package/out/options/winOptions.js +0 -3
- package/out/options/winOptions.js.map +0 -1
- package/out/packager.d.ts +0 -99
- package/out/packager.js +0 -515
- package/out/packager.js.map +0 -1
- package/out/packagerApi.d.ts +0 -31
- package/out/packagerApi.js +0 -3
- package/out/packagerApi.js.map +0 -1
- package/out/platformPackager.d.ts +0 -101
- package/out/platformPackager.js +0 -714
- package/out/platformPackager.js.map +0 -1
- package/out/presets/rectCra.d.ts +0 -1
- package/out/presets/rectCra.js +0 -22
- package/out/presets/rectCra.js.map +0 -1
- package/out/publish/PublishManager.d.ts +0 -30
- package/out/publish/PublishManager.js +0 -497
- package/out/publish/PublishManager.js.map +0 -1
- package/out/publish/updateInfoBuilder.d.ts +0 -14
- package/out/publish/updateInfoBuilder.js +0 -226
- package/out/publish/updateInfoBuilder.js.map +0 -1
- package/out/targets/AppxCapabilities.d.ts +0 -8
- package/out/targets/AppxCapabilities.js +0 -258
- package/out/targets/AppxCapabilities.js.map +0 -1
- package/out/targets/AppxTarget.d.ts +0 -17
- package/out/targets/AppxTarget.js +0 -403
- package/out/targets/AppxTarget.js.map +0 -1
- package/out/targets/ArchiveTarget.d.ts +0 -11
- package/out/targets/ArchiveTarget.js +0 -88
- package/out/targets/ArchiveTarget.js.map +0 -1
- package/out/targets/FlatpakTarget.d.ts +0 -20
- package/out/targets/FlatpakTarget.js +0 -159
- package/out/targets/FlatpakTarget.js.map +0 -1
- package/out/targets/FpmTarget.d.ts +0 -22
- package/out/targets/FpmTarget.js +0 -372
- package/out/targets/FpmTarget.js.map +0 -1
- package/out/targets/LinuxTargetHelper.d.ts +0 -23
- package/out/targets/LinuxTargetHelper.js +0 -346
- package/out/targets/LinuxTargetHelper.js.map +0 -1
- package/out/targets/MsiTarget.d.ts +0 -28
- package/out/targets/MsiTarget.js +0 -268
- package/out/targets/MsiTarget.js.map +0 -1
- package/out/targets/MsiWrappedTarget.d.ts +0 -19
- package/out/targets/MsiWrappedTarget.js +0 -80
- package/out/targets/MsiWrappedTarget.js.map +0 -1
- package/out/targets/appimage/AppImageTarget.d.ts +0 -15
- package/out/targets/appimage/AppImageTarget.js +0 -147
- package/out/targets/appimage/AppImageTarget.js.map +0 -1
- package/out/targets/appimage/appImageUtil.d.ts +0 -56
- package/out/targets/appimage/appImageUtil.js +0 -323
- package/out/targets/appimage/appImageUtil.js.map +0 -1
- package/out/targets/appimage/appLauncher.d.ts +0 -3
- package/out/targets/appimage/appLauncher.js +0 -95
- package/out/targets/appimage/appLauncher.js.map +0 -1
- package/out/targets/archive.d.ts +0 -26
- package/out/targets/archive.js +0 -178
- package/out/targets/archive.js.map +0 -1
- package/out/targets/blockmap/blockmap.d.ts +0 -16
- package/out/targets/blockmap/blockmap.js +0 -153
- package/out/targets/blockmap/blockmap.js.map +0 -1
- package/out/targets/differentialUpdateInfoBuilder.d.ts +0 -15
- package/out/targets/differentialUpdateInfoBuilder.js +0 -80
- package/out/targets/differentialUpdateInfoBuilder.js.map +0 -1
- package/out/targets/nsis/Commands.d.ts +0 -9
- package/out/targets/nsis/Commands.js +0 -3
- package/out/targets/nsis/Commands.js.map +0 -1
- package/out/targets/nsis/Defines.d.ts +0 -80
- package/out/targets/nsis/Defines.js +0 -3
- package/out/targets/nsis/Defines.js.map +0 -1
- package/out/targets/nsis/NsisTarget.d.ts +0 -37
- package/out/targets/nsis/NsisTarget.js +0 -729
- package/out/targets/nsis/NsisTarget.js.map +0 -1
- package/out/targets/nsis/WebInstallerTarget.d.ts +0 -13
- package/out/targets/nsis/WebInstallerTarget.js +0 -47
- package/out/targets/nsis/WebInstallerTarget.js.map +0 -1
- package/out/targets/nsis/nsisLang.d.ts +0 -10
- package/out/targets/nsis/nsisLang.js +0 -100
- package/out/targets/nsis/nsisLang.js.map +0 -1
- package/out/targets/nsis/nsisLicense.d.ts +0 -4
- package/out/targets/nsis/nsisLicense.js +0 -77
- package/out/targets/nsis/nsisLicense.js.map +0 -1
- package/out/targets/nsis/nsisOptions.d.ts +0 -274
- package/out/targets/nsis/nsisOptions.js +0 -3
- package/out/targets/nsis/nsisOptions.js.map +0 -1
- package/out/targets/nsis/nsisScriptGenerator.d.ts +0 -12
- package/out/targets/nsis/nsisScriptGenerator.js +0 -64
- package/out/targets/nsis/nsisScriptGenerator.js.map +0 -1
- package/out/targets/nsis/nsisUtil.d.ts +0 -25
- package/out/targets/nsis/nsisUtil.js +0 -225
- package/out/targets/nsis/nsisUtil.js.map +0 -1
- package/out/targets/nsis/nsisValidation.d.ts +0 -18
- package/out/targets/nsis/nsisValidation.js +0 -53
- package/out/targets/nsis/nsisValidation.js.map +0 -1
- package/out/targets/pkg.d.ts +0 -30
- package/out/targets/pkg.js +0 -279
- package/out/targets/pkg.js.map +0 -1
- package/out/targets/snap/SnapTarget.d.ts +0 -36
- package/out/targets/snap/SnapTarget.js +0 -105
- package/out/targets/snap/SnapTarget.js.map +0 -1
- package/out/targets/snap/core24.d.ts +0 -52
- package/out/targets/snap/core24.js +0 -449
- package/out/targets/snap/core24.js.map +0 -1
- package/out/targets/snap/coreCustom.d.ts +0 -28
- package/out/targets/snap/coreCustom.js +0 -63
- package/out/targets/snap/coreCustom.js.map +0 -1
- package/out/targets/snap/coreLegacy.d.ts +0 -43
- package/out/targets/snap/coreLegacy.js +0 -416
- package/out/targets/snap/coreLegacy.js.map +0 -1
- package/out/targets/snap/snapcraftBuilder.d.ts +0 -39
- package/out/targets/snap/snapcraftBuilder.js +0 -419
- package/out/targets/snap/snapcraftBuilder.js.map +0 -1
- package/out/targets/targetFactory.d.ts +0 -12
- package/out/targets/targetFactory.js +0 -101
- package/out/targets/targetFactory.js.map +0 -1
- package/out/targets/targetUtil.d.ts +0 -14
- package/out/targets/targetUtil.js +0 -47
- package/out/targets/targetUtil.js.map +0 -1
- package/out/toolsets/7zip.d.ts +0 -2
- package/out/toolsets/7zip.js +0 -72
- package/out/toolsets/7zip.js.map +0 -1
- package/out/toolsets/icons.d.ts +0 -8
- package/out/toolsets/icons.js +0 -37
- package/out/toolsets/icons.js.map +0 -1
- package/out/toolsets/linux.d.ts +0 -26
- package/out/toolsets/linux.js +0 -146
- package/out/toolsets/linux.js.map +0 -1
- package/out/toolsets/windows.d.ts +0 -61
- package/out/toolsets/windows.js +0 -259
- package/out/toolsets/windows.js.map +0 -1
- package/out/toolsets/wine.d.ts +0 -5
- package/out/toolsets/wine.js +0 -100
- package/out/toolsets/wine.js.map +0 -1
- package/out/util/AppFileWalker.d.ts +0 -13
- package/out/util/AppFileWalker.js +0 -74
- package/out/util/AppFileWalker.js.map +0 -1
- package/out/util/NodeModuleCopyHelper.d.ts +0 -1
- package/out/util/NodeModuleCopyHelper.js +0 -165
- package/out/util/NodeModuleCopyHelper.js.map +0 -1
- package/out/util/appFileCopier.d.ts +0 -16
- package/out/util/appFileCopier.js +0 -251
- package/out/util/appFileCopier.js.map +0 -1
- package/out/util/asyncEventEmitter.d.ts +0 -33
- package/out/util/asyncEventEmitter.js +0 -63
- package/out/util/asyncEventEmitter.js.map +0 -1
- package/out/util/bundledTool.d.ts +0 -7
- package/out/util/bundledTool.js +0 -20
- package/out/util/bundledTool.js.map +0 -1
- package/out/util/cacheManager.d.ts +0 -18
- package/out/util/cacheManager.js +0 -70
- package/out/util/cacheManager.js.map +0 -1
- package/out/util/cacheState.d.ts +0 -28
- package/out/util/cacheState.js +0 -143
- package/out/util/cacheState.js.map +0 -1
- package/out/util/config/config.d.ts +0 -12
- package/out/util/config/config.js +0 -256
- package/out/util/config/config.js.map +0 -1
- package/out/util/config/load.d.ts +0 -19
- package/out/util/config/load.js +0 -129
- package/out/util/config/load.js.map +0 -1
- package/out/util/config/schemaValidator.d.ts +0 -7
- package/out/util/config/schemaValidator.js +0 -154
- package/out/util/config/schemaValidator.js.map +0 -1
- package/out/util/dynamicImport.d.ts +0 -1
- package/out/util/dynamicImport.js +0 -12
- package/out/util/dynamicImport.js.map +0 -1
- package/out/util/electronGet.d.ts +0 -61
- package/out/util/electronGet.js +0 -524
- package/out/util/electronGet.js.map +0 -1
- package/out/util/envPath.d.ts +0 -2
- package/out/util/envPath.js +0 -28
- package/out/util/envPath.js.map +0 -1
- package/out/util/filter.d.ts +0 -1
- package/out/util/filter.js +0 -68
- package/out/util/filter.js.map +0 -1
- package/out/util/flags.d.ts +0 -3
- package/out/util/flags.js +0 -16
- package/out/util/flags.js.map +0 -1
- package/out/util/hash.d.ts +0 -1
- package/out/util/hash.js +0 -19
- package/out/util/hash.js.map +0 -1
- package/out/util/iconConverter.d.ts +0 -25
- package/out/util/iconConverter.js +0 -260
- package/out/util/iconConverter.js.map +0 -1
- package/out/util/langs.d.ts +0 -189
- package/out/util/langs.js +0 -436
- package/out/util/langs.js.map +0 -1
- package/out/util/license.d.ts +0 -16
- package/out/util/license.js +0 -47
- package/out/util/license.js.map +0 -1
- package/out/util/macosIconComposer.d.ts +0 -10
- package/out/util/macosIconComposer.js +0 -102
- package/out/util/macosIconComposer.js.map +0 -1
- package/out/util/macosVersion.d.ts +0 -3
- package/out/util/macosVersion.js +0 -36
- package/out/util/macosVersion.js.map +0 -1
- package/out/util/macroExpander.d.ts +0 -3
- package/out/util/macroExpander.js +0 -64
- package/out/util/macroExpander.js.map +0 -1
- package/out/util/normalizePackageData.d.ts +0 -1
- package/out/util/normalizePackageData.js +0 -328
- package/out/util/normalizePackageData.js.map +0 -1
- package/out/util/packageDependencies.d.ts +0 -6
- package/out/util/packageDependencies.js +0 -3
- package/out/util/packageDependencies.js.map +0 -1
- package/out/util/packageMetadata.d.ts +0 -1
- package/out/util/packageMetadata.js +0 -124
- package/out/util/packageMetadata.js.map +0 -1
- package/out/util/pathManager.d.ts +0 -3
- package/out/util/pathManager.js +0 -23
- package/out/util/pathManager.js.map +0 -1
- package/out/util/plist.d.ts +0 -7
- package/out/util/plist.js +0 -31
- package/out/util/plist.js.map +0 -1
- package/out/util/rebuild.d.ts +0 -2
- package/out/util/rebuild.js +0 -60
- package/out/util/rebuild.js.map +0 -1
- package/out/util/repositoryInfo.d.ts +0 -3
- package/out/util/repositoryInfo.js +0 -79
- package/out/util/repositoryInfo.js.map +0 -1
- package/out/util/resEdit.d.ts +0 -10
- package/out/util/resEdit.js +0 -49
- package/out/util/resEdit.js.map +0 -1
- package/out/util/resolve.d.ts +0 -2
- package/out/util/resolve.js +0 -59
- package/out/util/resolve.js.map +0 -1
- package/out/util/timer.d.ts +0 -11
- package/out/util/timer.js +0 -28
- package/out/util/timer.js.map +0 -1
- package/out/util/toolsetLock.d.ts +0 -1
- package/out/util/toolsetLock.js +0 -23
- package/out/util/toolsetLock.js.map +0 -1
- package/out/util/yarn.d.ts +0 -22
- package/out/util/yarn.js +0 -160
- package/out/util/yarn.js.map +0 -1
- package/out/version.d.ts +0 -1
- package/out/version.js +0 -5
- package/out/version.js.map +0 -1
- package/out/vm/MonoVm.d.ts +0 -8
- package/out/vm/MonoVm.js +0 -20
- package/out/vm/MonoVm.js.map +0 -1
- package/out/vm/ParallelsVm.d.ts +0 -23
- package/out/vm/ParallelsVm.js +0 -102
- package/out/vm/ParallelsVm.js.map +0 -1
- package/out/vm/PwshVm.d.ts +0 -6
- package/out/vm/PwshVm.js +0 -25
- package/out/vm/PwshVm.js.map +0 -1
- package/out/vm/WineVm.d.ts +0 -12
- package/out/vm/WineVm.js +0 -38
- package/out/vm/WineVm.js.map +0 -1
- package/out/vm/vm.d.ts +0 -14
- package/out/vm/vm.js +0 -88
- package/out/vm/vm.js.map +0 -1
- package/out/winPackager.d.ts +0 -29
- package/out/winPackager.js +0 -271
- package/out/winPackager.js.map +0 -1
- /package/{out → dist}/node-module-collector/types.js.map +0 -0
- /package/{out → dist}/options/FileAssociation.js.map +0 -0
- /package/helpers/{dynamic-import.js → dynamic-import.cjs} +0 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { exists, isEmptyOrSpaces, log } from "builder-util";
|
|
2
|
+
import { dynamicImport } from "../util/dynamicImport.js";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import * as path from "path";
|
|
5
|
+
import { getDestinationPath } from "../util/appFileCopier.js";
|
|
6
|
+
import { detectUnpackedDirs } from "./unpackDetector.js";
|
|
7
|
+
import { Readable } from "stream";
|
|
8
|
+
import * as os from "os";
|
|
9
|
+
const { readlink } = fs;
|
|
10
|
+
const resolvePath = async (file) => (file && (await exists(file)) ? fs.realpath(file).catch(() => path.resolve(file)) : undefined);
|
|
11
|
+
const resolvePaths = async (filepaths) => {
|
|
12
|
+
return Promise.all(filepaths.map(resolvePath)).then(paths => paths.filter((it) => it != null));
|
|
13
|
+
};
|
|
14
|
+
const DENYLIST = resolvePaths([
|
|
15
|
+
"/usr",
|
|
16
|
+
"/lib",
|
|
17
|
+
"/bin",
|
|
18
|
+
"/sbin",
|
|
19
|
+
"/etc",
|
|
20
|
+
"/tmp",
|
|
21
|
+
"/var", // block whole /var by default. If $HOME is under /var, it's explicitly in ALLOWLIST - https://github.com/electron-userland/electron-builder/issues/9025#issuecomment-3575380041
|
|
22
|
+
// macOS system directories
|
|
23
|
+
"/System",
|
|
24
|
+
"/Library",
|
|
25
|
+
"/private",
|
|
26
|
+
// Windows system directories
|
|
27
|
+
process.env.SystemRoot,
|
|
28
|
+
process.env.WINDIR,
|
|
29
|
+
]);
|
|
30
|
+
const ALLOWLIST = resolvePaths([
|
|
31
|
+
os.tmpdir(), // always allow temp dir
|
|
32
|
+
os.homedir(), // always allow home dir
|
|
33
|
+
]);
|
|
34
|
+
/** @internal */
|
|
35
|
+
export class AsarPackager {
|
|
36
|
+
constructor(packager, config) {
|
|
37
|
+
this.packager = packager;
|
|
38
|
+
this.config = config;
|
|
39
|
+
this.outFile = path.join(config.resourcePath, `app.asar`);
|
|
40
|
+
}
|
|
41
|
+
async pack(fileSets) {
|
|
42
|
+
const orderedFileSets = [
|
|
43
|
+
// Write dependencies first to minimize offset changes to asar header
|
|
44
|
+
...fileSets.slice(1),
|
|
45
|
+
// Finish with the app files that change most often
|
|
46
|
+
fileSets[0],
|
|
47
|
+
].map(set => this.orderFileSet(set));
|
|
48
|
+
const streams = await this.processFileSets(orderedFileSets);
|
|
49
|
+
await this.executeElectronAsar(streams);
|
|
50
|
+
}
|
|
51
|
+
async executeElectronAsar(streams) {
|
|
52
|
+
// override logger temporarily to clean up console (electron/asar does some internal logging that blogs up the default electron-builder logs)
|
|
53
|
+
const consoleLogger = console.log;
|
|
54
|
+
console.log = (...args) => {
|
|
55
|
+
if (args[0] === "Ordering file has 100% coverage.") {
|
|
56
|
+
return; // no need to log, this means our ordering logic is working correctly
|
|
57
|
+
}
|
|
58
|
+
log.info({ args }, "logging @electron/asar");
|
|
59
|
+
};
|
|
60
|
+
const { createPackageFromStreams } = await dynamicImport("@electron/asar");
|
|
61
|
+
await createPackageFromStreams(this.outFile, streams);
|
|
62
|
+
console.log = consoleLogger;
|
|
63
|
+
}
|
|
64
|
+
async processFileSets(fileSets) {
|
|
65
|
+
const unpackedPaths = new Set();
|
|
66
|
+
if (this.config.options.smartUnpack !== false) {
|
|
67
|
+
for (const fileSet of fileSets) {
|
|
68
|
+
detectUnpackedDirs(fileSet, unpackedPaths);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const resultsMap = new Map();
|
|
72
|
+
const streamOrdering = [];
|
|
73
|
+
const normalizedUnpackedPaths = Array.from(unpackedPaths).map(p => path.normalize(p));
|
|
74
|
+
// Check whether a file or directory should be unpacked, using pre-normalized unpacked paths and early returns
|
|
75
|
+
const isUnpacked = (dir, file, stat) => {
|
|
76
|
+
const normalizedDir = path.normalize(dir);
|
|
77
|
+
// Check file pattern first (most specific)
|
|
78
|
+
if (!isEmptyOrSpaces(file) && stat && this.config.unpackPattern?.(file, stat)) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
// Check if path is within any unpacked directory
|
|
82
|
+
for (const unpackedPath of normalizedUnpackedPaths) {
|
|
83
|
+
if (normalizedDir === unpackedPath || normalizedDir.startsWith(unpackedPath + path.sep)) {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
};
|
|
89
|
+
// First pass: process all files in order, ensuring parent directories exist
|
|
90
|
+
for (const fileSet of fileSets) {
|
|
91
|
+
// Don't use Promise.all, we need to retain order of execution/iteration through the already-ordered fileset
|
|
92
|
+
for (const [index, file] of fileSet.files.entries()) {
|
|
93
|
+
const transformedData = fileSet.transformedFiles?.get(index);
|
|
94
|
+
const stat = fileSet.metadata.get(file);
|
|
95
|
+
const destination = path.relative(this.config.defaultDestination, getDestinationPath(file, fileSet));
|
|
96
|
+
// Ensure parent directories exist before processing file
|
|
97
|
+
this.ensureParentDirectories(destination, resultsMap, streamOrdering);
|
|
98
|
+
const result = await this.processFileOrSymlink({
|
|
99
|
+
file,
|
|
100
|
+
destination,
|
|
101
|
+
fileSet,
|
|
102
|
+
transformedData,
|
|
103
|
+
stat,
|
|
104
|
+
isUnpacked,
|
|
105
|
+
});
|
|
106
|
+
if (result && !resultsMap.has(result.path)) {
|
|
107
|
+
resultsMap.set(result.path, result);
|
|
108
|
+
streamOrdering.push(result.path);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// Second pass: propagate unpacked flag to parent directories
|
|
113
|
+
for (const entry of resultsMap.values()) {
|
|
114
|
+
if (entry.unpacked) {
|
|
115
|
+
this.markParentDirectoriesAsUnpacked(entry.path, resultsMap, isUnpacked);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Build final results array maintaining processing order
|
|
119
|
+
return streamOrdering.reduce((streams, path) => {
|
|
120
|
+
const stream = resultsMap.has(path) ? resultsMap.get(path) : null;
|
|
121
|
+
if (stream != null) {
|
|
122
|
+
streams.push(stream);
|
|
123
|
+
}
|
|
124
|
+
return streams;
|
|
125
|
+
}, []);
|
|
126
|
+
}
|
|
127
|
+
ensureParentDirectories(destination, resultsMap, streamOrdering) {
|
|
128
|
+
const parents = [];
|
|
129
|
+
let current = path.dirname(path.normalize(destination));
|
|
130
|
+
// Collect all parent directories from deepest to root
|
|
131
|
+
while (current !== ".") {
|
|
132
|
+
parents.unshift(current);
|
|
133
|
+
current = path.dirname(current);
|
|
134
|
+
}
|
|
135
|
+
// Add parent directories in order (root to deepest)
|
|
136
|
+
for (const parentPath of parents) {
|
|
137
|
+
if (!resultsMap.has(parentPath)) {
|
|
138
|
+
const dir = {
|
|
139
|
+
type: "directory",
|
|
140
|
+
path: parentPath,
|
|
141
|
+
unpacked: false, // Updated in second pass if needed
|
|
142
|
+
};
|
|
143
|
+
resultsMap.set(parentPath, dir);
|
|
144
|
+
streamOrdering.push(parentPath);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
markParentDirectoriesAsUnpacked(destination, resultsMap, isUnpacked) {
|
|
149
|
+
let current = path.dirname(path.normalize(destination));
|
|
150
|
+
while (current !== ".") {
|
|
151
|
+
const entry = resultsMap.get(current);
|
|
152
|
+
if (entry && isUnpacked(current)) {
|
|
153
|
+
entry.unpacked = true;
|
|
154
|
+
}
|
|
155
|
+
current = path.dirname(current);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
async processFileOrSymlink(options) {
|
|
159
|
+
const { isUnpacked, transformedData, file, destination, stat } = options;
|
|
160
|
+
const unpacked = isUnpacked(destination, file, stat);
|
|
161
|
+
// Handle directories
|
|
162
|
+
if (!stat.isFile() && !stat.isSymbolicLink()) {
|
|
163
|
+
return { path: destination, unpacked, type: "directory" };
|
|
164
|
+
}
|
|
165
|
+
// Handle transformed data (pre-processed content)
|
|
166
|
+
if (transformedData != null) {
|
|
167
|
+
const size = Buffer.byteLength(transformedData);
|
|
168
|
+
return {
|
|
169
|
+
path: destination,
|
|
170
|
+
streamGenerator: () => new Readable({
|
|
171
|
+
read() {
|
|
172
|
+
this.push(transformedData);
|
|
173
|
+
this.push(null);
|
|
174
|
+
},
|
|
175
|
+
}),
|
|
176
|
+
unpacked,
|
|
177
|
+
type: "file",
|
|
178
|
+
stat: { mode: stat.mode, size },
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
// verify that the file is not a direct link or symlinked to access/copy a system file
|
|
182
|
+
await this.protectSystemAndUnsafePaths(file, await this.packager.getWorkspaceRoot());
|
|
183
|
+
const baseConfig = {
|
|
184
|
+
path: destination,
|
|
185
|
+
streamGenerator: () => fs.createReadStream(file),
|
|
186
|
+
unpacked,
|
|
187
|
+
stat,
|
|
188
|
+
};
|
|
189
|
+
// Handle regular files
|
|
190
|
+
if (!stat.isSymbolicLink()) {
|
|
191
|
+
return { ...baseConfig, type: "file" };
|
|
192
|
+
}
|
|
193
|
+
// Handle symlinks - make relative to source location
|
|
194
|
+
let link = await readlink(file);
|
|
195
|
+
if (path.isAbsolute(link)) {
|
|
196
|
+
link = path.relative(path.dirname(file), link);
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
...baseConfig,
|
|
200
|
+
type: "link",
|
|
201
|
+
symlink: link,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
orderFileSet(fileSet) {
|
|
205
|
+
const sortedFileEntries = Array.from(fileSet.files.entries());
|
|
206
|
+
sortedFileEntries.sort(([, a], [, b]) => {
|
|
207
|
+
if (a === b) {
|
|
208
|
+
return 0;
|
|
209
|
+
}
|
|
210
|
+
// Place addons last because their signature changes per build
|
|
211
|
+
const isAAddon = a.endsWith(".node");
|
|
212
|
+
const isBAddon = b.endsWith(".node");
|
|
213
|
+
if (isAAddon && !isBAddon) {
|
|
214
|
+
return 1;
|
|
215
|
+
}
|
|
216
|
+
if (isBAddon && !isAAddon) {
|
|
217
|
+
return -1;
|
|
218
|
+
}
|
|
219
|
+
// Otherwise order by name
|
|
220
|
+
return a < b ? -1 : 1;
|
|
221
|
+
});
|
|
222
|
+
let transformedFiles;
|
|
223
|
+
if (fileSet.transformedFiles) {
|
|
224
|
+
transformedFiles = new Map();
|
|
225
|
+
const indexMap = new Map();
|
|
226
|
+
for (const [newIndex, [oldIndex]] of sortedFileEntries.entries()) {
|
|
227
|
+
indexMap.set(oldIndex, newIndex);
|
|
228
|
+
}
|
|
229
|
+
for (const [oldIndex, value] of fileSet.transformedFiles) {
|
|
230
|
+
const newIndex = indexMap.get(oldIndex);
|
|
231
|
+
if (newIndex === undefined) {
|
|
232
|
+
throw new Error(`Internal error: ${fileSet.files[oldIndex]} was lost while ordering asar`);
|
|
233
|
+
}
|
|
234
|
+
transformedFiles.set(newIndex, value);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
src: fileSet.src,
|
|
239
|
+
destination: fileSet.destination,
|
|
240
|
+
metadata: fileSet.metadata,
|
|
241
|
+
files: sortedFileEntries.map(([, file]) => file),
|
|
242
|
+
transformedFiles,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
async checkAgainstRoots(target, allowRoots) {
|
|
246
|
+
const resolved = await resolvePath(target);
|
|
247
|
+
if (resolved == null || isEmptyOrSpaces(resolved)) {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
for (const root of allowRoots) {
|
|
251
|
+
if (resolved === root || resolved.startsWith(root + path.sep)) {
|
|
252
|
+
return true;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
async protectSystemAndUnsafePaths(file, workspaceRoot) {
|
|
258
|
+
const resolved = await resolvePath(file);
|
|
259
|
+
const logFields = { source: file, realPath: resolved };
|
|
260
|
+
const workspace = await resolvePath(workspaceRoot);
|
|
261
|
+
// If in workspace, always safe
|
|
262
|
+
if (workspace && resolved?.startsWith(workspace)) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
// Check allowlist (priority)
|
|
266
|
+
if (await this.checkAgainstRoots(file, await ALLOWLIST)) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
// Check denylist
|
|
270
|
+
if (await this.checkAgainstRoots(file, await DENYLIST)) {
|
|
271
|
+
log.error(logFields, `denied access to system or unsafe path`);
|
|
272
|
+
throw new Error(`Cannot copy file [${file}] symlinked to file [${resolved}] outside the package to a system or unsafe path`);
|
|
273
|
+
}
|
|
274
|
+
// Default: outside explicit paths but not explicitly denied
|
|
275
|
+
log.debug(logFields, `path is outside of explicit safe paths, defaulting to safe`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=asarUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asarUtil.js","sourceRoot":"","sources":["../../src/asar/asarUtil.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAuB,eAAe,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,MAAM,UAAU,CAAA;AAEzB,OAAO,KAAK,IAAI,MAAM,MAAM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C9D,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,wBAAwB,QAAQ,kDAAkD,CAAC,CAAA;QAC9H,CAAC;QAED,4DAA4D;QAC5D,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,4DAA4D,CAAC,CAAA;IACpF,CAAC;CACF","sourcesContent":["import type { AsarStreamType, AsarDirectory } from \"@electron/asar\"\nimport { exists, Filter, FilterStats, isEmptyOrSpaces, log } from \"builder-util\"\nimport { dynamicImport } from \"../util/dynamicImport.js\"\nimport fs from \"fs-extra\"\n\nimport * as path from \"path\"\nimport { AsarOptions } from \"../options/PlatformSpecificBuildOptions.js\"\nimport { PlatformPackager } from \"../platformPackager.js\"\nimport { ResolvedFileSet, getDestinationPath } from \"../util/appFileCopier.js\"\nimport { detectUnpackedDirs } from \"./unpackDetector.js\"\nimport { Readable } from \"stream\"\nimport * as os from \"os\"\nconst { readlink } = fs\n\nconst resolvePath = async (file: string | undefined): Promise<string | undefined> => (file && (await exists(file)) ? fs.realpath(file).catch(() => path.resolve(file)) : undefined)\nconst resolvePaths = async (filepaths: (string | undefined)[]) => {\n return Promise.all(filepaths.map(resolvePath)).then(paths => paths.filter((it): it is string => it != null))\n}\n\nconst DENYLIST = resolvePaths([\n \"/usr\",\n \"/lib\",\n \"/bin\",\n \"/sbin\",\n \"/etc\",\n\n \"/tmp\",\n \"/var\", // block whole /var by default. If $HOME is under /var, it's explicitly in ALLOWLIST - https://github.com/electron-userland/electron-builder/issues/9025#issuecomment-3575380041\n\n // macOS system directories\n \"/System\",\n \"/Library\",\n \"/private\",\n\n // Windows system directories\n process.env.SystemRoot,\n process.env.WINDIR,\n])\n\nconst ALLOWLIST = resolvePaths([\n os.tmpdir(), // always allow temp dir\n os.homedir(), // always allow home dir\n])\n\n/** @internal */\nexport class AsarPackager {\n private readonly outFile: string\n\n constructor(\n readonly packager: PlatformPackager<any>,\n private readonly config: {\n defaultDestination: string\n resourcePath: string\n options: AsarOptions\n unpackPattern: Filter | undefined\n }\n ) {\n this.outFile = path.join(config.resourcePath, `app.asar`)\n }\n\n async pack(fileSets: Array<ResolvedFileSet>) {\n const orderedFileSets = [\n // Write dependencies first to minimize offset changes to asar header\n ...fileSets.slice(1),\n\n // Finish with the app files that change most often\n fileSets[0],\n ].map(set => this.orderFileSet(set))\n\n const streams = await this.processFileSets(orderedFileSets)\n await this.executeElectronAsar(streams)\n }\n\n private async executeElectronAsar(streams: AsarStreamType[]) {\n // override logger temporarily to clean up console (electron/asar does some internal logging that blogs up the default electron-builder logs)\n const consoleLogger = console.log\n console.log = (...args) => {\n if (args[0] === \"Ordering file has 100% coverage.\") {\n return // no need to log, this means our ordering logic is working correctly\n }\n log.info({ args }, \"logging @electron/asar\")\n }\n const { createPackageFromStreams } = await dynamicImport<typeof import(\"@electron/asar\")>(\"@electron/asar\")\n await createPackageFromStreams(this.outFile, streams)\n console.log = consoleLogger\n }\n\n private async processFileSets(fileSets: ResolvedFileSet[]): Promise<AsarStreamType[]> {\n const unpackedPaths = new Set<string>()\n if (this.config.options.smartUnpack !== false) {\n for (const fileSet of fileSets) {\n detectUnpackedDirs(fileSet, unpackedPaths)\n }\n }\n\n const resultsMap = new Map<string, AsarStreamType>()\n const streamOrdering: string[] = []\n const normalizedUnpackedPaths = Array.from(unpackedPaths).map(p => path.normalize(p))\n\n // Check whether a file or directory should be unpacked, using pre-normalized unpacked paths and early returns\n const isUnpacked = (dir: string, file?: string, stat?: FilterStats): boolean => {\n const normalizedDir = path.normalize(dir)\n\n // Check file pattern first (most specific)\n if (!isEmptyOrSpaces(file) && stat && this.config.unpackPattern?.(file, stat)) {\n return true\n }\n\n // Check if path is within any unpacked directory\n for (const unpackedPath of normalizedUnpackedPaths) {\n if (normalizedDir === unpackedPath || normalizedDir.startsWith(unpackedPath + path.sep)) {\n return true\n }\n }\n\n return false\n }\n\n // First pass: process all files in order, ensuring parent directories exist\n for (const fileSet of fileSets) {\n // Don't use Promise.all, we need to retain order of execution/iteration through the already-ordered fileset\n for (const [index, file] of fileSet.files.entries()) {\n const transformedData = fileSet.transformedFiles?.get(index)\n const stat = fileSet.metadata.get(file)!\n const destination = path.relative(this.config.defaultDestination, getDestinationPath(file, fileSet))\n\n // Ensure parent directories exist before processing file\n this.ensureParentDirectories(destination, resultsMap, streamOrdering)\n\n const result = await this.processFileOrSymlink({\n file,\n destination,\n fileSet,\n transformedData,\n stat,\n isUnpacked,\n })\n\n if (result && !resultsMap.has(result.path)) {\n resultsMap.set(result.path, result)\n streamOrdering.push(result.path)\n }\n }\n }\n\n // Second pass: propagate unpacked flag to parent directories\n for (const entry of resultsMap.values()) {\n if (entry.unpacked) {\n this.markParentDirectoriesAsUnpacked(entry.path, resultsMap, isUnpacked)\n }\n }\n\n // Build final results array maintaining processing order\n return streamOrdering.reduce<AsarStreamType[]>((streams, path) => {\n const stream = resultsMap.has(path) ? resultsMap.get(path) : null\n if (stream != null) {\n streams.push(stream)\n }\n return streams\n }, [])\n }\n\n private ensureParentDirectories(destination: string, resultsMap: Map<string, AsarStreamType>, streamOrdering: string[]): void {\n const parents: string[] = []\n let current = path.dirname(path.normalize(destination))\n\n // Collect all parent directories from deepest to root\n while (current !== \".\") {\n parents.unshift(current)\n current = path.dirname(current)\n }\n\n // Add parent directories in order (root to deepest)\n for (const parentPath of parents) {\n if (!resultsMap.has(parentPath)) {\n const dir: AsarDirectory = {\n type: \"directory\",\n path: parentPath,\n unpacked: false, // Updated in second pass if needed\n }\n resultsMap.set(parentPath, dir)\n streamOrdering.push(parentPath)\n }\n }\n }\n\n private markParentDirectoriesAsUnpacked(destination: string, resultsMap: Map<string, AsarStreamType>, isUnpacked: (path: string) => boolean): void {\n let current = path.dirname(path.normalize(destination))\n\n while (current !== \".\") {\n const entry = resultsMap.get(current)\n if (entry && isUnpacked(current)) {\n entry.unpacked = true\n }\n current = path.dirname(current)\n }\n }\n\n private async processFileOrSymlink(options: {\n file: string\n destination: string\n stat: fs.Stats\n fileSet: ResolvedFileSet\n transformedData: string | Buffer | undefined\n isUnpacked: (dir: string, file?: string, stat?: FilterStats) => boolean\n }): Promise<AsarStreamType> {\n const { isUnpacked, transformedData, file, destination, stat } = options\n const unpacked = isUnpacked(destination, file, stat)\n\n // Handle directories\n if (!stat.isFile() && !stat.isSymbolicLink()) {\n return { path: destination, unpacked, type: \"directory\" }\n }\n\n // Handle transformed data (pre-processed content)\n if (transformedData != null) {\n const size = Buffer.byteLength(transformedData)\n return {\n path: destination,\n streamGenerator: () =>\n new Readable({\n read() {\n this.push(transformedData)\n this.push(null)\n },\n }),\n unpacked,\n type: \"file\",\n stat: { mode: stat.mode, size },\n }\n }\n\n // verify that the file is not a direct link or symlinked to access/copy a system file\n await this.protectSystemAndUnsafePaths(file, await this.packager.getWorkspaceRoot())\n\n const baseConfig = {\n path: destination,\n streamGenerator: () => fs.createReadStream(file),\n unpacked,\n stat,\n }\n\n // Handle regular files\n if (!stat.isSymbolicLink()) {\n return { ...baseConfig, type: \"file\" }\n }\n\n // Handle symlinks - make relative to source location\n let link = await readlink(file)\n if (path.isAbsolute(link)) {\n link = path.relative(path.dirname(file), link)\n }\n\n return {\n ...baseConfig,\n type: \"link\",\n symlink: link,\n }\n }\n\n private orderFileSet(fileSet: ResolvedFileSet): ResolvedFileSet {\n const sortedFileEntries = Array.from(fileSet.files.entries())\n\n sortedFileEntries.sort(([, a], [, b]) => {\n if (a === b) {\n return 0\n }\n\n // Place addons last because their signature changes per build\n const isAAddon = a.endsWith(\".node\")\n const isBAddon = b.endsWith(\".node\")\n if (isAAddon && !isBAddon) {\n return 1\n }\n if (isBAddon && !isAAddon) {\n return -1\n }\n\n // Otherwise order by name\n return a < b ? -1 : 1\n })\n\n let transformedFiles: Map<number, string | Buffer> | undefined\n if (fileSet.transformedFiles) {\n transformedFiles = new Map()\n\n const indexMap = new Map<number, number>()\n for (const [newIndex, [oldIndex]] of sortedFileEntries.entries()) {\n indexMap.set(oldIndex, newIndex)\n }\n\n for (const [oldIndex, value] of fileSet.transformedFiles) {\n const newIndex = indexMap.get(oldIndex)\n if (newIndex === undefined) {\n throw new Error(`Internal error: ${fileSet.files[oldIndex]} was lost while ordering asar`)\n }\n transformedFiles.set(newIndex, value)\n }\n }\n\n return {\n src: fileSet.src,\n destination: fileSet.destination,\n metadata: fileSet.metadata,\n files: sortedFileEntries.map(([, file]) => file),\n transformedFiles,\n }\n }\n\n private async checkAgainstRoots(target: string, allowRoots: string[]): Promise<boolean> {\n const resolved = await resolvePath(target)\n if (resolved == null || isEmptyOrSpaces(resolved)) {\n return false\n }\n\n for (const root of allowRoots) {\n if (resolved === root || resolved.startsWith(root + path.sep)) {\n return true\n }\n }\n return false\n }\n\n private async protectSystemAndUnsafePaths(file: string, workspaceRoot: string): Promise<void> {\n const resolved = await resolvePath(file)\n const logFields = { source: file, realPath: resolved }\n\n const workspace = await resolvePath(workspaceRoot)\n\n // If in workspace, always safe\n if (workspace && resolved?.startsWith(workspace)) {\n return\n }\n\n // Check allowlist (priority)\n if (await this.checkAgainstRoots(file, await ALLOWLIST)) {\n return\n }\n\n // Check denylist\n if (await this.checkAgainstRoots(file, await DENYLIST)) {\n log.error(logFields, `denied access to system or unsafe path`)\n throw new Error(`Cannot copy file [${file}] symlinked to file [${resolved}] outside the package to a system or unsafe path`)\n }\n\n // Default: outside explicit paths but not explicitly denied\n log.debug(logFields, `path is outside of explicit safe paths, defaulting to safe`)\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FileMatcher } from "../fileMatcher.js";
|
|
2
|
+
export interface AsarIntegrityOptions {
|
|
3
|
+
readonly resourcesPath: string;
|
|
4
|
+
readonly resourcesRelativePath: string;
|
|
5
|
+
readonly resourcesDestinationPath: string;
|
|
6
|
+
readonly extraResourceMatchers: Array<FileMatcher> | null;
|
|
7
|
+
}
|
|
8
|
+
export interface HeaderHash {
|
|
9
|
+
algorithm: "SHA256";
|
|
10
|
+
hash: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AsarIntegrity {
|
|
13
|
+
[key: string]: HeaderHash;
|
|
14
|
+
}
|
|
15
|
+
export declare function computeData({ resourcesPath, resourcesRelativePath, resourcesDestinationPath, extraResourceMatchers }: AsarIntegrityOptions): Promise<AsarIntegrity>;
|
|
16
|
+
//# sourceMappingURL=integrity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrity.d.ts","sourceRoot":"","sources":["../../src/asar/integrity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG/C,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAA;IACtC,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAA;IACzC,QAAQ,CAAC,qBAAqB,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,IAAI,CAAA;CAC1D;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,QAAQ,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAC1B;AAED,wBAAsB,WAAW,CAAC,EAAE,aAAa,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,CAwDzK"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { log, statOrNull, walk } from "builder-util";
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
import { readdir } from "fs/promises";
|
|
4
|
+
import * as path from "path";
|
|
5
|
+
import { readAsarHeader } from "./asar.js";
|
|
6
|
+
export async function computeData({ resourcesPath, resourcesRelativePath, resourcesDestinationPath, extraResourceMatchers }) {
|
|
7
|
+
const isAsar = (filepath) => filepath.endsWith(".asar");
|
|
8
|
+
const resources = await readdir(resourcesPath);
|
|
9
|
+
const resourceAsars = resources.filter(isAsar).reduce((prev, filename) => ({
|
|
10
|
+
...prev,
|
|
11
|
+
[path.join(resourcesRelativePath, filename)]: path.join(resourcesPath, filename),
|
|
12
|
+
}), {});
|
|
13
|
+
const extraResources = await Promise.all((extraResourceMatchers ?? []).map(async (matcher) => {
|
|
14
|
+
const { from, to } = matcher;
|
|
15
|
+
const stat = await statOrNull(from);
|
|
16
|
+
if (stat == null) {
|
|
17
|
+
log.warn({ from }, `file source doesn't exist`);
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
if (stat.isFile()) {
|
|
21
|
+
return [{ from, to }];
|
|
22
|
+
}
|
|
23
|
+
if (matcher.isEmpty() || matcher.containsOnlyIgnore()) {
|
|
24
|
+
matcher.prependPattern("**/*");
|
|
25
|
+
}
|
|
26
|
+
const matcherFilter = matcher.createFilter();
|
|
27
|
+
const extraResourceMatches = await walk(matcher.from, (file, stats) => matcherFilter(file, stats) || stats.isDirectory());
|
|
28
|
+
return extraResourceMatches.map(from => ({ from, to: matcher.to }));
|
|
29
|
+
}));
|
|
30
|
+
const extraResourceAsars = extraResources
|
|
31
|
+
.flat(1)
|
|
32
|
+
.filter(match => isAsar(match.from))
|
|
33
|
+
.reduce((prev, { to, from }) => {
|
|
34
|
+
const prefix = path.relative(resourcesDestinationPath, to);
|
|
35
|
+
return {
|
|
36
|
+
...prev,
|
|
37
|
+
[path.join(resourcesRelativePath, prefix, path.basename(from))]: from,
|
|
38
|
+
};
|
|
39
|
+
}, {});
|
|
40
|
+
// sort to produce constant result
|
|
41
|
+
const allAsars = [...Object.entries(resourceAsars), ...Object.entries(extraResourceAsars)].sort(([name1], [name2]) => name1.localeCompare(name2));
|
|
42
|
+
const hashes = await Promise.all(allAsars.map(async ([, from]) => hashHeader(from)));
|
|
43
|
+
const asarIntegrity = {};
|
|
44
|
+
for (let i = 0; i < allAsars.length; i++) {
|
|
45
|
+
const [asar] = allAsars[i];
|
|
46
|
+
asarIntegrity[asar] = hashes[i];
|
|
47
|
+
}
|
|
48
|
+
return asarIntegrity;
|
|
49
|
+
}
|
|
50
|
+
async function hashHeader(file) {
|
|
51
|
+
const hash = createHash("sha256");
|
|
52
|
+
const { header } = await readAsarHeader(file);
|
|
53
|
+
hash.update(header);
|
|
54
|
+
return {
|
|
55
|
+
algorithm: "SHA256",
|
|
56
|
+
hash: hash.digest("hex"),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=integrity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrity.js","sourceRoot":"","sources":["../../src/asar/integrity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAkB1C,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,EAAE,aAAa,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,qBAAqB,EAAwB;IAK/I,MAAM,MAAM,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IAE/D,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,CAAA;IAC9C,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CACnD,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACnB,GAAG,IAAI;QACP,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC;KACjF,CAAC,EACF,EAAE,CACH,CAAA;IAED,MAAM,cAAc,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AE,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,CAAA;IAC7C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IACnB,OAAO;QACL,SAAS,EAAE,QAAQ;QACnB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;KACzB,CAAA;AACH,CAAC","sourcesContent":["import { FilterStats, log, statOrNull, walk } from \"builder-util\"\nimport { createHash } from \"crypto\"\nimport { readdir } from \"fs/promises\"\nimport * as path from \"path\"\nimport { FileMatcher } from \"../fileMatcher.js\"\nimport { readAsarHeader } from \"./asar.js\"\n\nexport interface AsarIntegrityOptions {\n readonly resourcesPath: string\n readonly resourcesRelativePath: string\n readonly resourcesDestinationPath: string\n readonly extraResourceMatchers: Array<FileMatcher> | null\n}\n\nexport interface HeaderHash {\n algorithm: \"SHA256\"\n hash: string\n}\n\nexport interface AsarIntegrity {\n [key: string]: HeaderHash\n}\n\nexport async function computeData({ resourcesPath, resourcesRelativePath, resourcesDestinationPath, extraResourceMatchers }: AsarIntegrityOptions): Promise<AsarIntegrity> {\n type Match = Pick<FileMatcher, \"to\" | \"from\">\n type IntegrityMap = {\n [filepath: string]: string\n }\n const isAsar = (filepath: string) => filepath.endsWith(\".asar\")\n\n const resources = await readdir(resourcesPath)\n const resourceAsars = resources.filter(isAsar).reduce<IntegrityMap>(\n (prev, filename) => ({\n ...prev,\n [path.join(resourcesRelativePath, filename)]: path.join(resourcesPath, filename),\n }),\n {}\n )\n\n const extraResources = await Promise.all(\n (extraResourceMatchers ?? []).map(async (matcher: FileMatcher): Promise<Match[]> => {\n const { from, to } = matcher\n const stat = await statOrNull(from)\n if (stat == null) {\n log.warn({ from }, `file source doesn't exist`)\n return []\n }\n if (stat.isFile()) {\n return [{ from, to }]\n }\n\n if (matcher.isEmpty() || matcher.containsOnlyIgnore()) {\n matcher.prependPattern(\"**/*\")\n }\n const matcherFilter = matcher.createFilter()\n const extraResourceMatches = await walk(matcher.from, (file: string, stats: FilterStats) => matcherFilter(file, stats) || stats.isDirectory())\n return extraResourceMatches.map(from => ({ from, to: matcher.to }))\n })\n )\n const extraResourceAsars = extraResources\n .flat(1)\n .filter(match => isAsar(match.from))\n .reduce<IntegrityMap>((prev, { to, from }) => {\n const prefix = path.relative(resourcesDestinationPath, to)\n return {\n ...prev,\n [path.join(resourcesRelativePath, prefix, path.basename(from))]: from,\n }\n }, {})\n\n // sort to produce constant result\n const allAsars = [...Object.entries(resourceAsars), ...Object.entries(extraResourceAsars)].sort(([name1], [name2]) => name1.localeCompare(name2))\n const hashes = await Promise.all(allAsars.map(async ([, from]) => hashHeader(from)))\n const asarIntegrity: AsarIntegrity = {}\n for (let i = 0; i < allAsars.length; i++) {\n const [asar] = allAsars[i]\n asarIntegrity[asar] = hashes[i]\n }\n return asarIntegrity\n}\n\nasync function hashHeader(file: string): Promise<HeaderHash> {\n const hash = createHash(\"sha256\")\n const { header } = await readAsarHeader(file)\n hash.update(header)\n return {\n algorithm: \"SHA256\",\n hash: hash.digest(\"hex\"),\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unpackDetector.d.ts","sourceRoot":"","sources":["../../src/asar/unpackDetector.ts"],"names":[],"mappings":"AAKA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGhD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { log } from "builder-util";
|
|
2
|
+
import { isBinaryFileSync } from "isbinaryfile";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
export function isLibOrExe(file) {
|
|
5
|
+
// https://github.com/electron-userland/electron-builder/issues/3038
|
|
6
|
+
return file.endsWith(".dll") || file.endsWith(".exe") || file.endsWith(".dylib") || file.endsWith(".so") || file.endsWith(".node");
|
|
7
|
+
}
|
|
8
|
+
/** @internal */
|
|
9
|
+
export function detectUnpackedDirs(fileSet, autoUnpackDirs) {
|
|
10
|
+
const metadata = fileSet.metadata;
|
|
11
|
+
for (let i = 0, n = fileSet.files.length; i < n; i++) {
|
|
12
|
+
const file = fileSet.files[i];
|
|
13
|
+
const stat = metadata.get(file);
|
|
14
|
+
if (!stat.moduleRootPath || autoUnpackDirs.has(stat.moduleRootPath)) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (!stat.isFile()) {
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
// https://github.com/electron-userland/electron-builder/issues/2679
|
|
21
|
+
let shouldUnpack = false;
|
|
22
|
+
// ffprobe-static and ffmpeg-static are known packages to always unpack
|
|
23
|
+
const moduleName = stat.moduleName;
|
|
24
|
+
const fileBaseName = path.basename(file);
|
|
25
|
+
const hasExtension = path.extname(fileBaseName);
|
|
26
|
+
if (moduleName === "ffprobe-static" || moduleName === "ffmpeg-static" || isLibOrExe(file)) {
|
|
27
|
+
shouldUnpack = true;
|
|
28
|
+
}
|
|
29
|
+
else if (!hasExtension) {
|
|
30
|
+
shouldUnpack = !!isBinaryFileSync(file);
|
|
31
|
+
}
|
|
32
|
+
if (!shouldUnpack) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
log.debug({ file: stat.moduleFullFilePath, reason: "contains executable code" }, "not packed into asar archive");
|
|
36
|
+
autoUnpackDirs.add(stat.moduleRootPath);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=unpackDetector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unpackDetector.js","sourceRoot":"","sources":["../../src/asar/unpackDetector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,GAAG,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,oEAAoE;IACpE,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,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B,CAAC,IAAI,CAAC,CAAA;QACzC,CAAC;QAED,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,SAAQ;QACV,CAAC;QAED,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,8BAA8B,CAAC,CAAA;QAChH,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IACzC,CAAC;AACH,CAAC","sourcesContent":["import { FilterStats, log } from \"builder-util\"\nimport { isBinaryFileSync } from \"isbinaryfile\"\nimport * as path from \"path\"\nimport { ResolvedFileSet } from \"../util/appFileCopier.js\"\n\nexport function isLibOrExe(file: string): boolean {\n // https://github.com/electron-userland/electron-builder/issues/3038\n return file.endsWith(\".dll\") || file.endsWith(\".exe\") || file.endsWith(\".dylib\") || file.endsWith(\".so\") || file.endsWith(\".node\")\n}\n\n/** @internal */\nexport function detectUnpackedDirs(fileSet: ResolvedFileSet, autoUnpackDirs: Set<string>) {\n const metadata = fileSet.metadata\n\n for (let i = 0, n = fileSet.files.length; i < n; i++) {\n const file = fileSet.files[i]\n const stat: FilterStats = metadata.get(file)!\n if (!stat.moduleRootPath || autoUnpackDirs.has(stat.moduleRootPath)) {\n continue\n }\n\n if (!stat.isFile()) {\n continue\n }\n\n // https://github.com/electron-userland/electron-builder/issues/2679\n let shouldUnpack = false\n // ffprobe-static and ffmpeg-static are known packages to always unpack\n const moduleName = stat.moduleName\n const fileBaseName = path.basename(file)\n const hasExtension = path.extname(fileBaseName)\n if (moduleName === \"ffprobe-static\" || moduleName === \"ffmpeg-static\" || isLibOrExe(file)) {\n shouldUnpack = true\n } else if (!hasExtension) {\n shouldUnpack = !!isBinaryFileSync(file)\n }\n\n if (!shouldUnpack) {\n continue\n }\n\n log.debug({ file: stat.moduleFullFilePath, reason: \"contains executable code\" }, \"not packed into asar archive\")\n autoUnpackDirs.add(stat.moduleRootPath)\n }\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decrypt `data` using RC2-CBC with PKCS#7 padding removal (RFC 2268).
|
|
3
|
+
*
|
|
4
|
+
* Used for pbeWithSHAAnd40BitRC2CBC (OID 1.2.840.113549.1.12.1.6) and
|
|
5
|
+
* pbeWithSHAAnd128BitRC2CBC (OID 1.2.840.113549.1.12.1.5).
|
|
6
|
+
*
|
|
7
|
+
* These OIDs are commonly used to encrypt certificate bags in PKCS#12
|
|
8
|
+
* files produced by OpenSSL and Windows with default settings. Node.js 22+
|
|
9
|
+
* (OpenSSL 3 default provider) does not support RC2 via `createDecipheriv`.
|
|
10
|
+
*/
|
|
11
|
+
declare function rc2CbcDecrypt(key: Buffer, iv: Buffer, data: Buffer, effectiveBits: number): Buffer;
|
|
12
|
+
/**
|
|
13
|
+
* PKCS#12 key/IV derivation function from RFC 7292 Appendix B (SHA-1 variant).
|
|
14
|
+
* id = 1 to derive a key, id = 2 to derive an IV.
|
|
15
|
+
*
|
|
16
|
+
* Throws if `iterations` is outside [1, MAX_PKCS12_PBE_ITERATIONS] to prevent
|
|
17
|
+
* CPU exhaustion from a crafted PFX file.
|
|
18
|
+
*/
|
|
19
|
+
declare function pkcs12PbeDeriveKey(password: Buffer, salt: Buffer, iterations: number, id: number, length: number): Buffer;
|
|
20
|
+
/**
|
|
21
|
+
* Encode a password as UTF-16 Big Endian with a null terminator, which is the
|
|
22
|
+
* format required by PKCS#12 PBE key derivation (RFC 7292).
|
|
23
|
+
* An empty string yields [0x00, 0x00] (just the null terminator).
|
|
24
|
+
*/
|
|
25
|
+
declare function pkcs12PasswordToUtf16(password: string): Buffer;
|
|
26
|
+
/**
|
|
27
|
+
* Reads certificate info from a PKCS#12 (.pfx) file using pkijs (unobfuscated TypeScript).
|
|
28
|
+
* Mirrors the `certificate-info` subcommand of app-builder-bin.
|
|
29
|
+
* https://github.com/develar/app-builder/blob/master/pkg/codesign/p12.go
|
|
30
|
+
*
|
|
31
|
+
* Returns { commonName, bloodyMicrosoftSubjectDn } on success.
|
|
32
|
+
*
|
|
33
|
+
* Known divergences from the Go binary:
|
|
34
|
+
* - No OpenSSL fallback when the pure PKCS#12 decoder fails for a non-password reason.
|
|
35
|
+
* - Unknown OIDs are rendered using the raw numeric OID as the type name (e.g. `2.5.4.100=value`); Go uses `OID=#hexbytes` when ASN.1 marshal succeeds.
|
|
36
|
+
* - RDN ordering uses DER order; Go normalizes via pkix.Name.ToRDNSequence then reverses via
|
|
37
|
+
* BloodyMsString. These coincide for pkijs-generated certs (CN-first DER) but may
|
|
38
|
+
* differ for real CA-issued certs stored in traditional C-first DER order.
|
|
39
|
+
*/
|
|
40
|
+
export declare function readCertInfo(file: string, password: string): Promise<{
|
|
41
|
+
commonName: string;
|
|
42
|
+
bloodyMicrosoftSubjectDn: string;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Internal functions exported exclusively for unit testing.
|
|
46
|
+
* Not part of the public API — do not use outside of test files.
|
|
47
|
+
*/
|
|
48
|
+
export declare const _testingOnly: {
|
|
49
|
+
pkcs12PbeDeriveKey: typeof pkcs12PbeDeriveKey;
|
|
50
|
+
pkcs12PasswordToUtf16: typeof pkcs12PasswordToUtf16;
|
|
51
|
+
rc2CbcDecrypt: typeof rc2CbcDecrypt;
|
|
52
|
+
MAX_PKCS12_PBE_ITERATIONS: number;
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=certInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"certInfo.d.ts","sourceRoot":"","sources":["../../src/codeSign/certInfo.ts"],"names":[],"mappings":"AAwHA;;;;;;;;;GASG;AACH,iBAAS,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CA0E3F;AAqBD;;;;;;GAMG;AACH,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAqElH;AAED;;;;GAIG;AACH,iBAAS,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CASvD;AAyCD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,wBAAwB,EAAE,MAAM,CAAA;CAAE,CAAC,CAuIpI;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;CAKxB,CAAA"}
|