Tag: uninstall

无法卸载Windows服务:“…无法删除,因为它等于日志名称。”

我需要卸载我创建的Windows服务,但是我在Windows中使用“卸载或更改程序”程序得到此错误: 错误。 卸载时发生exception。 此exception将被忽略,卸载将继续。 但是,卸载完成后可能无法完全卸载应用程序。 – >无法删除事件日志源“111 My Service”,因为它等于日志名称。 然后我单击“确定”,程序仍然列在已安装程序的列表中。 更糟糕的是,我无法安装它的新版本。 Windows安装程序说已经安装了该产品的另一个版本,我应该先卸载它。 我如何摆脱这个程序? 更新这是我在其上运行InstallUtil.exe / u命令时发生的事情。 卸载开始了。 请参阅C:\ MyService.MyService的日志文件的内容。 大会的进展。 该文件位于C:\ MyService.MyService.InstallLog。 卸载程序集“C:\ MyService.MyService.exe”。 受影响的参数是:logtoconsole = assemblypath = C:\ MyService.exe logfile = C:\ MyService.MyService.InstallLog删除EventLog源111我的服务。 卸载System.Diagnostics.EventLogInstaller安装程序时发生exception。 System.InvalidOperationException:无法删除事件日志源“111 My Service”,因为它等于日志名称。 卸载时发生exception。 此exception将被忽略,卸载将继续。 但是,应用程序可能无法完全卸载l已完成。 卸载已完成。 卸载时发生exception。 此exception将被忽略,卸载将继续。 但是,应用程序可能无法完全卸载l已完成。

使用c#以编程方式卸载软件

我想通过使用我的代码卸载软件,我已经尝试过wmic方法来执行卸载,但它无法在系统中找到我的软件。 是否可以在不使用msi文件或任何安装文件的情况下卸载。我发现此代码但它不起作用— public string GetUninstallCommandFor(string productDisplayName) { RegistryKey localMachine = Registry.LocalMachine; string productsRoot = @”SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products”; RegistryKey products = localMachine.OpenSubKey(productsRoot); string[] productFolders = products.GetSubKeyNames(); foreach (string p in productFolders) { RegistryKey installProperties = products.OpenSubKey(p + @”\InstallProperties”); if (installProperties != null) { string displayName = (string)installProperties.GetValue(“DisplayName”); if ((displayName != null) && (displayName.Contains(productDisplayName))) { string uninstallCommand = (string)installProperties.GetValue(“UninstallString”); […]