@@ -55,21 +55,21 @@ export default class AppXTarget extends Target {
55
55
return copy ( path . join ( templatePath , "assets" , `SampleAppx.${ size } .png` ) , target )
56
56
} ) ,
57
57
copyDir ( appOutDir , path . join ( preAppx , "app" ) ) ,
58
- this . writeManifest ( templatePath , preAppx , safeName )
58
+ this . writeManifest ( templatePath , preAppx , safeName , arch )
59
59
] )
60
60
61
61
const destination = path . join ( this . outDir , packager . generateName ( "appx" , arch , false ) )
62
62
const args = [ "pack" , "/o" , "/d" , preAppx , "/p" , destination ]
63
63
use ( this . options . makeappxArgs , ( it : Array < string > ) => args . push ( ...it ) )
64
64
// wine supports only ia32 binary in any case makeappx crashed on wine
65
65
// await execWine(path.join(await getSignVendorPath(), "windows-10", process.platform === "win32" ? process.arch : "ia32", "makeappx.exe"), args)
66
- await spawn ( path . join ( await getSignVendorPath ( ) , "windows-10" , process . arch , "makeappx.exe" ) , args )
66
+ await spawn ( path . join ( await getSignVendorPath ( ) , "windows-10" , arch === Arch . ia32 ? "ia32" : "x64" , "makeappx.exe" ) , args )
67
67
68
68
await packager . sign ( destination )
69
69
packager . dispatchArtifactCreated ( destination , packager . generateName ( "appx" , arch , true ) )
70
70
}
71
71
72
- private async writeManifest ( templatePath : string , preAppx : string , safeName : string ) {
72
+ private async writeManifest ( templatePath : string , preAppx : string , safeName : string , arch : Arch ) {
73
73
const appInfo = this . packager . appInfo
74
74
const manifest = ( await readFile ( path . join ( templatePath , "appxmanifest.xml" ) , "utf8" ) )
75
75
. replace ( / \$ \{ ( [ a - z A - Z ] + ) \} / g, ( match , p1 ) : string => {
@@ -100,11 +100,14 @@ export default class AppXTarget extends Target {
100
100
101
101
case "safeName" :
102
102
return safeName
103
+
104
+ case "arch" :
105
+ return arch === Arch . ia32 ? "x86" : "x64"
103
106
104
107
default :
105
108
throw new Error ( `Macro ${ p1 } is not defined` )
106
109
}
107
110
} )
108
111
await writeFile ( path . join ( preAppx , "appxmanifest.xml" ) , manifest )
109
112
}
110
- }
113
+ }
0 commit comments