forked from electron-userland/electron-builder
/
portableTest.ts
89 lines (84 loc) · 2.2 KB
/
portableTest.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import { Platform, Arch } from "electron-builder"
import * as path from "path"
import { app, copyTestAsset, getFixtureDir } from "../helpers/packTester"
// build in parallel - https://github.com/electron-userland/electron-builder/issues/1340#issuecomment-286061789
test.ifAll.ifNotCiMac(
"portable",
app({
targets: Platform.WINDOWS.createTarget(["portable", "nsis"]),
config: {
publish: null,
nsis: {
differentialPackage: false,
},
},
})
)
test.ifAll.ifDevOrWinCi(
"portable zip",
app({
targets: Platform.WINDOWS.createTarget("portable"),
config: {
publish: null,
portable: {
useZip: true,
unpackDirName: "0ujssxh0cECutqzMgbtXSGnjorm",
},
compression: "normal",
},
})
)
test.ifAll.ifNotCi(
"portable zip several archs",
app({
targets: Platform.WINDOWS.createTarget("portable", Arch.ia32, Arch.x64),
config: {
publish: null,
portable: {
useZip: true,
unpackDirName: false,
},
compression: "store",
},
})
)
test.ifNotCiMac(
"portable - artifactName and request execution level",
app(
{
targets: Platform.WINDOWS.createTarget(["portable"]),
config: {
nsis: {
//tslint:disable-next-line:no-invalid-template-strings
artifactName: "${productName}Installer.${version}.${ext}",
installerIcon: "foo test space.ico",
},
portable: {
unpackDirName: true,
requestExecutionLevel: "admin",
//tslint:disable-next-line:no-invalid-template-strings
artifactName: "${productName}Portable.${version}.${ext}",
},
},
},
{
projectDirCreated: projectDir => {
return copyTestAsset("headerIcon.ico", path.join(projectDir, "build", "foo test space.ico"))
},
}
)
)
test.ifDevOrWinCi(
"portable - splashImage",
app({
targets: Platform.WINDOWS.createTarget(["portable"]),
config: {
publish: null,
portable: {
//tslint:disable-next-line:no-invalid-template-strings
artifactName: "${productName}Portable.${version}.${ext}",
splashImage: path.resolve(getFixtureDir(), "installerHeader.bmp"),
},
},
})
)