@@ -5,7 +5,7 @@ import { PlatformPackager, BuildInfo } from "./platformPackager"
5
5
import * as path from "path"
6
6
import { Stats } from "fs"
7
7
import { log } from "./util"
8
- import { deleteFile , stat , renameFile } from "./promisifed-fs"
8
+ import { deleteFile , stat , renameFile , copyFile } from "./promisifed-fs"
9
9
import * as fse from "fs-extra"
10
10
11
11
const __awaiter = tsAwaiter
@@ -49,25 +49,25 @@ export default class WinPackager extends PlatformPackager<any> {
49
49
return "win"
50
50
}
51
51
52
- pack ( platform : string , outDir : string , appOutDir : string ) : Promise < any > {
52
+ pack ( platform : string , outDir : string , appOutDir : string , arch : string ) : Promise < any > {
53
53
if ( this . options . dist && ! this . isNsis ) {
54
- const installerOut = this . computeDistOut ( outDir )
54
+ const installerOut = this . computeDistOut ( outDir , arch )
55
55
log ( "Removing %s" , installerOut )
56
56
return BluebirdPromise . all ( [
57
- super . pack ( platform , outDir , appOutDir ) ,
57
+ super . pack ( platform , outDir , appOutDir , arch ) ,
58
58
emptyDir ( installerOut )
59
59
] )
60
60
}
61
61
else {
62
- return super . pack ( platform , outDir , appOutDir )
62
+ return super . pack ( platform , outDir , appOutDir , arch )
63
63
}
64
64
}
65
65
66
- private computeDistOut ( outDir : string ) : string {
67
- return path . join ( outDir , ( this . isNsis ? "nsis" : "win" ) + ( this . currentArch === "x64" ? "-x64" : "" ) )
66
+ private computeDistOut ( outDir : string , arch : string ) : string {
67
+ return path . join ( outDir , ( this . isNsis ? "nsis" : "win" ) + ( arch === "x64" ? "-x64" : "" ) )
68
68
}
69
69
70
- async packageInDistributableFormat ( outDir : string , appOutDir : string ) : Promise < any > {
70
+ async packageInDistributableFormat ( outDir : string , appOutDir : string , arch : string ) : Promise < any > {
71
71
let iconUrl = this . metadata . build . iconUrl
72
72
if ( ! iconUrl ) {
73
73
if ( this . customDistOptions != null ) {
@@ -89,9 +89,9 @@ export default class WinPackager extends PlatformPackager<any> {
89
89
90
90
const certificateFile = await this . certFilePromise
91
91
const version = this . metadata . version
92
- const installerOutDir = this . computeDistOut ( outDir )
92
+ const installerOutDir = this . computeDistOut ( outDir , arch )
93
93
const appName = this . metadata . name
94
- const archSuffix = this . currentArch === "x64" ? "-x64" : ""
94
+ const archSuffix = arch === "x64" ? "-x64" : ""
95
95
const installerExePath = path . join ( installerOutDir , appName + "Setup-" + version + archSuffix + ".exe" )
96
96
const options = Object . assign ( {
97
97
name : this . metadata . name ,
@@ -134,12 +134,22 @@ export default class WinPackager extends PlatformPackager<any> {
134
134
}
135
135
}
136
136
137
- return await BluebirdPromise . all ( [
137
+ const promises = [
138
138
renameFile ( path . join ( installerOutDir , "Setup.exe" ) , installerExePath )
139
139
. then ( it => this . dispatchArtifactCreated ( it ) ) ,
140
140
renameFile ( path . join ( installerOutDir , appName + "-" + version + "-full.nupkg" ) , path . join ( installerOutDir , appName + "-" + version + archSuffix + "-full.nupkg" ) )
141
141
. then ( it => this . dispatchArtifactCreated ( it ) )
142
- ] )
142
+ ]
143
+
144
+ if ( arch === "x64" ) {
145
+ this . dispatchArtifactCreated ( path . join ( installerOutDir , "RELEASES" ) )
146
+ }
147
+ else {
148
+ promises . push ( copyFile ( path . join ( installerOutDir , "RELEASES" ) , path . join ( installerOutDir , "RELEASES-ia32" ) )
149
+ . then ( it => this . dispatchArtifactCreated ( it ) ) )
150
+ }
151
+
152
+ return await BluebirdPromise . all ( promises )
143
153
}
144
154
145
155
private async nsis ( options : any , installerFile : string ) {
0 commit comments