Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use electron-winstaller instead of self module #8344

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
87eb7bf
use electron-winstaller
Jul 17, 2024
3a0d1f5
fix ut
Jul 17, 2024
d209266
add nuspecTemplate
Jul 17, 2024
182eea7
custom template.nuspectemplat
Jul 17, 2024
b65450d
add patch for electron-winstaller: change exe to producname
Jul 17, 2024
272b4c8
update wine docker config
Jul 17, 2024
8910083
update snap
Jul 17, 2024
62c9bb5
update snap
Jul 17, 2024
e2d54ff
update wine docker
Jul 17, 2024
74316e3
update dockerfile
Jul 17, 2024
9f1a99a
update dockerimage
Jul 17, 2024
fd017b7
add appId and exe options
Jul 18, 2024
4202527
delete patch
Jul 18, 2024
5170902
change encode
Jul 18, 2024
a4a2f50
update 7zip
Jul 20, 2024
5ffdffd
use [email protected]: update 7zip and nuget
Jul 20, 2024
8e5b9d2
update [email protected]
Jul 20, 2024
6376b95
delete decompress-zip
Jul 20, 2024
006d3cb
remove directory
Jul 20, 2024
8c960cb
delete directory
Jul 20, 2024
b0e6941
update docker file
Jul 20, 2024
4bc85f2
update wine docker config
Jul 20, 2024
463c687
add vender path
Jul 21, 2024
4e5502d
change to getBin
Jul 21, 2024
d9459d9
add sign option
Jul 21, 2024
61c79cb
add shouldSign function
Jul 21, 2024
4d9cb0a
change shouldSign to async/await
Jul 21, 2024
232a90d
add template.nuspectemplate into files
beyondkmp Jul 22, 2024
b26c7a8
add vendorDirectory option
Jul 25, 2024
a5d6bee
Merge branch 'master' into win-installer
Jul 25, 2024
d36fefd
update 7zip arch
Jul 25, 2024
04c50fd
fix 7zip arch
Jul 26, 2024
2fb5700
fix name
Jul 26, 2024
023559f
Merge branch 'master' into win-installer
beyondkmp Nov 1, 2024
253c3aa
delete docker config
beyondkmp Nov 1, 2024
b7ff107
Merge branch 'master' into win-installer
beyondkmp Nov 1, 2024
10931d5
Merge branch 'master' into win-installer
beyondkmp Nov 2, 2024
7733641
use adm-zip to decode
beyondkmp Nov 3, 2024
71b7629
fix sign issue
beyondkmp Nov 3, 2024
be20ec0
delete docker config
beyondkmp Nov 3, 2024
8d7dc91
update docker config
PayneFuRC Nov 5, 2024
d1e4a41
Merge branch 'master' into win-installer
beyondkmp Nov 5, 2024
2bf2205
add changeset
PayneFuRC Nov 5, 2024
d6180f5
delete deb
PayneFuRC Nov 5, 2024
a97660f
Merge branch 'master' into win-installer
beyondkmp Nov 5, 2024
277f958
add comments
PayneFuRC Nov 5, 2024
34fc8eb
update comments
PayneFuRC Nov 5, 2024
4eabc28
Merge branch 'master' into win-installer
beyondkmp Nov 7, 2024
04ce3fd
Merge branch 'master' into win-installer
beyondkmp Nov 11, 2024
8e2086f
update pnpm lock file
beyondkmp Nov 11, 2024
a7d61c8
Merge branch 'master' into win-installer
beyondkmp Nov 20, 2024
3d30f3f
Merge branch 'master' into win-installer
beyondkmp Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docker/wine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
ARG IMAGE_VERSION=latest
FROM electronuserland/builder:$IMAGE_VERSION

# Set up Wine environment for 64-bit
ENV WINEARCH=win64
ENV WINEPREFIX=/root/.wine64

# Set locale to support UTF-8
ENV LANG C.UTF-8
ENV LANGUAGE C.UTF-8
ENV LC_ALL C.UTF-8

