【问题标题】:C# code to uninstall the installshield setup用于卸载 installshield 设置的 C# 代码
【发布时间】:2019-03-12 08:51:35
【问题描述】:
  1. 我已经使用 Installshield 进行了设置。 (Setup.exe)。
  2. 我希望 c# 代码使用 Installshield 安装产品代码卸载该 exe。
  3. 另外,我必须知道为什么在尝试手动卸载时 exe 没有卸载。它的触发器回滚。
  4. 我的日志文件看起来像这样。有什么问题吗?

注意:我已在我的 Installshield 设置中附加了 MergeModule(MSM)。

【问题讨论】:

  • 首先您需要创建一个有效的 MSI 安装程序,它可以安装/卸载而不会破坏任何东西。其次,扫描注册表项以找到您的 InstallShield 应用程序,support.microsoft.com/en-ca/help/247501/…docs.microsoft.com/en-us/windows/desktop/msi/…
  • 请不要发布代码和日志条目的图片,只需将它们内联添加到您的问题中,最好使用格式,但我们可以帮助您添加。把你的文字转储在那里。

标签: windows-installer installshield


【解决方案1】:

记录和调试:如果您的设置在卸载期间回滚,请检查 MSI 日志文件。您似乎有一个日志文件,因此请搜索 "Value 3"This trick on MSI logging and debugging is explained in this answer.

共享组件:组件可以由已安装的多个产品共享。除非只有一个产品注册为“客户端”,否则在卸载过程中不会删除这些组件。您可以使用此 VBScript 确定哪些产品共享该组件。建议您将其保存到文本文件并从桌面运行。从问题中显示的日志文件中输入组件 GUID:

Dim installer : Set installer = CreateObject("WindowsInstaller.Installer")
Dim counter : counter = 1

' Get component GUID from user
componentguid = Trim(InputBox("Please specify component GUID to look up (sample provided, please replace):", "Component GUID:","{4AC30CE3-6D22-5D84-972C-81C5A4775C3D}"))
If componentguid = vbCancel Or Trim(componentguid) = "" Then
   WScript.Quit(0) ' User aborted
End If

' Get list of products that share the component specified (if any)
Set componentclients = installer.ComponentClients(componentguid)
If (Err.number <> 0) Then
   MsgBox "Invalid component GUID?", vbOKOnly, "An error occurred:"
   WScript.Quit(2) ' Critical error, abort
End If

' Show the products
For Each productcode in componentclients
   productname = installer.productinfo (productcode, "InstalledProductName")
   productlist = productlist & counter & " - Product Code: " & productcode & vbNewLine & "Product Name: " & productname & vbNewLine & vbNewLine
   counter = counter + 1
Next

message = "The below products share component GUID: " & componentguid & vbNewLine & vbNewLine

MsgBox message & productlist, vbOKOnly, "Products sharing the component GUID: "

DumpComponentList.zip:Windows Installer Expert Phil Wilson 有另一个 VBScript,它将所有 Windows Installer 组件转储到一个文本文件中。上面的脚本改编自你可以在这里找到的那​​个脚本:DumpComponentList.zip

DTF:对于 .NET,有适用于 Windows Installer Win32 / COM API 的 DTF 包装器 (Microsoft.Deployment.WindowsInstaller.dll - this file is installed with WiX)。这是来自Tom Blodget using LINQ to access Windows Installer information 的回答。

【讨论】:

    猜你喜欢
    • 2014-02-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-27
    相关资源
    最近更新 更多