electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

How to manually install the electronic compressed package to the corresponding directory in windows11

Open hengshanMWC opened this issue 1 year ago • 1 comments

"electron": "11.0.1",

"electron-builder": "22.10.4",

system:windows11

$ electron-builder build --publish never

image Command to install 404. I want to manually download the electronic compressed package to the local. Please tell me which directory the compressed package should be placed in so that the electronic-builder can correctly identify it

hengshanMWC avatar Aug 25 '22 12:08 hengshanMWC

You can actually use electronDist config property with a callback to provide a fully resolved path to an electron zip. I've used it with my fork. Sample code:

electronDist: (options: PrepareApplicationStageDirectoryOptions) => {
    const { arch, platformName, version, packager } = options;
    const distDir = rebrandedElectronPath(arch, packager);
    const distPath = path.resolve(distDir, 'dist.zip')
    // Funky logic used to bridge our forked electron `dist.zip` artifacts with the naming system electron-builder expects
    // Ref: https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/src/electron/ElectronFramework.ts#L151
    const destinationDirname = 'dist'
    const destPath = path.resolve(destinationDirname, `electron-v${ version }-${ platformName }-${ arch }.zip`);
    console.log("Copying electron fork dist", { distPath, destPath })
    fs.copyFileSync(distPath, destPath);
    return destinationDirname;
}

mmaietta avatar Sep 01 '22 16:09 mmaietta