如何替换 MSI 的卸载部分 [英] how to replace the uninstallation part of an MSI

查看:30
本文介绍了如何替换 MSI 的卸载部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 VS2010 安装项目构建了一个 msi 安装程序.

I've build a msi installer using a VS2010 setup project.

由于自定义操作中的1001 Exception: Invalid format for argument machineName"(见下文),现在项目不会卸载.

Now the project does not deinstall because of a "1001 Exception: Invalid format for argument machineName" (see below) inside a custom action.

我无法使用从系统控件中删除或 msiexec/uninstall 卸载应用程序.

I am unsucessful at uninstalling the application using the remove from the system control or msiexec /uninstall.

有没有办法强制卸载?

详情:

作为自定义操作的一部分,我注册了一个自定义事件源,我的应用程序使用该源将事件登录到 Windows 日志中:

As part of a custom action I register a custom event source which my app uses for event loging into the windows log:

public override void Install(IDictionary stateSaver) {  
        base.Install(stateSaver);  
        EventLog.CreateEventSource("VeodinRecorder","Application");  
}  

在卸载"中,我尝试使用

inside of the "Uninstall" I try to remove this Eventsource with

if (!EventLog.SourceExists("VeodinRecorder"))  
   EventLog.Delete("VeodinRecorder"); `

EventLog.Delete 也将 machinename 作为第二个参数所以我尝试用 msiexec/fv 覆盖用于卸载的 msi 并更改卸载操作:

The EventLog.Delete also takes machinename as second argument So I tried to overwrite the msi used for uninstallation with msiexec /fv and changed the uninstall action:

   EventLog.Delete("VeodinRecorder","."); 
   EventLog.Delete("VeodinRecorder","Application"); 

我什至将整个卸载操作"留空.

I even left the whole "uninstall action" blank.

但似乎没有任何效果.

有什么提示吗?

完整日志:

错误 1001.错误 1001.卸载时发生异常.此异常将被忽略,卸载将继续.但是,卸载完成后应用程序可能无法完全卸载.--> 参数 machineName 的格式无效.MSI (s) (60!68) [22:49:00:101]:
调试:错误 2769:自定义操作 _3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall 未关闭 1 个 MSIHANDLE.
安装程序在安装此软件包时遇到意外错误.这可能表明此包存在问题.错误代码是 2769.参数是:_3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall, 1,CustomAction _3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall 返回实际错误代码 1603(请注意,如果在沙箱内进行翻译,这可能不是 100% 准确)
操作在 22:49:00 结束:InstallExecute.返回值 3.
操作于 22:49:00 结束:安装.返回值 3.

Error 1001. Error 1001. An exception occurred while uninstalling. This exception will be ignored and the uninstall will continue. However, the application might not be fully uninstalled after the uninstall is complete. --> Invalid format for argument machineName. MSI (s) (60!68) [22:49:00:101]:
DEBUG: Error 2769: Custom Action _3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall did not close 1 MSIHANDLEs.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2769. The arguments are: _3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall, 1, CustomAction _3C1D0358_8969_4B01_B8FA_B6B43F4E9E4C.uninstall returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 22:49:00: InstallExecute. Return value 3.
Action ended 22:49:00: INSTALL. Return value 3.

推荐答案

当我使用 msiexec/fv 更新安装时,似乎没有更新 CustomAction.dll.

It seems that the CustomAction.dll was not updated when I update the installation with msiexec /fv.

我现在手动将新构建的 CustomAction.dll(带有空的卸载覆盖)放入安装文件夹并能够卸载.

I now manually placed the newly build CustomAction.dll (with an empty uninstall override) into the installation folder and was able to uninstall.

更新:(感谢@pcans)使用 ORCA 编辑当前安装的 msi 并手动禁用卸载自定义操作.

Update: (Credits to @pcans) use ORCA to edit the currently installed msi and manually disable the uninstall custom action.

这篇关于如何替换 MSI 的卸载部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