public static void Main(string[] args) { long appId; if (args.Length == 0) { Process.Start("SAM.Picker.exe"); return; } if (long.TryParse(args[0], out appId) == false) { MessageBox.Show( "Could not parse application ID from commandline argument.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (API.Steam.GetInstallPath() == Application.StartupPath) { MessageBox.Show( "This tool declines to being run from the Steam directory.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } API.Client client; try { client = new API.Client(); if (client.Initialize(appId) == false) { MessageBox.Show( "Steam is not running. Please start Steam then run this tool again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } catch (DllNotFoundException) { MessageBox.Show( "You've caused an exceptional error!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Manager(appId, client)); }
private static void Main() { if (API.Steam.GetInstallPath() == Application.StartupPath) { MessageBox.Show( "This tool cannot be run from inside the Steam directory.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } using (var client = new API.Client()) { try { client.Initialize(0); } catch (API.ClientInitializeException e) { if (string.IsNullOrEmpty(e.Message) == false) { MessageBox.Show( "Steam is not running. Please start Steam then run this tool again.\n\n" + "(" + e.Message + ")", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show( "Steam is not running. Please start Steam then run this tool again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return; } catch (DllNotFoundException) { MessageBox.Show( "You've caused an exceptional error!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new GamePicker(client)); } }
private static void Main() { if (API.Steam.GetInstallPath() == Application.StartupPath) { MessageBox.Show( ResourcesUI.DLG_STEAM_DIR_ERROR, "Steam Achievement Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } using (var client = new API.Client()) { try { client.Initialize(0); } catch (API.ClientInitializeException e) { if (string.IsNullOrEmpty(e.Message) == false) { MessageBox.Show( ResourcesUI.DLG_STEAM_NOT_RUN_ERROR + "\n\n" + "(" + e.Message + ")", "Steam Achievement Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show( ResourcesUI.DLG_STEAM_NOT_RUN_ERROR, "Steam Achievement Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); } return; } catch (DllNotFoundException) { MessageBox.Show( ResourcesUI.DLG_EXCEPT_ERROR, "Steam Achievement Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new GamePicker(client)); } }
private static void Main() { if (API.Steam.GetInstallPath() == Application.StartupPath) { MessageBox.Show( "This tool declines to being run from the Steam directory.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } API.Client client; try { client = new API.Client(); if (client.Initialize(0) == false) { MessageBox.Show( "Steam is not running. Please start Steam then run this tool again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } catch (DllNotFoundException) { MessageBox.Show( "You've caused an exceptional error!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } /* Disable server certificate validation. * This is for media downloads (application logos). * https://media.steamcommunity.com/ has certs issued to (various).e.akamai.net. */ ServicePointManager.ServerCertificateValidationCallback = (s, ce, ch, e) => true; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new GamePicker(client)); }
private static void Main() { if (API.Steam.GetInstallPath() == Application.StartupPath) { MessageBox.Show( "This tool declines to being run from the Steam directory.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } API.Client client; try { client = new API.Client(); if (client.Initialize(0) == false) { MessageBox.Show( "Steam is not running. Please start Steam then run this tool again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } catch (DllNotFoundException) { MessageBox.Show( "You've caused an exceptional error!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new GamePicker(client)); }
public static void Main(string[] args) { long appId; if (args.Length == 0) { Process.Start("SAM.Picker.exe"); return; } if (long.TryParse(args[0], out appId) == false) { MessageBox.Show( "Could not parse application ID from command line argument.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (API.Steam.GetInstallPath() == Application.StartupPath) { MessageBox.Show( "This tool declines to being run from the Steam directory.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } using (var client = new API.Client()) { try { client.Initialize(appId); } catch (API.ClientInitializeException e) { if (e.Failure == API.ClientInitializeFailure.ConnectToGlobalUser) { MessageBox.Show( "Steam is not running. Please start Steam then run this tool again.\n\n" + "If you have the game through Family Share, the game may be locked due to\n\n" + "the Family Share account actively playing a game.\n\n" + "(" + e.Message + ")", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (string.IsNullOrEmpty(e.Message) == false) { MessageBox.Show( "Steam is not running. Please start Steam then run this tool again.\n\n" + "(" + e.Message + ")", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show( "Steam is not running. Please start Steam then run this tool again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } return; } catch (DllNotFoundException) { MessageBox.Show( "You've caused an exceptional error!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Manager(appId, client)); } }
public static void Main(string[] args) { long appId; if (args.Length == 0) { Process.Start("SAM.Picker.exe"); return; } if (long.TryParse(args[0], out appId) == false) { MessageBox.Show( "Could not parse application ID from command line argument.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (API.Steam.GetInstallPath() == Application.StartupPath) { MessageBox.Show( "This tool declines to being run from the Steam directory.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } API.Client client; try { client = new API.Client(); if (client.Initialize(appId) == false) { MessageBox.Show( "Steam is not running. Please start Steam then run this tool again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } catch (DllNotFoundException) { MessageBox.Show( "You've caused an exceptional error!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } /* Disable server certificate validation. * This is for media downloads (achievement icons). * https://media.steamcommunity.com/ has certs issued to (various).e.akamai.net. */ ServicePointManager.ServerCertificateValidationCallback = (s, ce, ch, e) => true; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Manager(appId, client)); }
public static void Main(string[] args) { long appId; if (args.Length == 0) { Process.Start("SAM.Picker.exe"); return; } if (long.TryParse(args[0], out appId) == false) { MessageBox.Show( ResourcesUI.DLG_PARSE_ID_ERROR, "Steam Achievement Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (API.Steam.GetInstallPath() == Application.StartupPath) { MessageBox.Show( ResourcesUI.DLG_STEAM_DIR_ERROR, "Steam Achievement Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } using (var client = new API.Client()) { try { client.Initialize(appId); } catch (API.ClientInitializeException e) { if (e.Failure == API.ClientInitializeFailure.ConnectToGlobalUser) { MessageBox.Show( ResourcesUI.DLG_STEAM_NOT_RUN_ERROR + "\n\n" + ResourcesUI.DLG_FAMILY_SHARE_ERROR + "\n\n" + "(" + e.Message + ")", "Steam Achievement Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); } else if (string.IsNullOrEmpty(e.Message) == false) { MessageBox.Show( ResourcesUI.DLG_STEAM_NOT_RUN_ERROR + "\n\n" + "(" + e.Message + ")", "Steam Achievement Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { MessageBox.Show( ResourcesUI.DLG_STEAM_NOT_RUN_ERROR, "Steam Achievement Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); } return; } catch (DllNotFoundException) { MessageBox.Show( ResourcesUI.DLG_EXCEPT_ERROR, "Steam Achievement Manager", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Manager(appId, client)); } }