private void CheckRegValveSteamSmodPath() { try { // Example of using this awesome library var steamData = SteamPathsUtil.GetSteamData(); var text = steamData != null ? steamData.SourceModInstallPath : ""; checkBoxVavleSteamSmodPath.Checked = true; checkBoxVavleSteamSmodPath.ForeColor = Color.Green; checkBoxVavleSteamSmodPath.CheckState = CheckState.Checked; txtBoxVavleSteamSmodPath.Text = text; if (txtBoxVavleSteamSmodPath.Text == @"") { checkBoxVavleSteamSmodPath.ForeColor = Color.OrangeRed; checkBoxVavleSteamSmodPath.CheckState = CheckState.Indeterminate; toolTip.SetToolTip(checkBoxVavleSteamSmodPath, "SourceModInstallPath is presented but empty!"); } } catch (Exception ex) { checkBoxVavleSteamSmodPath.Checked = checkBoxVavleSteamSmodPath.Checked = false; checkBoxVavleSteamSmodPath.ForeColor = checkBoxVavleSteamSmodPath.ForeColor = Color.Red; checkBoxVavleSteamSmodPath.CheckState = CheckState.Unchecked; txtBoxVavleSteamSmodPath.Text = @"Not found"; Console.WriteLine(ex); } }
private void CheckSteamAppById(int appId, TextBox outputTextBox, CheckBox outputCheckBox, CheckBox outputInstalledCheckBox) { var appData = SteamPathsUtil.GetSteamAppDataById(appId); var check = appData != null ? appData.Installed : false; var path = appData != null ? appData.RegistryKey : ""; outputTextBox.Text = path; if (check) { outputCheckBox.Checked = true; outputCheckBox.ForeColor = Color.Green; outputInstalledCheckBox.Checked = true; outputInstalledCheckBox.ForeColor = Color.Green; outputInstalledCheckBox.Text = "Installed: " + appId; } else { outputCheckBox.Checked = false; outputCheckBox.ForeColor = Color.Red; outputInstalledCheckBox.Checked = false; outputInstalledCheckBox.ForeColor = Color.Red; outputInstalledCheckBox.Text = "Installed: " + appId; } }
private void CheckRegValveSteamExePid() { try { // Example of using this awesome library var activeProcess = SteamPathsUtil.GetActiveProcessSteamData(); var text = (activeProcess != null ? activeProcess.PID : 0).ToString(); checkBoxVavleSteamPID.Checked = true; checkBoxVavleSteamPID.ForeColor = Color.Green; checkBoxVavleSteamPID.CheckState = CheckState.Checked; txtBoxVavleSteamPID.Text = text; if (txtBoxVavleSteamPID.Text == @"0") { checkBoxVavleSteamPID.ForeColor = Color.OrangeRed; checkBoxVavleSteamPID.CheckState = CheckState.Indeterminate; toolTip.SetToolTip(checkBoxVavleSteamPID, "Steam installed but not running"); } } catch (Exception ex) { checkBoxVavleSteamPID.Checked = checkBoxVavleSteamPID.Checked = false; checkBoxVavleSteamPID.ForeColor = checkBoxVavleSteamPID.ForeColor = Color.Red; checkBoxVavleSteamPath.CheckState = CheckState.Unchecked; txtBoxVavleSteamPID.Text = @"Not found"; Console.WriteLine(ex); } }
private void CheckRegValveReg() { try { // Example of using this awesome library var text = SteamPathsUtil.GetValveKeyRegistry(); checkBoxVavleReg.Checked = true; checkBoxVavleReg.ForeColor = Color.Green; txtVavleReg.Text = text; } catch (Exception ex) { checkBoxVavleReg.Checked = checkBoxVavleSteamReg.Checked = false; checkBoxVavleReg.ForeColor = checkBoxVavleSteamReg.ForeColor = Color.Red; txtVavleReg.Text = @"Not found"; Console.WriteLine(ex); } }