mirror of
https://gitlab.com/cleanflash/installer.git
synced 2026-08-12 18:31:37 +08:00
uninstaller: Unregister any ActiveX plugin uninstalled
This commit is contained in:
@@ -51,6 +51,10 @@ namespace CleanFlashCommon {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (file.Extension.ToLower().Equals(".ocx")) {
|
||||||
|
Uninstaller.UnregisterActiveX(file.FullName);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
file.IsReadOnly = false;
|
file.IsReadOnly = false;
|
||||||
file.Delete();
|
file.Delete();
|
||||||
|
|||||||
@@ -27,6 +27,24 @@ namespace CleanFlashCommon {
|
|||||||
WinAPI.AllowModifications();
|
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() {
|
public static void UninstallRegistry() {
|
||||||
if (Environment.Is64BitOperatingSystem) {
|
if (Environment.Is64BitOperatingSystem) {
|
||||||
RegistryManager.ApplyRegistry(Properties.Resources.uninstallRegistry, Properties.Resources.uninstallRegistry64);
|
RegistryManager.ApplyRegistry(Properties.Resources.uninstallRegistry, Properties.Resources.uninstallRegistry64);
|
||||||
|
|||||||
Reference in New Issue
Block a user