mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 12:35:52 -04:00
Don't error when cannot open icon. I assume this fixes #283
This commit is contained in:
parent
27bb92b58f
commit
479d8ec5cf
@ -39,13 +39,15 @@ namespace ClassicalSharp {
|
||||
|
||||
public void LoadIcon() {
|
||||
string launcherPath = Path.Combine(Program.AppDirectory, "Launcher2.exe");
|
||||
if (File.Exists(launcherPath)) {
|
||||
Icon = Icon.ExtractAssociatedIcon(launcherPath); return;
|
||||
if (!File.Exists(launcherPath)) {
|
||||
launcherPath = Path.Combine(Program.AppDirectory, "Launcher.exe");
|
||||
}
|
||||
if (!File.Exists(launcherPath)) return;
|
||||
|
||||
launcherPath = Path.Combine(Program.AppDirectory, "Launcher.exe");
|
||||
if (File.Exists(launcherPath)) {
|
||||
try {
|
||||
Icon = Icon.ExtractAssociatedIcon(launcherPath);
|
||||
} catch (Exception ex) {
|
||||
ErrorHandler.LogError("DesktopWindow.LoadIcon()", ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,8 +79,13 @@ namespace Launcher {
|
||||
Window.Keyboard.KeyDown += KeyDown;
|
||||
LoadFont();
|
||||
logoFont = new Font(FontName, 32, FontStyle.Regular);
|
||||
|
||||
string path = Assembly.GetExecutingAssembly().Location;
|
||||
Window.Icon = Icon.ExtractAssociatedIcon(path);
|
||||
try {
|
||||
Window.Icon = Icon.ExtractAssociatedIcon(path);
|
||||
} catch (Exception ex) {
|
||||
ErrorHandler2.LogError("LauncherWindow.Init() - Icon", ex);
|
||||
}
|
||||
//Minimised = Window.WindowState == WindowState.Minimized;
|
||||
|
||||
PlatformID platform = Environment.OSVersion.Platform;
|
||||
|
Loading…
x
Reference in New Issue
Block a user