public bool SteamCMDProcess(bool bValidationEnable) { bool bInstalled = false; //Dictionary<string, string> dConfigValue = new Dictionary<string, string>(); //dConfigValue = gettingSettings.PullValuesFromConfig; Process process = new Process(); process.StartInfo.CreateNoWindow = true; Settings.SettingValuesFromConfig(); try { if (Settings.sSteamCmdLoc != "") //(dConfigValue["SteamCmd_Location"] != "") { process.StartInfo.FileName = Settings.sSteamCmdLoc; //(dConfigValue["SteamCmd_Location"]); string sConanServerLocation = Settings.sConanServerLoc; //dConfigValue["Conan_Server_Location"]; if (Settings.sConanServerLoc == "") //(dConfigValue["Conan_Server_Location"] == "") { string sMessage = "Please Setup the location of the server in settings."; process.StartInfo.Arguments = ""; MessageBox.Show(sMessage); FileWatcherConanWPF.SettingsForm form = new FileWatcherConanWPF.SettingsForm(); form.Show(); } else { if (bValidationEnable == true) { process.StartInfo.Arguments = " +login anonymous +force_install_dir " + '"' + sConanServerLocation + '"' + "\\ +app_update 443030 validate +exit"; } else { process.StartInfo.Arguments = " +login anonymous +force_install_dir " + '"' + sConanServerLocation + '"' + "\\ +app_update 443030 +exit"; } } if (process.StartInfo.Arguments != "") { process.Start(); process.WaitForExit(); bInstalled = true; } } else { MessageBox.Show("Please setup location of SteamCMD before preceeding."); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } return(bInstalled); }
public bool SteamCMDProcess(bool bValidationEnable, string pSteamPath, string pServerLocation) { bool bInstalled = false; Process process = new Process(); process.StartInfo.CreateNoWindow = true; try { if (pSteamPath != null || pSteamPath != "") { process.StartInfo.FileName = pSteamPath; string sConanServerLocation = pServerLocation; if (sConanServerLocation == "") { string sMessage = "Please select a location for the server."; process.StartInfo.Arguments = ""; MessageBox.Show(sMessage); FileWatcherConanWPF.SettingsForm form = new FileWatcherConanWPF.SettingsForm(); form.Show(); } else { if (bValidationEnable == true) { process.StartInfo.Arguments = $" +login anonymous +force_install_dir {sConanServerLocation} +app_update 443030 validate +exit"; } else { process.StartInfo.Arguments = $" +login anonymous +force_install_dir " + '"' + sConanServerLocation + '"' + " +app_update 443030 +exit"; } } if (process.StartInfo.Arguments != "") { process.Start(); process.WaitForExit(); bInstalled = true; } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } return(bInstalled); }