Electron electron-winstaller fails to create installers for large (filesize) app
Asked Answered
L

1

10

I am trying to create a Windows installer for a electron app.

First the app is packaged with electron-packager.

exec(`npx electron-packager ./ "My App Name" --platform=win32 --out=${packagedLocation}`);

Then the app's installer is created using electron-winstaller.

try {
    await electronInstaller.createWindowsInstaller({
        appDirectory: packagedLocation,
        outputDirectory: installerLocation,
        authors: 'Author',
        exe: 'myapp.exe'
    });
} catch (e) {
    console.log(`Failure: ${e.message}`);
}

When the code to create the installer is run both the exe and msi installers are not created correctly. The created Setup.exe is only about 200 KB. Attempting to run the exe spawns a dialog that says: This is a dummy update.exe. If you are seeing this, your build did not correctly replace the IDR_UPDATE_ZIP resource. Command Line: '--install .'. No errors are given in the logs for Squirrel or the build script.

Through testing I have discovered this happens if the size of my packaged app is too big. My app includes about 3 GB of resources. I need these resources included as part of the installer as opposed to being downloaded as needed as the app is intended to be able to work without internet access. The size of these resources is already optimized and I cannot remove any from my app.

For testing purposes, if I do remove some of these resources at random until the size of my packaged app is less than 1 GB electron-winstaller will create the installers correctly, without issues. It does not appear to be any particular resource is causing the error.

Is there any way I can include these resources in my app in a way that does not prevent the installers from being created?

Update

After doing some further research I have found a user having the same problem in the Github issues pages for Squirrel.Windows, which is what electron-winstaller uses to create the installer. Unfortunately, the only answer found there is "I don't think you can use Squirrel right now with such a large install".

Like the user on the issues page I am in a similar situation where I want a single install file to simplify the process for users. I also do not want to have the app pull the resources from the internet after being installed because it is feasible the app will be installed long after the servers are offline.

I have alternatively tried using electron-wix-msi to create the installer with a similar unsuccessful result. If my app's resources exceed around 1 GB, I receive the error light.exe : error LGHT0001 : Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) when trying to create the installer.

electron-packager lists four packages that can be used to create Windows installers from a packaged electron app. I cannot use electron-winstaller and electron-installer-windows as both use Squirrel, electron-wix-msi also does not appear to work with large files, and electron-windows-store creates .appx installers which are not good for compatibility. Are there any other methods I have for creating a Windows installer for an electron app? or are there any potential fixes for the Squirrel or WiX methods?

Laurenlaurena answered 11/12, 2021 at 22:30 Comment(0)
E
2

From my understanding, Windows Installer packages (.msi files) store their resources in a single CAB file, which cannot exceed 64,000 (or maybe 65,535?) files or a 2GB total file size.

If you need more, you should probably pack the resources into more CAB files and bundle everything in a zip file (which doesn't have a size limit).

As a side note, Windows (32- and 64-bit) doesn't work with executables larger than 4GB.

Expiation answered 21/12, 2021 at 2:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.