electron-userland / electron-wix-msi

:dvd: Create traditional MSI installers for your Electron app
MIT License
315 stars 91 forks source link

Depends on archaic `rcinfo` node module #179

Open gregcotten opened 4 months ago

gregcotten commented 4 months ago

As described, this project depends on rcinfo to extract the main executable's VERSIONINFO to then apply to the stub executable via rcedit.

Unfortunately if the host machine doesn't have the (unsupported since 2020) "Visual Studio 2010 (VC++ 10.0) SP1" redistributables installed (for x86!!! x64 doesn't fix this, watch out), the VERSIONINFO will silently fall back to the Electron app's package metadata.

This is a good fallback but it unfortunately makes an incorrect assumption about what "File Version" should be. electron-packager uses the buildVersion packagerConfig property for the "File Version" of the vended executable, while electron-wix-msi falls back to the appVersion (aka "Product Version" in Windows).

gregcotten commented 4 months ago

I'd make a PR over on rcinfo, but that project hasn't been touched in 9 years and the ShowVer.exe binary it ships with is 22 years old at this point.

Also, this issue only affects folks who have been successfully vending MSIs for a product and are now updating their runners in a way that causes rcinfo to no longer work and silently fail in this project.

I think the silent fail happens because getFileInfo(...) somehow doesn't throw an exception and instead returns an empty dictionary.

https://github.com/electron-userland/electron-wix-msi/blob/dc4db703191b1f7a83b29cb3a1dc7dcec0590217/src/utils/rc-edit.ts#L54

This is what I mean by the incorrect assumption for the fallback:

https://github.com/electron-userland/electron-wix-msi/blob/dc4db703191b1f7a83b29cb3a1dc7dcec0590217/src/utils/rc-edit.ts#L117

For an electron app, the FileVersion from the main executable is not always going to be the same as version - it's going to be, by default, the appVersion, and if buildVersion is specified in the packagerConfig, it will be whatever that is.