uninstaller: Unregister any ActiveX plugin uninstalled

merge-requests/4/head 34.0.0.295
darktohka 2 years ago
parent 6f68332a30
commit 93aa977a47

@ -51,6 +51,10 @@ namespace CleanFlashCommon {
return;
}
if (file.Extension.ToLower().Equals(".ocx")) {
Uninstaller.UnregisterActiveX(file.FullName);
}
try {
file.IsReadOnly = false;
file.Delete();

@ -27,6 +27,24 @@ namespace CleanFlashCommon {
WinAPI.AllowModifications();
}
public static void UnregisterActiveX(string filename) {
string relativeFilename = Path.GetFileName(filename);
ProcessStartInfo info = new ProcessStartInfo {
FileName = "regsvr32.exe",
UseShellExecute = false,
CreateNoWindow = true
};
Directory.SetCurrentDirectory(Path.GetDirectoryName(filename));
info.Arguments = "/s /u " + relativeFilename;
ExitedProcess process = ProcessUtils.RunProcess(info);
if (!process.IsSuccessful) {
throw new InstallException(string.Format("Failed to unregister ActiveX plugin: error code {0}\n\n{1}", process.ExitCode, process.Output));
}
}
public static void UninstallRegistry() {
if (Environment.Is64BitOperatingSystem) {
RegistryManager.ApplyRegistry(Properties.Resources.uninstallRegistry, Properties.Resources.uninstallRegistry64);

Loading…
Cancel
Save