Open jameshfisher opened 4 years ago
I got this working. I'd be willing to submit a PR adding this support. However it seems like this repo is dead/unmaintained
Here's the essence of my soln:
const convertToWindowsStore = require('electron-windows-store');
const electronWindowsStoreUtils = require('electron-windows-store/lib/utils');
const opts = { /* */ };
await convertToWindowsStore(opts);
// This is how electron-windows-store seems to behave
const appxPath = `${opts.outputDirectory}\\${opts.packageName}.appx`;
const APPXBUNDLE_FILEPATH = 'some\\output\\dir\\MyAppName.appxbundle';
const TMP_APPXBUNDLE_MAP_FILEPATH = 'some\\tmp\\dir\\AppxBundle.map';
// https://docs.microsoft.com/en-us/windows/msix/package/create-app-package-with-makeappx-tool#mapping-files
fs.writeFileSync(TMP_APPXBUNDLE_MAP_FILEPATH, [
'[Files]',
`"${appxPath}" "MyAppName.appx"`, // Note: the filename within the .appxbundle seems to be unimportant?
].join("\n"));
// This makes an unsigned bundle ...
const makeappx = path.join(windowsKitPath, 'makeappx.exe');
await electronWindowsStoreUtils.executeChildProcess(makeappx,
['bundle', '/f', TMP_APPXBUNDLE_MAP_FILEPATH, '/p', APPXBUNDLE_FILEPATH, '/o']);
// ... so we have to sign it with:
const signtool = path.join(windowsKitPath, 'signtool.exe');
await electronWindowsStoreUtils.executeChildProcess(signtool,
['sign', '-f', opts.devCert, '-p', opts.certPass, '-fd', 'SHA256', '-v', APPXBUNDLE_FILEPATH]);
@jameshfisher Why are you signing the application/bundle? It looks like it might not be signed for submission to the Store.
I'm signing it for submission to the Microsoft Store, which requires a bundle signed with my Microsoft developer identity
@jameshfisher I was able to submit not signed .appxbundle
to Store.
@felixrieseberg is this project dead?
@felixrieseberg could you please pay attention to this issue.
When submitting my .appx file to the Microsoft Store, I get the error:
So producing an .appx, as electron-windows-store does, is not always sufficient for the Microsoft Store. We need to create a .appxbundle from this. But I don't see options for this in electron-windows-store API.
This answer provides some clues, but it's not very pretty. And it produces an unsigned .appxbundle, meaning I have to manually re-sign the .appxbundle it creates.