diff --git a/src/Squirrel/SquirrelAwareExecutableDetector.cs b/src/Squirrel/SquirrelAwareExecutableDetector.cs index e8e442e0d..6bd624063 100644 --- a/src/Squirrel/SquirrelAwareExecutableDetector.cs +++ b/src/Squirrel/SquirrelAwareExecutableDetector.cs @@ -70,8 +70,21 @@ public static List GetAllSquirrelAwareApps(string directory, int minimum var buf = new byte[size]; if (!NativeMethods.GetFileVersionInfo(executable, 0, size, buf)) return null; - IntPtr result; int resultSize; - if (!NativeMethods.VerQueryValue(buf, "\\StringFileInfo\\040904B0\\SquirrelAwareVersion", out result, out resultSize)) { + const string englishUS = "040904B0"; + const string neutral = "000004B0"; + var supportedLanguageCodes = new[] {englishUS, neutral}; + + IntPtr result; + int resultSize; + if (!supportedLanguageCodes.Any( + languageCode => + NativeMethods.VerQueryValue( + buf, + $"\\StringFileInfo\\{languageCode}\\SquirrelAwareVersion", + out result, out resultSize + ) + )) + { return null; } diff --git a/test/SquirrelAwareExecutableDetectorTests.cs b/test/SquirrelAwareExecutableDetectorTests.cs index e29713b25..70e5fd61d 100644 --- a/test/SquirrelAwareExecutableDetectorTests.cs +++ b/test/SquirrelAwareExecutableDetectorTests.cs @@ -41,6 +41,17 @@ public void SquirrelAwareViaVersionBlock() Assert.Equal(1, ret.Value); } + [Fact] + public void SquirrelAwareViaLanguageNeutralVersionBlock() + { + var target = IntegrationTestHelper.GetPath("fixtures", "SquirrelAwareNetCoreApp.exe"); + Assert.True(File.Exists(target)); + + var ret = SquirrelAwareExecutableDetector.GetPESquirrelAwareVersion(target); + Assert.Equal(1, ret.Value); + } + + [Fact] public void SquirrelAwareViaAssemblyAttribute() { diff --git a/test/fixtures/SquirrelAwareNetCoreApp.dll b/test/fixtures/SquirrelAwareNetCoreApp.dll new file mode 100644 index 000000000..dada25e75 Binary files /dev/null and b/test/fixtures/SquirrelAwareNetCoreApp.dll differ diff --git a/test/fixtures/SquirrelAwareNetCoreApp.exe b/test/fixtures/SquirrelAwareNetCoreApp.exe new file mode 100644 index 000000000..a16ab22df Binary files /dev/null and b/test/fixtures/SquirrelAwareNetCoreApp.exe differ