如何阻止Installer.Commit()运行?

发布于 2024-09-10 12:03:33 字数 235 浏览 2 评论 0原文

我需要防止在我的 CustomActions 托管代码中运行 Installer.Commit 方法。 如果我只是在重写的 Commit 方法中不执行任何操作,它仍然会提交(它在程序和功能列表中创建一个元素),而我不希望这样。

如果我说 base.Commit(null) 它会停止,但会弹出一个错误。我怎样才能在没有任何消息的情况下默默地执行此操作?

我可以以某种方式更改savedState,这样它就不会真正提交安装吗?

I need to prevent of running Installer.Commit method in my CustomActions managed code.
If I just do nothing inside overrided Commit method, it still commits (it creates an element in Programs and Features list) and I don't want that.

If I say base.Commit(null) it stops, but popups an error. How can I do this silently without any messages?

Can I change savedState somehow so it wouldn't actually commit the installation?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最美不过初阳 2024-09-17 12:03:33

提交并不负责将您的产品发布到 ARP。 Windows Installer 通过 PublishProduct 标准操作执行此操作,您可以使用 ARPSYSTEMCOMPONENT 属性禁用它,但您使用的安装创作工具实际上不会公开此操作(或 MSI 可以执行的任何其他操作)。

http://msdn.microsoft.com/en -us/library/aa367750(v=VS.85).aspx

如果您想拥有高质量的安装程序,则不应使用 VDPROJ 或 InstallUtil / InstallerClass 自定义操作。

The commit isn't what is responsible for publishing your product to ARP. Windows Installer does this via the PublishProduct standard action and you could disable it using the ARPSYSTEMCOMPONENT property except that the installation authoring tool that you are using doesn't actually expose this ( or just about anything else MSI can do ).

http://msdn.microsoft.com/en-us/library/aa367750(v=VS.85).aspx

If you want to have a high quality installer you shouldn't use VDPROJ or InstallUtil / InstallerClass custom actions.

一片旧的回忆 2024-09-17 12:03:33

在这种情况下,我没有找到任何解决方案,只能在 Commit() 之后删除注册表项。

中的所有密钥

我已删除HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\Products
其中 UninstalString 值包含 ProductCode (应用程序的 GUID)

我还从中删除了一个密钥
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall 其中子项名称 == ProductCode

我猜还剩下一些东西。我不知道。

In this case I haven't found any solution but deleting the registry entries right after Commit().

I've deleted all the keys in

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\Products
where UninstalString value contains ProductCode (GUID of the app)

I also deleted a key from
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall where the SubKey name == ProductCode

I guess there is something left. I'm not sure.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文