Skip to content

fix: check for semantic version #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShGKme
Copy link

@ShGKme ShGKme commented Feb 19, 2025

StubExecutable expects app's version to be a valid semantic version

However, electron-wix-msi successfully creates a package with an invalid semantic version, e.g., Windows version 1.2.3.4. The created packages then cannot be launched from the created shortcut or Stub Executable.

This PR adds a check for version to be a valid semantic version and to prevent successful creation of an invalid package.

To make the change less destructive, it tries to transform a Windows version into a semantic one in the most probable case: 1.2.3.4 -> 1.2.3+4

Signed-off-by: Grigorii K. Shartsev <[email protected]>
@MLDMoritz
Copy link

This works for me. Please merge @felixrieseberg - Ty!

@MLDMoritz
Copy link

Did some testing. On initial installation this seems to work fine, when updating to another version, it wont.

E.g. fromn 1.2.3+1 to 1.2.3+2 the stub won't launch, even when built with @ShGKme changes.

@ShGKme
Copy link
Author

ShGKme commented Apr 22, 2025

I'll have a look at update

@MLDMoritz
Copy link

MLDMoritz commented Apr 22, 2025

Just sharing my thoughts...

We build for Intune, with version of 1.2.3+300 this would lead to an msi version of 1.2.3.300 which would upload fine to intune.

If we update with version 1.2.3+301 this would work fine for intune, because its using 1.2.3.301. However, as the StubExecutable parses 1.2.3+301 I think it cannot find the newest version anymore, as it's correctly ignoring the metadata. It's not been validated, but I guess this is what happens.

I think this would be an issue within Squirrel.Msi ?

@MLDMoritz
Copy link

@ShGKme I created a fork of your patch at https://github.com/MLDMoritz/electron-wix-msi/tree/fix/semantic-version with the new StubExecutable from https://github.com/MLDMoritz/Squirrel.Msi

When multiple versions with the same major.minor.patch but different build numbers (e.g., 1.2.3+4 and 1.2.3+5) are installed, ensure the stub executable launches the correct version by comparing build metadata numbers.

This fix enhances FindLatestAppDir() to:

  • Identify versions with identical major.minor.patch numbers
  • Extract and numerically compare their build metadata
  • Select the version with the highest build number

Resolves issue where stub can't distinguish between versions that differ only by build number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stub Executable fails when passing 4-level version string
2 participants