Electron-builder: Windows Store Support (AppX target)

Created on 27 Sep 2016  ·  24Comments  ·  Source: electron-userland/electron-builder

Hey there.

Do you plan to add support for building apps /publishing for the Windows Store? Currently I'm working w/ electron-packager and electron-windows-store to get my electron app into the Windows Store.

Guess the steps would be:

  • Build the app (warn if auto-updates are baked in?)
  • don't make an installer but run electron-windows-store on the build output
feature windows

Most helpful comment

@wojtkowiak I will implement it this or next week.

All 24 comments

PR welcome and will be accepted. Tag help wanted not yet added — maybe it will be easy to support.

You can use electron-builder — set target to dir and then run electron-windows-store.

dir seems to be missing from the documentation.

That's just how I imagined it. Guess we do not need any further support. Gonna close the issue and check the results next week.

No — electron-builder is a complete solution — one button "do it" — corresponding target will be added. Without any effort from user.

Alright. But then we'll have to add the steps the user needs to do in order to run electron-windows-store to the docs, probably add some more options etc.

I'ma gather what we need in order to integrate electron-windows-store.

User just set target to windows-store (or AppX?).

All required tools should be published to Bintray and downloaded automatically (https://github.com/electron-userland/electron-builder-binaries). i.e. user should not need to setup.

@develar @black-snow is there already a decision to make this?
I am asking because that is something I need in meteor-desktop and I am just in the middle of preparing backlog. I was planning to add electron-windows-store to my project separately but I would rather wait for it being implemented here as this topis is rather unknown territory for me :smile:

@wojtkowiak I will implement it this or next week.

Great, thanks for info and your hard work 👍

@develar How's your progress? I'm back at this, now.

@black-snow Work started. Will be implemented soon.

@develar Great! Is there anything I can help with?

@black-snow No, appx is straightforward (compared to snaps ;)). It even works currently but not pushed because I am on vacation this week (not all aspects are polished and internet access is limited).

Have a great week then!
Gonna use electron-windows-store manually until builder has the support.

  • Packaging into AppX format is not effective for now — implementation is copied from electron-windows-store. But AppX tool allows us to implement it in a more performant way (avoid intermediate copy).
  • AppX must be always signed. You cannot install unsigned package. For your convenience, electron-builder has new CLI tool create-self-signed-cert -p publisherName
  • You must for now specify build.appx.publisher in a form CN=your name exactly as in your cert Later electron-builder will automatically extract it from cert.
  • AppX packaging works only on Windows 10+. Wine not supported (crashed).
  • You don't need to install anything else. AppX tool will be downloaded on demand automatically.

@develar Hey there,
documentation seems to be missing from https://github.com/electron-userland/electron-builder/wiki/Options#WinBuildOptions-target
How do I use it? / When will it be "effective"?

@black-snow Wiki updated. Please use target appx. Docs is not yet correctly generated — please see appx options in the source code https://github.com/electron-userland/electron-builder/blob/master/src/options/winOptions.ts#L177 (publisher is the only required option for now).

When will it be "effective"?

It doesn't affect resulted app. At first I want to hear some feedback and then optimise.

Thanks for the update. I'll give it a try.

@develar I exported CSC_LINK and CSC_KEY_PASSWORD.

Start of stack trace:

Error: Please specify appx.publisher
at D:_user\Desktop\xxx\windows\node_modules\electron-builder\src\targetsappx.ts:38:13
at Generator.next ()
From previous event:
at AppXTarget.build (D:_user\Desktop\xxx\windows\node_modules\electron-builder\out\targetsappx.js:123:11)
at postAsyncTasks.push.default.map.it (D:_user\Desktop\xxx\windows\node_modules\electron-builder\src\platformPackager.ts:163:85)

Where do I set the publisher and to what value? npm run release --publisher="CN=xyz"?

//edit: nvm, found it. Seems like everything worked fine

@black-snow In the appx settings. Please set build.appx.publisher.

Or using CLI: using extra metadata: --em.build.appx.publisher="CN=xyz"

@develar Seems like CSC_LINK can't handle relative paths. Guess that should be fixed or put in the docs. I'll take a look at the code.
/edit: Guess we should just add a short note to the Code Signing doc page.

Works great so far. Thanks!

/edit2: using %cd% works
I modified my release target so I can have my certificate in the repo and don't need to set absolute paths:
"release": "set CSC_KEY_PASSWORD=&&set CSC_LINK=%cd%/build/cert/xyz.pfx&&build --ia32"

@black-snow relative to project root? it was never supported. should be. will fix soon.

@develar Jup, thanks ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lbssousa picture lbssousa  ·  3Comments

leo picture leo  ·  3Comments

mstralka picture mstralka  ·  3Comments

NPellet picture NPellet  ·  3Comments

JohnWeisz picture JohnWeisz  ·  3Comments