【发布时间】:2012-03-17 08:26:00
【问题描述】:
我们有一个 Excel 插件,比如用 C# 编写的 A,Add-In Express。安装程序是从 VS 中的安装项目构建的。 现在我们想将它集成到另一个更大的插件应用程序中,比如 B。 我们希望能够在安装 B 的过程中卸载 A。 B 也是用 C# 编写的,但它的安装程序是从 Advanced Installer 构建的。
我尝试了如下所示的 VBA,加载项仅包含“A XLL 加载项”但不包含“A COM 加载项”。所以它不起作用。所以我想写一个exe来检测是否安装了A,如果是,卸载它。
并在 B 的安装程序中调用 exe。
任何人都知道如何“卸载 C# 中的程序”?还是有更好的解决方案?谢谢
一旦我可以检测到 A 并在 exe 中卸载它,我就可以将它挂接到 B 的安装程序中。
.NET 中的安装程序/卸载程序类不是一个选项,因为我没有在 B 的安装程序中使用它们。
Dim item As AddIn
Set item = Application.AddIns("A COM Add In")
If Not item Is Nothing Then
item.Installed = False
'item = Nothing 'Not sure if this does anything
End If
Dim item As AddIn
Set item = Application.AddIns("A XLL Add In")
If Not item Is Nothing Then
item.Installed = False
'item = Nothing 'Not sure if this does anything
End If
【问题讨论】:
标签: c# excel windows-installer add-in uninstallation