我有clickonce应用程序,其中一个要求是即使在应用程序运行时也要卸载应用程序。所以我创建了一个MSI包装器,它安装了clickonce应用程序,更新了注册表等,还用于卸载clickonce应用程序。
项目结构
这有自定义操作集
- Install
* Primary output from console Application 2
* Primary output from console Application 1
- Uninstall
* Primary output from console Application 1
* Primary output from console Application 2
控制台应用程序1& 2挂钩到安装程序上的BeforeInstall和AfterInstall事件。
安装时一切正常,事件日志源被创建,clickonce应用程序启动并安装。安装部分运行顺利,我没有问题。
但是我在卸载时遇到问题,MSI会自行卸载并调用进程来卸载clickonce,它会抛出提示并删除事件日志源。
有一个弹出窗口显示'卸载应用程序没有成功。详细了解更多信息。
单击详细信息按钮可打开错误详细信息文本
PLATFORM VERSION INFO
Windows : 6.1.7600.0 (Win32NT)
Common Language Runtime : 4.0.30319.239
System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)
clr.dll : 4.0.30319.239 (RTMGDR.030319-2300)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
IDENTITIES
Deployment Identity : XXXXX.Client.application, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Error occurred during store lookup, component store may have been corrupted. Following failure messages were detected:
+ Application is not installed.
* Error occurred during uninstall of the application. Following failure messages were detected:
+ Application is not installed.
* Exception occurred during uninstall of application XXXXX.Client.application, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil. Following failure messages were detected:
+ Shortcut removal could not be completed. Publisher or product value is not valid.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [4/17/2012 10:52:36 AM] : Looking up information from component store.
* [4/17/2012 10:52:36 AM] : Uninstall of application XXXXX.Client.application, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil did not succeed.
ERROR DETAILS
Following errors were detected during this operation.
* [4/17/2012 10:52:36 AM] System.Deployment.Application.DeploymentException (SubscriptionState)
- Application is not installed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SubscriptionStore.CheckInstalled(SubscriptionState subState)
at System.Deployment.Application.SubscriptionStore.CheckInstalledAndShellVisible(SubscriptionState subState)
at System.Deployment.Application.DeploymentServiceCom.MaintainSubscriptionInternal(String textualSubId)
* [4/17/2012 10:52:36 AM] System.Deployment.Application.DeploymentException (SubscriptionState)
- Application is not installed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SubscriptionStore.CheckInstalled(SubscriptionState subState)
at System.Deployment.Application.SubscriptionStore.UninstallSubscription(SubscriptionState subState)
at System.Deployment.Application.DeploymentServiceCom.MaintainSubscriptionInternal(String textualSubId)
* [4/17/2012 10:52:36 AM] System.Deployment.Application.DeploymentException (Subscription)
- Shortcut removal could not be completed. Publisher or product value is not valid.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ShellExposure.RemoveSubscriptionShellExposure(SubscriptionState subState)
at System.Deployment.Application.DeploymentServiceCom.MaintainSubscriptionInternal(String textualSubId)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
我尝试了很多方法,似乎没有任何工作
所有这三种方法都会引发同样的错误。但是,当我单独运行它们时似乎都有效。我花了两天多的时间试着把头发拉出来。