public void Start(string taskName, string overrideString = "") { switch (taskName) { case "install": Install(); InstallOrUninstallRootCertificate(false); InstallOrUninstallRootCertificate(true); ProxyOverrider(overrideString); FirefoxCertificateManager.Install(this); Servicestarter.Start(this); SpellInstall.NspInstall.InstallNSP(); break; case "uninstall": Uninstall(); SpellInstall.NspInstall.UInstallNSP(); break; case "enable": EnableOrDisableProxy(true); break; case "disable": EnableOrDisableProxy(false); break; case "recheck": FirefoxCertificateManager.Install(this); if (Util.ModifiyConnString == null) { byte[] getConnString = GetDefaultConnSetting(); if (getConnString == null) { byte[] byteConnString = Util.DefaultConnString; byteConnString = EditDefaultConnectionSettings.EditProxyOverride(byteConnString, string.Empty); SetOrResetDialupSetting(true, byteConnString); } else { SetOrResetDialupSetting(true, getConnString); } } else { SetOrResetDialupSetting(true, Util.ModifiyConnString); } break; case "proxyoverride": ProxyOverrider(overrideString); break; default: break; } }
public void Uninstall() { //Logger.Info("Enter"); SetOrResetProxy(false, string.Empty); InstallOrUninstallRootCertificate(false); FirefoxCertificateManager.UnInstall(this); //Logger.Info("Exit"); }
private void EnableOrDisableProxy(bool isSet) { if (isSet) { Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxySettingsPerUser", (object)0); FirefoxCertificateManager.EnableOrDisablePorxy(this, true); } else { Microsoft.Win32.Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxySettingsPerUser", (object)1); FirefoxCertificateManager.EnableOrDisablePorxy(this, false); } }
public void ProxyOverrider(string overrideString) { var proxyEnable = Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxySettingsPerUser", null); if (proxyEnable != null && (int)proxyEnable == 0) { if (overrideString == null) { overrideString = string.Empty; } SetOrResetProxy(true, overrideString); List <string> listOverrideString = overrideString.Split(new char[] { ';' }).ToList();; FirefoxCertificateManager.EditProxyOverride(this, listOverrideString); } }
//public static RegistryEditor RegEditor = new RegistryEditor(); public RegistryEditor() { try { //if (logger == null) //{ // ILog tempLogger = CLogger.CreateLogger(); // if (tempLogger != null) // { // Logger = tempLogger; // } //} //else //{ // Logger = logger; //} } catch (Exception) { } FirefoxCertificateManager.GetFireFoxInstallationDirectory(this); }