HearthSim / Hearthstone-Deck-Tracker

A deck tracker and deck manager for Hearthstone on Windows
https://hsreplay.net/downloads/
4.75k stars 1.12k forks source link

The official version of the image resources may cause the program to fail to open in certain Windows environments. #4578

Open Gaia-X-Alter opened 1 month ago

Gaia-X-Alter commented 1 month ago

Expected Behavior

startup program

Actual Behavior

trigger Framework error:System.ArithmeticException->KERNELBASE.dll HearthstoneDeckTracker.execannot start

Steps to reproduce behavior

startup program

Log/Screenshots

No response

Gaia-X-Alter commented 1 month ago

Due to this strange error, I wasted an entire afternoon and evening reinstalling the .NET version several times and upgrading Windows to the latest version. Then I decided to rebuild a new version of the program myself. I pulled the source code from GitHub and reproduced the issue in Visual Studio. In the end, I found that there was a problem with the images in the app icon, such as Resources/ClassIcons/Round/neutral.png, stas.png, stats_permium.png, venomous.png, and many others. Finally, I wrote a script to replace all the images, and now the program is working fine. I strongly recommend that the developers carefully check these resource images

Gaia-X-Alter commented 1 month ago

Application: HearthstoneDeckTracker.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Information: System.ArithmeticException

Exception Information: System.OverflowException at System.Windows.Media.Imaging.ColorConvertedBitmap.FinalizeCreation() at System.Windows.Media.Imaging.ColorConvertedBitmap..ctor(System.Windows.Media.Imaging.BitmapSource, System.Windows.Media.ColorContext, System.Windows.Media.ColorContext, System.Windows.Media.PixelFormat) at System.Windows.Media.Imaging.BitmapSource.CreateCachedBitmap(System.Windows.Media.Imaging.BitmapFrame, System.Windows.Media.Imaging.BitmapSourceSafeMILHandle, System.Windows.Media.Imaging.BitmapCreateOptions, System.Windows.Media.Imaging.BitmapCacheOption, System.Windows.Media.Imaging.BitmapPalette) at System.Windows.Media.Imaging.BitmapFrameDecode.FinalizeCreation() at System.Windows.Media.Imaging.BitmapFrameDecode..ctor(Int32, System.Windows.Media.Imaging.BitmapCreateOptions, System.Windows.Media.Imaging.BitmapCacheOption, System.Windows.Media.Imaging.BitmapDecoder) at System.Windows.Media.Imaging.BitmapDecoder.SetupFrames(System.Windows.Media.Imaging.BitmapDecoder, System.Collections.ObjectModel.ReadOnlyCollection1) at System.Windows.Media.Imaging.BitmapDecoder.get_Frames() at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(System.Uri, System.Uri, System.IO.Stream, System.Windows.Media.Imaging.BitmapCreateOptions, System.Windows.Media.Imaging.BitmapCacheOption, System.Net.Cache.RequestCachePolicy) at System.Windows.Media.ImageSourceConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext, System.Globalization.CultureInfo, System.Object) at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateObjectWithTypeConverter(MS.Internal.Xaml.ServiceProviderContext, System.Xaml.Schema.XamlValueConverter1, System.Object) at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateFromValue(MS.Internal.Xaml.ServiceProviderContext, System.Xaml.Schema.XamlValueConverter1, System.Object, System.Xaml.XamlMember) at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.CreateFromValue(MS.Internal.Xaml.ServiceProviderContext, System.Xaml.Schema.XamlValueConverter1, System.Object, System.Xaml.XamlMember) at System.Xaml.XamlObjectWriter.Logic_CreateFromValue(MS.Internal.Xaml.Context.ObjectWriterContext, System.Xaml.Schema.XamlValueConverter`1, System.Object, System.Xaml.XamlMember, System.String, MS.Internal.Xaml.Runtime.IAddLineInfo)

Exception Information: System.Windows.Markup.XamlParseException at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri) at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean) at System.Windows.Application.LoadComponent(System.Object, System.Uri) at Hearthstone_Deck_Tracker.App.InitializeComponent() at Hearthstone_Deck_Tracker.App.Main()

Gaia-X-Alter commented 1 month ago

It's very strange that this issue only occurs on one of my computers, while my other newly installed computer works fine. These image resources appear to be packed into the HearthstoneDeckTracker.exe file, and regular players can't manually replace them. Is it really necessary to pack them in?

Gaia-X-Alter commented 1 month ago

the Image files I regenerated earlier are below Resources.zip