diff --git a/src/WingetCreateCore/Common/PackageParser.cs b/src/WingetCreateCore/Common/PackageParser.cs index 984650c2..d0dac84c 100644 --- a/src/WingetCreateCore/Common/PackageParser.cs +++ b/src/WingetCreateCore/Common/PackageParser.cs @@ -856,10 +856,10 @@ private static bool ParseExeInstallerType(string path, Installer baseInstaller, } catch (Win32Exception err) { - if ((err.Message == "The specified resource type cannot be found in the image file." - && err.NativeErrorCode == 1813) || - (err.Message == "The specified image file did not contain a resource section." - && err.NativeErrorCode == 1812)) + const int ERROR_RESOURCE_DATA_NOT_FOUND = 1812; + const int ERROR_RESOURCE_TYPE_NOT_FOUND = 1813; + if (err.NativeErrorCode == ERROR_RESOURCE_DATA_NOT_FOUND || + err.NativeErrorCode == ERROR_RESOURCE_TYPE_NOT_FOUND) { installerTypeEnum = (baseInstaller.InstallerType == InstallerType.Portable || baseInstaller.NestedInstallerType == NestedInstallerType.Portable) ?