public void VerifyOfficeUninstalled(SetupEventArgs e) { string officePath = null; const string regPath = @"SOFTWARE\Microsoft\Office\ClickToRun\Configuration"; try { var officeRegKey = Registry.LocalMachine.OpenSubKey(regPath); if (officeRegKey != null) { officePath = officeRegKey.GetValue("ClientFolder").ToString(); } else { officePath = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, regPath, "ClientFolder") ?? RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, regPath, "ClientFolder"); } } catch { } if (!string.IsNullOrEmpty(officePath)) { e.Result = ActionResult.Failure; return; } e.Result = ActionResult.Success; }
private string GetOculusHomeLocation() { string path = RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Oculus VR, LLC\Oculus\Config", @"InitialAppLibrary"); if (path != null) { path = path + @"\Software\hyperbolic-magnetism-beat-saber"; } return(path); }
private string GetSteamLocation() { string path = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 1533390", @"InstallLocation"); if (path != null) { path = path + @"\"; } return(path); }
public bool IsBypassed(Uri host) { String proxyHost = RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\CloudHealth Technologies", "ProxyHost"); if (proxyHost == null) { proxyHost = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\CloudHealth Technologies", "ProxyHost"); } // bypass proxy only if there is no proxy host set up return(proxyHost == null || proxyHost.Length == 0); }
public Uri GetProxy(Uri destination) { String proxyHost = RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\CloudHealth Technologies", "ProxyHost"); if (proxyHost == null) { proxyHost = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\CloudHealth Technologies", "ProxyHost"); } if (proxyHost == null || proxyHost.Length == 0) { return(null); } return(new Uri("http://" + proxyHost)); }
public AppFinder() { location = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App " + AppId(), "InstallLocation", ""); if (location.Equals("")) { try { location = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App " + AppId(), "InstallLocation"); } catch (Exception) { } } exeLocation += location + "/" + Executable(); location += DataDirectory(); }
public static string isFullLRInstalled() { try { RegistryKey rk = Registry.ClassesRoot.OpenSubKey(@"\Installer"); if (rk != null) { Helper.Log("Number of keys in isntaller: " + rk.SubKeyCount.ToString()); } else { Helper.Log("Registry.ClassesRoot.OpenSubKey(\"Installer\") returned null!!!"); } //TODO check if the codes exists after uninstall string productCodeLR = Helper.getProductCode(LRUpdateCode); Helper.Log("LRUpdateCode: " + LRUpdateCode); Helper.Log("productCodeLR: " + productCodeLR); string productCodeLRPCHost = Helper.getProductCode(LRPCHostUpdateCode); Helper.Log("LRPCHostUpdateCode: " + LRPCHostUpdateCode); Helper.Log("productCodeLRPCHost: " + productCodeLRPCHost); string installDate = null; if (productCodeLR != null) { Helper.Log("productCodeLR: " + productCodeLR); string registryPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\" + productCodeLR + @"\InstallProperties"; //Helper.log("Registry path: " + registryPath); //installDate = Registry.LocalMachine.OpenSubKey(registryPath).GetValue("InstallDate").ToString(); //RegistryKey rk2 = Registry.LocalMachine.OpenSubKey(registryPath); installDate = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, registryPath, "InstallDate"); //Helper.log("Registry key InstallDate: " + installDate); //installDate = rk2.GetValue("InstallDate").ToString(); //installDate = rk2.GetValue("InstallerLocation").ToString(); //Helper.log("Install date: " + installDate); } if (productCodeLRPCHost != null) { string registryPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\" + productCodeLRPCHost + @"\InstallProperties"; installDate = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, registryPath, "InstallDate"); } return((productCodeLR != null || productCodeLRPCHost != null) ? "Yes " + Html.B(LoadRunner.getLRVersion()) + Helper.convertInstallDate(installDate) : Html.Warning("No")); } catch (Exception ex) { return(ex.ToString()); } }
public void RepairOffice(SetupEventArgs e) { string officePath = null; const string regPath = @"SOFTWARE\Microsoft\Office\ClickToRun\Configuration"; var officeRegKey = Registry.LocalMachine.OpenSubKey(regPath); if (officeRegKey != null) { officePath = officeRegKey.GetValue("ClientFolder").ToString(); } else { officePath = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, regPath, "ClientFolder") ?? RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, regPath, "ClientFolder"); } if (officePath == null) { e.Result = ActionResult.Success; return; } var officeFilePath = officePath + @"\OfficeClickToRun.exe"; if (!System.IO.File.Exists(officeFilePath)) { e.Result = ActionResult.Success; return; } var p = new Process { StartInfo = new ProcessStartInfo() { FileName = officeFilePath, Arguments = "scenario=Repair DisplayLevel=True", CreateNoWindow = true, UseShellExecute = false }, }; p.Start(); p.WaitForExit(); e.Result = ActionResult.Success; }
public static string GetAPIKey() { var logger = new Logger(); var apiKey = (string)RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\CloudHealth Technologies", "AgentAPIKey"); if (apiKey == null) { apiKey = (string)RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\CloudHealth Technologies", "AgentAPIKey"); } if (apiKey == null) { logger.LogError("CHT Agent API Key is null. is AgentAPIKey value in HKEY_LOCAL_MACHINE\\Software\\CloudHealth Technologies set?"); } return(apiKey); }
public AppFinder() { // Attempt to get steam install location (current 32/64 level) location = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App " + AppId(), "InstallLocation", ""); if (location.Equals("")) { // If we are on a 64 bit system, need to read the 64bit registry from a 32 bit app (Valkyrie) try { location = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App " + AppId(), "InstallLocation"); } catch (Exception) { } } exeLocation += location + "/" + Executable(); location += DataDirectory(); }
public static string getPatchesInstalled(string productCode) { //Helper.log("for product code " + productCode); try { string[] patchesCodes = LoadRunner.getPatchesCodes(productCode); string patchesInstalled = null; if (patchesCodes != null) { //Helper.log("Patches codes" + patchesCodes.ToString()); foreach (string patchCode in patchesCodes) { if (patchCode != "Patches") { string keyPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\" + productCode + @"\Patches\" + patchCode; Helper.Log("KeyPath to patch: " + keyPath); if (OSInfo.getOperatingSystemArchitecture().StartsWith("x86")) { RegistryKey rk = Registry.LocalMachine.OpenSubKey(keyPath); patchesInstalled += rk.GetValue("DisplayName").ToString() + " " + Helper.convertInstallDate(rk.GetValue("Installed").ToString()); } else { patchesInstalled += RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, keyPath, "DisplayName") + " " + Helper.convertInstallDate(RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, keyPath, "Installed")); } patchesInstalled += Html.br; } } return(patchesInstalled); } return("No patches were detected"); } catch (Exception ex) { return(Html.Error(ex.ToString())); } }
static string GetPackageNameFromRegistry(string productCode) { var compressedGuid = CompressGUID(productCode); var keyName = $@"SOFTWARE\Classes\Installer\Products\{compressedGuid}\SourceList"; return(RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, keyName, "PackageName")); // NOTE: Remove RegistryWOW6432 and replace with the following code once move to .Net Framework 4+ // // string packageName; // // using (var localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)) // { // using (var sourceList = localKey.OpenSubKey(keyName, false)) // { // packageName = (string)sourceList?.GetValue("PackageName"); // } // } // return packageName; }
static string GetLocalPackageFromRegistry(string productCode, string userSID) { var compressedGuid = CompressGUID(productCode); var keyName = $@"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\{userSID}\Products\{compressedGuid}\InstallProperties"; return(RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, keyName, "LocalPackage")); // NOTE: Remove RegistryWOW6432 and replace with the following code once move to .Net Framework 4+ // // string localPackage; // using (var localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)) // { // using (var installProperties = localKey.OpenSubKey(keyName, false)) // { // localPackage = (string)installProperties?.GetValue("LocalPackage"); // } // } // // return localPackage; }
public static string GetCloudName() { var logger = new Logger(); var cloudName = (string)RegistryWOW6432.GetRegKey32(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\CloudHealth Technologies", "CloudName"); if (cloudName == null) { cloudName = (string)RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\CloudHealth Technologies", "CloudName"); } if (cloudName == null) { if (!warnedCloudName) { logger.LogError("CloudName is null. Defaulting to \"aws\". Is CloudName value in HKEY_LOCAL_MACHINE\\Software\\CloudHealth Technologies set?"); } warnedCloudName = true; cloudName = "aws"; } return(cloudName); }
public static string isVugenSAInstalled() { try { string installDate = null; string installLocation = null; string registryPath = null; if (isFullLRInstalled().Contains("No")) { string productCodeVugenSA = Helper.getProductCode(VugenSAUpdateCode); //Helper.log("ProductCodeVugenSA: " + ProductCodeVugenSA); if (productCodeVugenSA != null) { //Helper.log("ProductCodeVugenSA found in Installer"); installLocation = Helper.getProductInstallLocation(productCodeVugenSA); registryPath = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\" + productCodeVugenSA + @"\InstallProperties"; //InstallLocation = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, registryPath, "InstallLocation"); installDate = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, registryPath, "InstallDate"); string Major = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Mercury Interactive\LoadRunner\CustComponent\Vuser Generator\CurrentVersion", "Major"); string Minor = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Mercury Interactive\LoadRunner\CustComponent\Vuser Generator\CurrentVersion", "Minor"); if (installLocation != null && System.IO.File.Exists(installLocation + @"\bin\vugen.exe")) { return("Yes - Virtual user generator " + Major + "." + Minor + installDate); } } return(Html.Warning("No")); } return(Html.Warning("Checking skipped, full LoadRunner intallation detected")); } catch (Exception ex) { return(Html.Error(ex.ToString())); } }
public AppFinder() { if (Application.platform == RuntimePlatform.OSXPlayer) { ValkyrieDebug.Log("Attempting to locate AppId " + AppId() + " on MacOS."); System.Diagnostics.ProcessStartInfo processStartInfo; System.Diagnostics.Process process; StringBuilder outputBuilder = new StringBuilder(); processStartInfo = new System.Diagnostics.ProcessStartInfo(); processStartInfo.CreateNoWindow = true; processStartInfo.RedirectStandardOutput = true; processStartInfo.RedirectStandardInput = true; processStartInfo.UseShellExecute = false; processStartInfo.Arguments = "SPApplicationsDataType -xml"; processStartInfo.FileName = "system_profiler"; process = new System.Diagnostics.Process(); ValkyrieDebug.Log("Starting system_profiler."); process.StartInfo = processStartInfo; // enable raising events because Process does not raise events by default process.EnableRaisingEvents = true; // attach the event handler for OutputDataReceived before starting the process process.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler ( delegate(object sender, System.Diagnostics.DataReceivedEventArgs e) { // append the new data to the data already read-in outputBuilder.Append(e.Data); } ); // start the process // then begin asynchronously reading the output // then wait for the process to exit // then cancel asynchronously reading the output process.Start(); process.BeginOutputReadLine(); process.WaitForExit(); process.CancelOutputRead(); string output = outputBuilder.ToString(); ValkyrieDebug.Log("Looking for: " + "/" + Executable()); // Quick hack rather than doing XML properly int foundAt = output.IndexOf("/" + Executable()); if (foundAt > 0) { ValkyrieDebug.Log("Name Index: " + foundAt); int startPos = output.LastIndexOf("<string>", foundAt) + 8; ValkyrieDebug.Log("Start Index: " + startPos); location = output.Substring(startPos, output.IndexOf("</string>", startPos) - startPos).Trim(); ValkyrieDebug.Log("Using location: " + location); } } else { // Attempt to get steam install location (current 32/64 level) location = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App " + AppId(), "InstallLocation", ""); if (location.Equals("")) { // If we are on a 64 bit system, need to read the 64bit registry from a 32 bit app (Valkyrie) try { location = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App " + AppId(), "InstallLocation"); } catch (Exception) { } } } exeLocation += location + "/" + Executable(); location += DataDirectory(); ValkyrieDebug.Log("Asset location: " + location); }
public AppFinder() { if (Application.platform == RuntimePlatform.OSXPlayer) { ValkyrieDebug.Log("Attempting to locate AppId " + AppId() + " on MacOS."); System.Diagnostics.ProcessStartInfo processStartInfo; System.Diagnostics.Process process; StringBuilder outputBuilder = new StringBuilder(); processStartInfo = new System.Diagnostics.ProcessStartInfo(); processStartInfo.CreateNoWindow = true; processStartInfo.RedirectStandardOutput = true; processStartInfo.RedirectStandardInput = true; processStartInfo.UseShellExecute = false; processStartInfo.Arguments = "SPApplicationsDataType -xml"; processStartInfo.FileName = "system_profiler"; process = new System.Diagnostics.Process(); ValkyrieDebug.Log("Starting system_profiler."); process.StartInfo = processStartInfo; // enable raising events because Process does not raise events by default process.EnableRaisingEvents = true; // attach the event handler for OutputDataReceived before starting the process process.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler ( delegate(object sender, System.Diagnostics.DataReceivedEventArgs e) { // append the new data to the data already read-in outputBuilder.Append(e.Data); } ); // start the process // then begin asynchronously reading the output // then wait for the process to exit // then cancel asynchronously reading the output process.Start(); process.BeginOutputReadLine(); process.WaitForExit(); process.CancelOutputRead(); string[] output = outputBuilder.ToString().Split("\n\r".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); ValkyrieDebug.Log("Number of lines returned: " + output.Length); if (output.Length == 1) { ValkyrieDebug.Log(output[0]); } ValkyrieDebug.Log("Looking for: " + "/" + Executable()); // Quick hack rather than doing XML properly foreach (string s in output) { if (s.IndexOf("/" + Executable()) > 0) { ValkyrieDebug.Log("Found Line: " + s); location = s.Trim(); // Removing <string> and </string> location = location.Substring(8, location.Length - 17); ValkyrieDebug.Log("Using location: " + location); } } if (location.Length == 0) { location = "~/Library/Application Support/Steam/steamapps/common/Mansions of Madness/Mansions of Madness.app"; ValkyrieDebug.Log("Could not find, using magic locatoin: " + location); } } else { // Attempt to get steam install location (current 32/64 level) location = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App " + AppId(), "InstallLocation", ""); if (location.Equals("")) { // If we are on a 64 bit system, need to read the 64bit registry from a 32 bit app (Valkyrie) try { location = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App " + AppId(), "InstallLocation"); } catch (Exception) { } } } exeLocation += location + "/" + Executable(); location += DataDirectory(); ValkyrieDebug.Log("Asset location: " + location); }
public AppFinder(Platform p) { platform = p; if (p == Platform.MacOS) { ValkyrieDebug.Log("Attempting to locate AppId " + AppId() + " on MacOS."); System.Diagnostics.ProcessStartInfo processStartInfo; System.Diagnostics.Process process; StringBuilder outputBuilder = new StringBuilder(); processStartInfo = new System.Diagnostics.ProcessStartInfo(); processStartInfo.CreateNoWindow = true; processStartInfo.RedirectStandardOutput = true; processStartInfo.RedirectStandardInput = true; processStartInfo.UseShellExecute = false; processStartInfo.Arguments = "SPApplicationsDataType -xml"; processStartInfo.FileName = "system_profiler"; process = new System.Diagnostics.Process(); ValkyrieDebug.Log("Starting system_profiler."); process.StartInfo = processStartInfo; // enable raising events because Process does not raise events by default process.EnableRaisingEvents = true; // attach the event handler for OutputDataReceived before starting the process process.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler ( delegate(object sender, System.Diagnostics.DataReceivedEventArgs e) { // append the new data to the data already read-in outputBuilder.Append(e.Data); } ); // start the process // then begin asynchronously reading the output // then wait for the process to exit // then cancel asynchronously reading the output process.Start(); process.BeginOutputReadLine(); process.WaitForExit(); process.CancelOutputRead(); string output = outputBuilder.ToString(); ValkyrieDebug.Log("Looking for: /" + Executable()); // Quick hack rather than doing XML properly int foundAt = output.IndexOf("/" + Executable()); if (foundAt > 0) { ValkyrieDebug.Log("Name Index: " + foundAt); int startPos = output.LastIndexOf("<string>", foundAt) + 8; ValkyrieDebug.Log("Start Index: " + startPos); location = output.Substring(startPos, output.IndexOf("</string>", startPos) - startPos).Trim(); ValkyrieDebug.Log("Using location: " + location); } } else if (platform == Platform.Linux) { } else if (platform == Platform.Android) { obbRoot = Android.GetStorage() + "/Valkyrie/Obb"; ValkyrieDebug.Log("Obb extraction path: " + obbRoot); location = obbRoot + "/assets/bin/Data"; DeleteObb(); } else // Windows { // Attempt to get steam install location (current 32/64 level) location = (string)Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App " + AppId(), "InstallLocation", ""); if (location.Equals("")) { // If we are on a 64 bit system, need to read the 64bit registry from a 32 bit app (Valkyrie) try { location = RegistryWOW6432.GetRegKey64(RegHive.HKEY_LOCAL_MACHINE, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App " + AppId(), "InstallLocation"); } catch { } } } if (location == null || location.Length == 0) { string[] args = Environment.GetCommandLineArgs(); for (int i = 0; i < (args.Length - 1); i++) { if (args[i] == "-import") { location = args[i + 1]; if (location.Length > 0) { if (location[location.Length - 1] == '/' || location[location.Length - 1] == '\\') { location = location.Substring(0, location.Length - 1); } } ValkyrieDebug.Log("Using import flag location: " + location); } } } exeLocation += location + "/" + Executable(); location += DataDirectory(); ValkyrieDebug.Log("Asset location: " + location); }