Electron-packager: Packaging/Building for Windows

Created on 16 Aug 2017  路  11Comments  路  Source: electron/electron-packager

I'm working with my business partner on getting an app I built up and running on his machine. He has a windows gaming laptop from 2013. I've run "DEBUG=electron-packager electron-packager ./ --platform=win32 --arch=all --icon=./assets/icons/win/icon.ico --out=./builds --overwrite" which gives him 2 options, the ia32 and the x64 versions of the app.

On my Mac, I see a Mac folder with 4 files in it: the app itself, a version file, and 2 license files.

When I open either of the windows-formatted builds, I see dozens of files, mostly .dll. files in addition to the .exe file.

His machine asked him if he wanted to unpack some files (which took 10+ minutes) when he went to run the .exe which seems wrong. I feel like he should be able to just open the file and run the app.

Not having a Windows machine myself and doing this troubleshooting over the phone with him leaves me with limited ideas about what to do. Any suggestions here on smoothing out the experience for him and my other Windows beta users?

Thanks!

windows question

All 11 comments

@zackshapiro Sounds like you sent them a zip file or something and they're trying to run the .exe file from within that zip folder.

They unzipped the folder which had 3 builds in it, a Mac build and 2 windows builds. They started with the x64 build, opening that folder and running the exe.

I don't see the issue here (am I missing something). You sent them a zip file, which took a long time to extract, and then they ran the .exe file successfully?

They were able to unzip the 3 builds but when they went to run the .exe, it asked if they wanted to 'extract files' which took 10+ minutes to do. Unclear if they were able to run the .exe successfully. Waiting to hear back. The fact that I haven't yet leads me to believe that no, they haven't.

Seems like they should just be able to open the x64 build folder, run the exe and be good to go. Not sure why they're seeing dozens of .dll files and being asked about an extraction

electron-packager does not make a single .exe file for you, it packages your app's code into a folder with all the electron bits and pieces in it. If you want to create an installer (a single .exe file). I'd recommend checking out electron-winstaller or the simpler approach electron-forge.

Those dll files are all required for Electron apps to run.

it asked if they wanted to 'extract files'

This sounds like a bit of miscommunication, Electron will never ask to "extract files", that string doesn't even exist anywhere in the Electron or Packager repositories. Can you double check where exactly in the process that message appears.

That said, raising an issue for a third party makes this a pretty difficult communication channel. Without a repro or a first hand recording or something there is basically nothing we can do here.

I think the answer here is what @MarshallOfSound said, create a Windows installer using one of the methods described above.

Gotcha re: all the files it generates and alternatives to electron-packager

I appreciate you helping me on behalf of a third party. I know not ideal, he's non-technical so I'm trying to debug this as best I can.

The process he described is as follows:

1) Download a .zip file with all 3 builds in it
2) Unzip (quickly) and go into the Windows x64 build
3) Click on the .exe file and was prompted to unpack files (which took ~10 mins)
4) Once that was done, he was able to run the .exe file successfully.

Not sure what's going on in the third step

I should note that Electron Forge uses both Packager and electron-winstaller under the hood, plus it has an import feature that lets you import an existing Electron project.

Electron Packager does not generate EXE files that prompts you to unpack files (unless you wrote your app to do that), so I don't know what's going on there. Perhaps if you got him to create a screencast of him opening up your app with that behavior, that would help you figure out what's happening.

Just to follow up on this, I had a chance to see what my cofounder was seeing the other day.

After running the .exe file for the first time, windows prompts you to 'unpack' files and references .dll files that need to be unpacked. That takes ~5 mins or so and then the .exe file can run

Just stumbling on this a year later and thought I would chime in for anybody else landing here with this issue. I'm also a Mac user and have been building an Electron app for Windows, testing it on a VMWare installation of Windows 10.

What it sounds like is that your cofounder was opening up the .zip file (preview) and double clicking the .exe. When you double click a .zip file in Windows it lets you preview the contents but it looks _exactly_ like a regular explorer window so you wouldn't know that you first need to extract the files from the .zip. If you don't extract the files first, double clicking the .exe in that preview window prompts Windows to ask you to unpack the .zip file. This extracts the .zip file contents to a different folder.

You say that you've got multiple binaries in the same zip file, not just the one for your co-founders platform (i.e. win64). First off, that must be a massive zip file, likely greater than 1 GB, which I would avoid. Secondly, it might be causing confusion with unzipping, etc.

I would zip just the win64 or win32 package and send that, get them to right click on it to extract all contents first and then open up the directory it extracted everything into. That should solve any confusion.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Bharwcb picture Bharwcb  路  5Comments

pushkin- picture pushkin-  路  4Comments

TongDaDa picture TongDaDa  路  3Comments

29e7e280-0d1c-4bba-98fe-f7cd3ca7500a picture 29e7e280-0d1c-4bba-98fe-f7cd3ca7500a  路  4Comments

leanderBehr picture leanderBehr  路  3Comments