RUN dpkg --add-architecture i386 && \
curl -Lo /usr/share/keyrings/winehq.asc https://dl.winehq.org/wine-builds/winehq.key && \
echo 'deb [signed-by=/usr/share/keyrings/winehq.asc] https://dl.winehq.org/wine-builds/ubuntu/ focal main' > /etc/apt/sources.list.d/winehq.list && \
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
"packageManager": "[email protected]",
"pnpm": {
"patchedDependencies": {
"@changesets/[email protected]": "patches/@[email protected]"
"@changesets/[email protected]": "patches/@[email protected]",
"[email protected]": "patches/[email protected]"
}
}
}
3 changes: 1 addition & 2 deletions packages/electron-builder-squirrel-windows/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
],
mmaietta marked this conversation as resolved.
Show resolved Hide resolved
"dependencies": {
"app-builder-lib": "workspace:*",
"archiver": "^5.3.1",
"builder-util": "workspace:*",
"fs-extra": "^10.1.0"
"electron-winstaller": "5.3.1"
},
"devDependencies": {
"@types/archiver": "5.3.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { sanitizeFileName } from "app-builder-lib/out/util/filename"
import { InvalidConfigurationError, log, isEmptyOrSpaces } from "builder-util"
import { getBinFromUrl } from "app-builder-lib/out/binDownload"
import { Arch, getArchSuffix, SquirrelWindowsOptions, Target } from "app-builder-lib"
import { WinPackager } from "app-builder-lib/out/winPackager"
import * as path from "path"
import { convertVersion, SquirrelBuilder, SquirrelOptions } from "./squirrelPack"
import { Options as SquirrelOptions, createWindowsInstaller, convertVersion } from "electron-winstaller"

export default class SquirrelWindowsTarget extends Target {
//tslint:disable-next-line:no-object-literal-type-assertion
Expand All @@ -22,10 +21,7 @@ export default class SquirrelWindowsTarget extends Target {
const version = packager.appInfo.version
const sanitizedName = sanitizeFileName(this.appName)

// tslint:disable-next-line:no-invalid-template-strings
const setupFile = packager.expandArtifactNamePattern(this.options, "exe", arch, "${productName} Setup ${version}.${ext}")
const packageFile = `${sanitizedName}-${convertVersion(version)}-full.nupkg`

const installerOutDir = path.join(this.outDir, `squirrel-windows${getArchSuffix(arch)}`)
const artifactPath = path.join(installerOutDir, setupFile)

Expand All @@ -40,8 +36,11 @@ export default class SquirrelWindowsTarget extends Target {
}

const distOptions = await this.computeEffectiveDistOptions()
const squirrelBuilder = new SquirrelBuilder(distOptions, installerOutDir, packager)
await squirrelBuilder.buildInstaller({ setupFile, packageFile }, appOutDir, this.outDir, arch)
await createWindowsInstaller({
...distOptions,
appDirectory: appOutDir,
outputDirectory: installerOutDir,
})

await packager.info.callArtifactBuildCompleted({
file: artifactPath,
Expand Down Expand Up @@ -102,7 +101,6 @@ export default class SquirrelWindowsTarget extends Target {
const appName = this.appName
const options: SquirrelOptions = {
name: appName,
productName: this.options.name || appInfo.productName,
appId: this.options.useAppIdAsId ? appInfo.id : appName,
version: appInfo.version,
description: appInfo.description,
Expand All @@ -112,12 +110,12 @@ export default class SquirrelWindowsTarget extends Target {
extraMetadataSpecs: projectUrl == null ? null : `\n <projectUrl>${projectUrl}</projectUrl>`,
copyright: appInfo.copyright,
packageCompressionLevel: parseInt((process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL || packager.compression === "store" ? 0 : 9) as any, 10),
vendorPath: await getBinFromUrl("Squirrel.Windows", "1.9.0", "zJHk4CMATM7jHJ2ojRH1n3LkOnaIezDk5FAzJmlSEQSiEdRuB4GGLCegLDtsRCakfHIVfKh3ysJHLjynPkXwhQ=="),
mmaietta marked this conversation as resolved.
Show resolved Hide resolved
nuspecTemplate: path.join(__dirname, "..", "template.nuspectemplate"),
...(this.options as any),
}

if (isEmptyOrSpaces(options.description)) {
options.description = options.productName
options.description = this.options.name || appInfo.productName
}

if (options.remoteToken == null) {
Expand Down
295 changes: 0 additions & 295 deletions packages/electron-builder-squirrel-windows/src/squirrelPack.ts

This file was deleted.

Loading
Loading