Skip to content

Commit 82d456a

Browse files
committed
Move over Windows x64 artifact naming changes for build consistency
1 parent dcf3f7f commit 82d456a

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

script/build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,10 @@ if (!argv.generateApiDocs) {
104104
}
105105
if (argv.createWindowsInstaller) {
106106
return createWindowsInstaller(packagedAppPath)
107-
.then(() => argv.codeSign && codeSignOnWindows([ path.join(CONFIG.buildOutputPath, 'AtomSetup.exe') ]))
108-
.then(() => packagedAppPath)
107+
.then((installerPath) => {
108+
argv.codeSign && codeSignOnWindows([installerPath])
109+
return packagedAppPath
110+
})
109111
} else {
110112
console.log('Skipping creating installer. Specify the --create-windows-installer option to create a Squirrel-based Windows installer.'.gray)
111113
}

script/lib/compress-artifacts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = function (packagedAppPath) {
1919
function getArchiveName () {
2020
switch (process.platform) {
2121
case 'darwin': return 'atom-mac.zip'
22-
case 'win32': return 'atom-windows.zip'
22+
case 'win32': return `atom-${process.arch === 'x64' ? 'x64-' : ''}windows.zip`
2323
default: return `atom-${getLinuxArchiveArch()}.tar.gz`
2424
}
2525
}

script/lib/create-windows-installer.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
const electronInstaller = require('electron-winstaller')
4-
const fs = require('fs-extra')
4+
const fs = require('fs')
55
const glob = require('glob')
66
const path = require('path')
77

@@ -17,16 +17,30 @@ module.exports = (packagedAppPath) => {
1717
outputDirectory: CONFIG.buildOutputPath,
1818
noMsi: true,
1919
remoteReleases: `https://atom.io/api/updates${archSuffix}?version=${CONFIG.appMetadata.version}`,
20+
setupExe: `AtomSetup${process.arch === 'x64' ? '-x64' : ''}.exe`,
2021
setupIcon: path.join(CONFIG.repositoryRootPath, 'resources', 'app-icons', CONFIG.channel, 'atom.ico')
2122
}
2223

2324
const cleanUp = () => {
24-
for (let nupkgPath of glob.sync(`${CONFIG.buildOutputPath}/*.nupkg`)) {
25+
const releasesPath = `${CONFIG.buildOutputPath}/RELEASES`
26+
if (process.arch === 'x64' && fs.existsSync(releasesPath)) {
27+
fs.renameSync(releasesPath, `${releasesPath}-x64`)
28+
}
29+
30+
for (let nupkgPath of glob.sync(`${CONFIG.buildOutputPath}/atom-*.nupkg`)) {
2531
if (!nupkgPath.includes(CONFIG.appMetadata.version)) {
2632
console.log(`Deleting downloaded nupkg for previous version at ${nupkgPath} to prevent it from being stored as an artifact`)
27-
fs.removeSync(nupkgPath)
33+
fs.unlinkSync(nupkgPath)
34+
} else {
35+
if (process.arch === 'x64') {
36+
// Use the original .nupkg filename to generate the `atom-x64` name by inserting `-x64` after `atom`
37+
const newNupkgPath = nupkgPath.replace('atom-', 'atom-x64-')
38+
fs.renameSync(nupkgPath, newNupkgPath)
39+
}
2840
}
2941
}
42+
43+
return `${CONFIG.buildOutputPath}/${options.setupExe}`
3044
}
3145

3246
console.log(`Creating Windows Installer for ${packagedAppPath}`)

0 commit comments

Comments
 (0)