diff --git a/src/Squirrel/SquirrelAwareExecutableDetector.cs b/src/Squirrel/SquirrelAwareExecutableDetector.cs index 6bd624063..0f9742b03 100644 --- a/src/Squirrel/SquirrelAwareExecutableDetector.cs +++ b/src/Squirrel/SquirrelAwareExecutableDetector.cs @@ -28,9 +28,27 @@ public static List GetAllSquirrelAwareApps(string directory, int minimum { if (!File.Exists(executable)) return null; var fullname = Path.GetFullPath(executable); + var backingDll = fullname.Substring(0, fullname.Length - 3) + "dll"; + + return Utility.Retry(() => + { + var assemblySquirrelAwareVersion = GetAssemblySquirrelAwareVersion(fullname); + if (assemblySquirrelAwareVersion != null) + { + return assemblySquirrelAwareVersion; + } + + if (File.Exists(backingDll)) + { + var assemblyDllSquirrelAwareVersion = GetAssemblySquirrelAwareVersion(backingDll); + if (assemblyDllSquirrelAwareVersion != null) + { + return assemblyDllSquirrelAwareVersion; + } + } - return Utility.Retry(() => - GetAssemblySquirrelAwareVersion(fullname) ?? GetVersionBlockSquirrelAwareValue(fullname)); + return GetVersionBlockSquirrelAwareValue(fullname); + }); } static int? GetAssemblySquirrelAwareVersion(string executable) diff --git a/test/SquirrelAwareExecutableDetectorTests.cs b/test/SquirrelAwareExecutableDetectorTests.cs index 6b53c0c57..7e03964e1 100644 --- a/test/SquirrelAwareExecutableDetectorTests.cs +++ b/test/SquirrelAwareExecutableDetectorTests.cs @@ -48,11 +48,19 @@ public void SquirrelAwareViaLanguageNeutralVersionBlock() Assert.True(File.Exists(target)); var ret = SquirrelAwareExecutableDetector.GetPESquirrelAwareVersion(target); - Assert.NotNull(ret); Assert.Equal(1, ret.Value); } + [Fact] + public void SquirrelAwareViaNetCoreAssemblyAttribute() + { + 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..c68233efa Binary files /dev/null and b/test/fixtures/SquirrelAwareNetCoreApp.exe differ