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,4BAA4B,CAAC,uBAAuB,CAC1D,CAAA;YACH,CAAC;iBAAM,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;gBACrC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAA;YAC1D,CAAC;YACD,OAAO,IAAI,CAAA;QACb,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,YAAY,GAAG,CAAC,QAAkB,EAAE,EAAE;YAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,CAAA;YAC5D,OAAO,IAAA,SAAI,EAAC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAA;QACtF,CAAC,CAAA;QACD,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;QACxH,MAAM,sBAAe,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAA;QAE3F,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AArXD,kCAqXC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, InvalidConfigurationError, log, use, executeAppBuilder } from \"builder-util\"\nimport { parseDn } from \"builder-util-runtime\"\nimport { CopyFileTransformer, FileTransformer, walk } from \"builder-util/out/fs\"\nimport { createHash } from \"crypto\"\nimport { readdir } from \"fs/promises\"\nimport * as isCI from \"is-ci\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { importCertificate } from \"./codeSign/codesign\"\nimport {\n CertificateFromStoreInfo,\n CertificateInfo,\n FileCodeSigningInfo,\n getCertificateFromStoreInfo,\n getCertInfo,\n getSignVendorPath,\n sign,\n WindowsSignOptions,\n} from \"./codeSign/windowsCodeSign\"\nimport { AfterPackContext } from \"./configuration\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { RequestedExecutionLevel, WindowsConfiguration } from \"./options/winOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, PlatformPackager } from \"./platformPackager\"\nimport AppXTarget from \"./targets/AppxTarget\"\nimport MsiTarget from \"./targets/MsiTarget\"\nimport MsiWrappedTarget from \"./targets/MsiWrappedTarget\"\nimport { NsisTarget } from \"./targets/nsis/NsisTarget\"\nimport { AppPackageHelper, CopyElevateHelper } from \"./targets/nsis/nsisUtil\"\nimport { WebInstallerTarget } from \"./targets/nsis/WebInstallerTarget\"\nimport { createCommonTarget } from \"./targets/targetFactory\"\nimport { BuildCacheManager, digest } from \"./util/cacheManager\"\nimport { isBuildCacheEnabled } from \"./util/flags\"\nimport { time } from \"./util/timer\"\nimport { getWindowsVm, VmManager } from \"./vm/vm\"\nimport { execWine } from \"./wine\"\n\nexport class WinPackager extends PlatformPackager {\n readonly cscInfo = new Lazy(() => {\n const platformSpecificBuildOptions = this.platformSpecificBuildOptions\n if (platformSpecificBuildOptions.certificateSubjectName != null || platformSpecificBuildOptions.certificateSha1 != null) {\n return this.vm.value\n .then(vm => getCertificateFromStoreInfo(platformSpecificBuildOptions, vm))\n .catch((e: any) => {\n // https://github.com/electron-userland/electron-builder/pull/2397\n if (platformSpecificBuildOptions.sign == null) {\n throw e\n } else {\n log.debug({ error: e }, \"getCertificateFromStoreInfo error\")\n return null\n }\n })\n }\n\n const certificateFile = platformSpecificBuildOptions.certificateFile\n if (certificateFile != null) {\n const certificatePassword = this.getCscPassword()\n return Promise.resolve({\n file: certificateFile,\n password: certificatePassword == null ? null : certificatePassword.trim(),\n })\n }\n\n const cscLink = this.getCscLink(\"WIN_CSC_LINK\")\n if (cscLink == null) {\n return Promise.resolve(null)\n }\n\n return (\n importCertificate(cscLink, this.info.tempDirManager, this.projectDir)\n // before then\n .catch((e: any) => {\n if (e instanceof InvalidConfigurationError) {\n throw new InvalidConfigurationError(`Env WIN_CSC_LINK is not correct, cannot resolve: ${e.message}`)\n } else {\n throw e\n }\n })\n .then(path => {\n return {\n file: path,\n password: this.getCscPassword(),\n }\n })\n )\n })\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"ico\"))\n\n readonly vm = new Lazy(() => (process.platform === \"win32\" ? Promise.resolve(new VmManager()) : getWindowsVm(this.debugLogger)))\n\n readonly computedPublisherName = new Lazy | null>(async () => {\n const publisherName = this.platformSpecificBuildOptions.publisherName\n if (publisherName === null) {\n return null\n } else if (publisherName != null) {\n return asArray(publisherName)\n }\n\n const certInfo = await this.lazyCertInfo.value\n return certInfo == null ? null : [certInfo.commonName]\n })\n\n readonly lazyCertInfo = new Lazy(async () => {\n const cscInfo = await this.cscInfo.value\n if (cscInfo == null) {\n return null\n }\n\n if (\"subject\" in cscInfo) {\n const bloodyMicrosoftSubjectDn = cscInfo.subject\n return {\n commonName: parseDn(bloodyMicrosoftSubjectDn).get(\"CN\")!,\n bloodyMicrosoftSubjectDn,\n }\n }\n\n const cscFile = cscInfo.file\n if (cscFile == null) {\n return null\n }\n return await getCertInfo(cscFile, cscInfo.password || \"\")\n })\n\n get isForceCodeSigningVerification(): boolean {\n return this.platformSpecificBuildOptions.verifyUpdateCodeSignature !== false\n }\n\n constructor(info: Packager) {\n super(info, Platform.WINDOWS)\n }\n\n get defaultTarget(): Array {\n return [\"nsis\"]\n }\n\n protected doGetCscPassword(): string | undefined | null {\n return chooseNotNull(chooseNotNull(this.platformSpecificBuildOptions.certificatePassword, process.env.WIN_CSC_KEY_PASSWORD), super.doGetCscPassword())\n }\n\n createTargets(targets: Array, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n let copyElevateHelper: CopyElevateHelper | null\n const getCopyElevateHelper = () => {\n if (copyElevateHelper == null) {\n copyElevateHelper = new CopyElevateHelper()\n }\n return copyElevateHelper\n }\n\n let helper: AppPackageHelper | null\n const getHelper = () => {\n if (helper == null) {\n helper = new AppPackageHelper(getCopyElevateHelper())\n }\n return helper\n }\n\n for (const name of targets) {\n if (name === DIR_TARGET) {\n continue\n }\n\n if (name === \"nsis\" || name === \"portable\") {\n mapper(name, outDir => new NsisTarget(this, outDir, name, getHelper()))\n } else if (name === \"nsis-web\") {\n // package file format differs from nsis target\n mapper(name, outDir => new WebInstallerTarget(this, path.join(outDir, name), name, new AppPackageHelper(getCopyElevateHelper())))\n } else {\n const targetClass: typeof NsisTarget | typeof AppXTarget | typeof MsiTarget | typeof MsiWrappedTarget | null = (() => {\n switch (name) {\n case \"squirrel\":\n try {\n return require(\"electron-builder-squirrel-windows\").default\n } catch (e: any) {\n throw new InvalidConfigurationError(`Module electron-builder-squirrel-windows must be installed in addition to build Squirrel.Windows: ${e.stack || e}`)\n }\n\n case \"appx\":\n return require(\"./targets/AppxTarget\").default\n\n case \"msi\":\n return require(\"./targets/MsiTarget\").default\n\n case \"msiwrapped\":\n return require(\"./targets/MsiWrappedTarget\").default\n\n default:\n return null\n }\n })()\n\n mapper(name, outDir => (targetClass === null ? createCommonTarget(name, outDir, this) : new (targetClass as any)(this, outDir, name)))\n }\n }\n }\n\n getIconPath() {\n return this._iconPath.value\n }\n\n async sign(file: string, logMessagePrefix?: string): Promise {\n const signOptions: WindowsSignOptions = {\n path: file,\n name: this.appInfo.productName,\n site: await this.appInfo.computePackageUrl(),\n options: this.platformSpecificBuildOptions,\n }\n\n const cscInfo = await this.cscInfo.value\n if (cscInfo == null) {\n if (this.platformSpecificBuildOptions.sign != null) {\n return sign(signOptions, this)\n } else if (this.forceCodeSigning) {\n throw new InvalidConfigurationError(\n `App is not signed and \"forceCodeSigning\" is set to true, please ensure that code signing configuration is correct, please see https://electron.build/code-signing`\n )\n }\n return false\n }\n\n if (logMessagePrefix == null) {\n logMessagePrefix = \"signing\"\n }\n\n if (\"file\" in cscInfo) {\n log.info(\n {\n file: log.filePath(file),\n certificateFile: cscInfo.file,\n },\n logMessagePrefix\n )\n } else {\n const info = cscInfo\n log.info(\n {\n file: log.filePath(file),\n subject: info.subject,\n thumbprint: info.thumbprint,\n store: info.store,\n user: info.isLocalMachineStore ? \"local machine\" : \"current user\",\n },\n logMessagePrefix\n )\n }\n\n return this.doSign({\n ...signOptions,\n cscInfo,\n options: {\n ...this.platformSpecificBuildOptions,\n },\n })\n }\n\n private async doSign(options: WindowsSignOptions) {\n for (let i = 0; i < 3; i++) {\n try {\n await sign(options, this)\n return true\n } catch (e: any) {\n // https://github.com/electron-userland/electron-builder/issues/1414\n const message = e.message\n if (message != null && message.includes(\"Couldn't resolve host name\")) {\n log.warn({ error: message, attempt: i + 1 }, `cannot sign`)\n continue\n }\n throw e\n }\n }\n return false\n }\n\n async signAndEditResources(file: string, arch: Arch, outDir: string, internalName?: string | null, requestedExecutionLevel?: RequestedExecutionLevel | null) {\n const appInfo = this.appInfo\n\n const files: Array = []\n\n const args = [\n file,\n \"--set-version-string\",\n \"FileDescription\",\n appInfo.productName,\n \"--set-version-string\",\n \"ProductName\",\n appInfo.productName,\n \"--set-version-string\",\n \"LegalCopyright\",\n appInfo.copyright,\n \"--set-file-version\",\n appInfo.shortVersion || appInfo.buildVersion,\n \"--set-product-version\",\n appInfo.shortVersionWindows || appInfo.getVersionInWeirdWindowsForm(),\n ]\n\n if (internalName != null) {\n args.push(\"--set-version-string\", \"InternalName\", internalName, \"--set-version-string\", \"OriginalFilename\", \"\")\n }\n\n if (requestedExecutionLevel != null && requestedExecutionLevel !== \"asInvoker\") {\n args.push(\"--set-requested-execution-level\", requestedExecutionLevel)\n }\n\n use(appInfo.companyName, it => args.push(\"--set-version-string\", \"CompanyName\", it))\n use(this.platformSpecificBuildOptions.legalTrademarks, it => args.push(\"--set-version-string\", \"LegalTrademarks\", it))\n const iconPath = await this.getIconPath()\n use(iconPath, it => {\n files.push(it)\n args.push(\"--set-icon\", it)\n })\n\n const config = this.config\n const cscInfoForCacheDigest = !isBuildCacheEnabled() || isCI || config.electronDist != null ? null : await this.cscInfo.value\n let buildCacheManager: BuildCacheManager | null = null\n // resources editing doesn't change executable for the same input and executed quickly - no need to complicate\n if (cscInfoForCacheDigest != null) {\n const cscFile = (cscInfoForCacheDigest as FileCodeSigningInfo).file\n if (cscFile != null) {\n files.push(cscFile)\n }\n\n const timer = time(\"executable cache\")\n const hash = createHash(\"sha512\")\n hash.update(config.electronVersion || \"no electronVersion\")\n hash.update(JSON.stringify(this.platformSpecificBuildOptions))\n hash.update(JSON.stringify(args))\n hash.update(this.platformSpecificBuildOptions.certificateSha1 || \"no certificateSha1\")\n hash.update(this.platformSpecificBuildOptions.certificateSubjectName || \"no subjectName\")\n\n buildCacheManager = new BuildCacheManager(outDir, file, arch)\n if (await buildCacheManager.copyIfValid(await digest(hash, files))) {\n timer.end()\n return\n }\n timer.end()\n }\n\n const timer = time(\"wine&sign\")\n // rcedit crashed of executed using wine, resourcehacker works\n if (process.platform === \"win32\" || process.platform === \"darwin\") {\n await executeAppBuilder([\"rcedit\", \"--args\", JSON.stringify(args)], undefined /* child-process */, {}, 3 /* retry three times */)\n } else if (this.info.framework.name === \"electron\") {\n const vendorPath = await getSignVendorPath()\n await execWine(path.join(vendorPath, \"rcedit-ia32.exe\"), path.join(vendorPath, \"rcedit-x64.exe\"), args)\n }\n\n await this.sign(file)\n timer.end()\n\n if (buildCacheManager != null) {\n await buildCacheManager.save()\n }\n }\n\n private shouldSignFile(file: string): boolean {\n const shouldSignDll = this.platformSpecificBuildOptions.signDlls === true && file.endsWith(\".dll\")\n const shouldSignExplicit = !!this.platformSpecificBuildOptions.signExts?.some(ext => file.endsWith(ext))\n return shouldSignDll || shouldSignExplicit || file.endsWith(\".exe\")\n }\n\n protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null {\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return null\n }\n\n return file => {\n if (this.shouldSignFile(file)) {\n const parentDir = path.dirname(file)\n if (parentDir !== packContext.appOutDir) {\n return new CopyFileTransformer(file => this.sign(file))\n }\n }\n return null\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise {\n const exeFileName = `${this.appInfo.productFilename}.exe`\n if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {\n return false\n }\n\n await BluebirdPromise.map(readdir(packContext.appOutDir), (file: string): any => {\n if (file === exeFileName) {\n return this.signAndEditResources(\n path.join(packContext.appOutDir, exeFileName),\n packContext.arch,\n packContext.outDir,\n path.basename(exeFileName, \".exe\"),\n this.platformSpecificBuildOptions.requestedExecutionLevel\n )\n } else if (this.shouldSignFile(file)) {\n return this.sign(path.join(packContext.appOutDir, file))\n }\n return null\n })\n\n if (!isAsar) {\n return true\n }\n\n const filesPromise = (filepath: string[]) => {\n const outDir = path.join(packContext.appOutDir, ...filepath)\n return walk(outDir, (file, stat) => stat.isDirectory() || this.shouldSignFile(file))\n }\n const filesToSign = await Promise.all([filesPromise([\"resources\", \"app.asar.unpacked\"]), filesPromise([\"swiftshader\"])])\n await BluebirdPromise.map(filesToSign.flat(1), file => this.sign(file), { concurrency: 4 })\n\n return true\n }\n}\n"]}