@@ -81,7 +81,6 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
8181 readonly projectDir : string
8282 readonly buildResourcesDir : string
8383
84- readonly metadata : AppMetadata
8584 readonly devMetadata : DevMetadata
8685
8786 readonly platformSpecificBuildOptions : DC
@@ -96,7 +95,6 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
9695 this . appInfo = info . appInfo
9796 this . options = info . options
9897 this . projectDir = info . projectDir
99- this . metadata = info . appInfo . metadata
10098 this . devMetadata = info . devMetadata
10199
102100 this . buildResourcesDir = path . resolve ( this . projectDir , this . relativeBuildResourcesDirname )
@@ -299,7 +297,7 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
299297 }
300298
301299 private async doCopyExtraFiles ( isResources : boolean , appOutDir : string , arch : Arch , customBuildOptions : DC ) : Promise < any > {
302- const base = isResources ? this . getResourcesDir ( appOutDir ) : this . platform === Platform . MAC ? path . join ( appOutDir , `${ this . appInfo . productName } .app` , "Contents" ) : appOutDir
300+ const base = isResources ? this . getResourcesDir ( appOutDir ) : this . platform === Platform . MAC ? path . join ( appOutDir , `${ this . appInfo . productFilename } .app` , "Contents" ) : appOutDir
303301 const patterns = this . getFilePatterns ( isResources ? "extraResources" : "extraFiles" , customBuildOptions )
304302 return patterns == null || patterns . length === 0 ? null : copyFiltered ( this . projectDir , base , createFilter ( this . projectDir , this . getParsedPatterns ( patterns , arch ) ) )
305303 }
@@ -334,7 +332,7 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
334332 }
335333
336334 private getOSXResourcesDir ( appOutDir : string ) : string {
337- return path . join ( appOutDir , `${ this . appInfo . productName } .app` , "Contents" , "Resources" )
335+ return path . join ( appOutDir , `${ this . appInfo . productFilename } .app` , "Contents" , "Resources" )
338336 }
339337
340338 private async checkFileInPackage ( resourcesDir : string , file : string , isAsar : boolean ) {
@@ -363,12 +361,12 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
363361 throw new Error ( `Output directory "${ appOutDir } " is not a directory. Seems like a wrong configuration.` )
364362 }
365363
366- const mainFile = this . metadata . main || "index.js"
364+ const mainFile = this . appInfo . metadata . main || "index.js"
367365 await this . checkFileInPackage ( this . getResourcesDir ( appOutDir ) , mainFile , isAsar )
368366 }
369367
370368 protected async archiveApp ( format : string , appOutDir : string , outFile : string ) : Promise < any > {
371- return archiveApp ( this . devMetadata . build . compression , format , outFile , this . platform === Platform . MAC ? path . join ( appOutDir , `${ this . appInfo . productName } .app` ) : appOutDir )
369+ return archiveApp ( this . devMetadata . build . compression , format , outFile , this . platform === Platform . MAC ? path . join ( appOutDir , `${ this . appInfo . productFilename } .app` ) : appOutDir )
372370 }
373371
374372 generateName ( ext : string , arch : Arch , deployment : boolean ) : string {
@@ -387,7 +385,7 @@ export abstract class PlatformPackager<DC extends PlatformSpecificBuildOptions>
387385 }
388386
389387 generateName2 ( ext : string , classifier : string | n , deployment : boolean ) : string {
390- return `${ deployment ? this . appInfo . name : this . appInfo . productName } -${ this . metadata . version } ${ classifier == null ? "" : `-${ classifier } ` } .${ ext } `
388+ return `${ deployment ? this . appInfo . name : this . appInfo . productFilename } -${ this . appInfo . version } ${ classifier == null ? "" : `-${ classifier } ` } .${ ext } `
391389 }
392390
393391 protected async getDefaultIcon ( ext : string ) {
0 commit comments