Dev diary - 22. May 2025

Creating Windows installer for Electron app

header_image

At Hotovo, we love web technologies and use them even for building mobile or desktop apps. Technologies such as React Native for mobile or Electron for desktop apps are mature, and developers can greatly benefit from using the tools they already know and love.

What we built

Recently, we’ve been developing a desktop app for visually impaired users and needed to create a Windows installer to prepare it for end-user testing. Everything went smoothly using the Electron Builder package. We defined the NSIS installer target and planned to publish the package to a prepared Amazon S3 bucket.

The packaging problem

The first issue we encountered was that the packaging script was taking a long time and failing to build some dependencies. These same dependencies must have been built during the npm install command, as it didn’t fail. What helped was disabling Electron Builder from rebuilding the dependencies during packaging by setting "npmRebuild": false in package.json.

Why does it work?

Electron Builder calls npm rebuild for all installed dependencies during the packaging process. However, its error handling is stricter than during installation, and one of the optional sub-dependencies failed to build. This particular optional dependency isn’t necessary, and the app works correctly without it. Therefore, by skipping the rebuild, the already installed dependencies are used, and everything functions as expected.

blog author
Author
Jozef Radoňak

Forward Deployed Engineer specializing in web development, staying current with the latest web technologies and mentoring other engineers as the field evolves. Business-oriented and increasingly focused on AI, he brings both perspectives to solving problems for clients end to end.

Read more

Contact us

Let's talk