Rayjax
Rayjax

Reputation: 7784

How to debug an electron app packaged with squirrel that won't start on some computers

I've built an Electron app using the Squirrel packager/update manager. I've had no issues in building the bundle, targeting Windows 64bits only.

I installed it on my Macbook pro (on a windows 7 x64 dual boot) without trouble. I tested it also on a 64 bit Surface pro 3 (Win 10), and another Win 7 PC. Everything works fine.

I published the app and got a few hundred downloads :half the people that downloaded it has it working, and for the other half it just won't start. The process spawns, then dies a second after. I tried starting it in admin, the admin dialog box won't even show. I tried running it from command line

myapp.exe > out.txt

But out is empty. How can I debug this ?

Upvotes: 3

Views: 1961

Answers (2)

Tieme
Tieme

Reputation: 65389

I was having trouble getting the logs for a production build as well.

My solution was to use electron-log to let the production app write logs to disk while debugging the problem.

You can then access the logs on windows at:
%USERPROFILE%\AppData\Roaming\<app name>\log.log.

Add some logs in your app that will give you insights in where the app crashes.

Don't forget to remove electron-log when you're done debugging and don't need to write any logs to disk any more.

Upvotes: 3

Rayjax
Rayjax

Reputation: 7784

I solved it for many users by building directly on a windows 10 fresh install. The builds I used before were built on a windows 7. Not sure if it was that, I also have been cleaning the node modules a little bit, so maybe one of the modules I removed was the issue. Anyways, I still do not know of to debug the built exe in this kind of situation. There must be a way to get a log or something when the process kills itself

Upvotes: 0

Related Questions