mirror of
https://github.com/EpicMorg/UniversalValveToolbox.git
synced 2024-12-25 14:15:29 +03:00
1.0.0.4
steam api init fix
This commit is contained in:
parent
4cde1acd9a
commit
70d8205e2b
@ -1,5 +1,7 @@
|
||||
using Steamworks;
|
||||
using Microsoft.Win32;
|
||||
using Steamworks;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
using UniversalValveToolbox.Model.Provider;
|
||||
using UniversalValveToolbox.Utils;
|
||||
@ -14,12 +16,47 @@ namespace UniversalValveToolbox {
|
||||
var dataProvide = new DataProvider();
|
||||
var currSettings = dataProvide.Settings;
|
||||
|
||||
LanguageManager.UpdateLanguage(currSettings.Language);
|
||||
|
||||
SteamClient.Init(currSettings.ToolsAppId);
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
LanguageManager.UpdateLanguage(currSettings.Language);
|
||||
|
||||
try { SteamClient.Init(currSettings.ToolsAppId); }
|
||||
catch (Exception ex) {
|
||||
|
||||
DialogResult result = MessageBox.Show(@"Some error was occurred when trying to init Steam API:" + Environment.NewLine +
|
||||
"---------------------------------------------------------------------------" + Environment.NewLine +
|
||||
ex.Message + Environment.NewLine +
|
||||
"---------------------------------------------------------------------------" + Environment.NewLine +
|
||||
"Try to launch Steam?",
|
||||
"Error!", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
try {
|
||||
string steamPATH = "";
|
||||
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Valve\Steam");
|
||||
steamPATH = key.GetValue("SteamExe").ToString();
|
||||
Process.Start(steamPATH);
|
||||
key.Close();
|
||||
}
|
||||
catch (Exception exs) {
|
||||
MessageBox.Show(@"Sorry. Steam launch failed because:" + Environment.NewLine +
|
||||
"---------------------------------------------------------------------------" + Environment.NewLine +
|
||||
exs.Message + Environment.NewLine +
|
||||
"---------------------------------------------------------------------------" + Environment.NewLine +
|
||||
"Application will be terminated.",
|
||||
"Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Application will be terminated.", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Application.Run(new FormMain());
|
||||
}
|
||||
}
|
||||
|
@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.3")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.3")]
|
||||
[assembly: AssemblyVersion("1.0.0.4")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.4")]
|
||||
|
Loading…
Reference in New Issue
Block a user