11import BluebirdPromise from "bluebird-lst"
2- import { asArray , exec , spawn , use } from "electron-builder-util"
2+ import _debug from "debug"
3+ import { asArray , spawn , use } from "electron-builder-util"
34import { deepAssign } from "electron-builder-util/out/deepAssign"
45import { copyDir , copyFile } from "electron-builder-util/out/fs"
56import { asyncAll , orIfFileNotExist } from "electron-builder-util/out/promise"
@@ -20,6 +21,7 @@ const vendorAssetsForDefaultAssets: { [key: string]: string; } = {
2021}
2122
2223const DEFAULT_RESOURCE_LANG = "en-US"
24+ const debug = _debug ( "electron-builder:appx" )
2325
2426export default class AppXTarget extends Target {
2527 readonly options : AppXOptions = deepAssign ( { } , this . packager . platformSpecificBuildOptions , this . packager . config . appx )
@@ -47,9 +49,9 @@ export default class AppXTarget extends Target {
4749 throw new Error ( "Please specify appx.publisher: cannot get publisher from your code signing certificate if EV cert is used" )
4850 }
4951
50- publisher = ( await exec ( "powershell.exe" , [ `(Get-PfxCertificate " ${ cscFile } ").Subject` ] ) ) . trim ( )
52+ publisher = await packager . computedPublisherSubjectOnWindowsOnly . value
5153 if ( ! publisher ) {
52- throw new Error ( "Please specify appx.publisher: Get-PfxCertificate returns empty string " )
54+ throw new Error ( "Please specify appx.publisher, cannot compute from p12 file " )
5355 }
5456 }
5557
@@ -80,15 +82,15 @@ export default class AppXTarget extends Target {
8082 if ( isScaledAssetsProvided ( userAssets ) ) {
8183 const priConfigPath = path . join ( preAppx , "priconfig.xml" )
8284 const makePriPath = path . join ( vendorPath , "windows-10" , Arch [ arch ] , "makepri.exe" )
83- await spawn ( makePriPath , [ "createconfig" , "/cf" , priConfigPath , "/dq" , "en-US" , "/pv" , "10.0.0" , "/o" ] )
84- await spawn ( makePriPath , [ "new" , "/pr" , preAppx , "/cf" , priConfigPath , "/of" , preAppx ] )
85+ await spawn ( makePriPath , [ "createconfig" , "/cf" , priConfigPath , "/dq" , "en-US" , "/pv" , "10.0.0" , "/o" ] , undefined , { isDebugEnabled : debug . enabled } )
86+ await spawn ( makePriPath , [ "new" , "/pr" , preAppx , "/cf" , priConfigPath , "/of" , preAppx ] , undefined , { isDebugEnabled : debug . enabled } )
8587
8688 makeAppXArgs . push ( "/l" )
8789 }
8890
8991 use ( this . options . makeappxArgs , ( it : Array < string > ) => makeAppXArgs . push ( ...it ) )
9092 // wine supports only ia32 binary in any case makeappx crashed on wine
91- await spawn ( path . join ( vendorPath , "windows-10" , Arch [ arch ] , "makeappx.exe" ) , makeAppXArgs )
93+ await spawn ( path . join ( vendorPath , "windows-10" , Arch [ arch ] , "makeappx.exe" ) , makeAppXArgs , undefined , { isDebugEnabled : debug . enabled } )
9294 await packager . sign ( destination )
9395
9496 packager . dispatchArtifactCreated ( destination , this , arch , packager . computeSafeArtifactName ( "appx" ) )
0 commit comments