Skip to content

Commit 9c87ffd

Browse files
committed
fix(windows): do not rename artifacts twice
PR is required to fix windows-installer — blocked on electron/windows-installer#22
1 parent 659483c commit 9c87ffd

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"bluebird": "^3.3.3",
5353
"command-line-args": "^2.1.6",
5454
"electron-packager-tf": "^5.2.3",
55-
"electron-winstaller-temp-fork": "^2.0.5-beta.0",
55+
"electron-winstaller-temp-fork": "^2.0.5-beta.2",
5656
"fs-extra": "^0.26.5",
5757
"gm": "^1.21.1",
5858
"hosted-git-info": "^2.1.4",

src/winPackager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export default class WinPackager extends PlatformPackager<any> {
105105
setupIcon: path.join(this.buildResourcesDir, "icon.ico"),
106106
certificateFile: certificateFile,
107107
certificatePassword: this.options.cscKeyPassword,
108+
fixUpPaths: false
108109
}, this.customDistOptions)
109110

110111
if (this.isNsis) {
@@ -134,7 +135,7 @@ export default class WinPackager extends PlatformPackager<any> {
134135
}
135136

136137
return await BluebirdPromise.all([
137-
renameFile(path.join(installerOutDir, appName + "Setup.exe"), installerExePath)
138+
renameFile(path.join(installerOutDir, "Setup.exe"), installerExePath)
138139
.then(it => this.dispatchArtifactCreated(it)),
139140
renameFile(path.join(installerOutDir, appName + "-" + version + "-full.nupkg"), path.join(installerOutDir, appName + "-" + version + archSuffix + "-full.nupkg"))
140141
.then(it => this.dispatchArtifactCreated(it))

test/BuildTest.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ test("custom app dir", async function () {
3535
platforms = ["win32"]
3636
}
3737

38-
await assertPack("test-app-one", platforms, [], true, async projectDir => {
38+
await assertPack("test-app-one", platforms, {
39+
// speed up tests, we don't need check every arch
40+
arch: process.arch
41+
}, true, async projectDir => {
3942
const file = path.join(projectDir, "package.json")
4043
const data = parseJson(await readText(file))
4144
data.directories = {

test/helpers/packTester.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import pathSorter from "path-sort"
1414
const copyDir = Promise.promisify(fse.copy)
1515
const tmpDir = Promise.promisify(tmp.dir)
1616

17-
export async function assertPack(projectDir, platform, target, useTempDir, tempDirCreated) {
17+
export async function assertPack(projectDir, platform, packagerOptions, useTempDir, tempDirCreated) {
1818
projectDir = path.join(__dirname, "..", "fixtures", projectDir)
1919
// const isDoNotUseTempDir = platform === "darwin"
2020
if (useTempDir) {
@@ -36,14 +36,13 @@ export async function assertPack(projectDir, platform, target, useTempDir, tempD
3636
}
3737
}
3838

39-
const packager = new Packager({
39+
const packager = new Packager(Object.assign({
4040
projectDir: projectDir,
4141
cscLink: CSC_LINK,
4242
cscKeyPassword: CSC_KEY_PASSWORD,
4343
dist: true,
4444
platform: Array.isArray(platform) ? platform : [platform],
45-
target: target
46-
})
45+
}, packagerOptions))
4746

4847
await packager.build()
4948
if (platform === "darwin" || (platform === "all" && process.platform === "darwin")) {

test/winPackagerTest.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ test.ifNotTravis("win", async function () {
77

88
// nsis is deprecated and not thread-safe - just do not run on CI to avoid failures
99
test.ifNotCi.serial("win: nsis", async function () {
10-
await assertPack("test-app-one", "win32", ["nsis"], true)
10+
await assertPack("test-app-one", "win32", {
11+
target: ["nsis"]
12+
}, true)
1113
})

0 commit comments

Comments
 (0)