强制 Installshield 在安装前卸载
我有一个 InstallShield 12 安装脚本。 我想在安装新版本之前卸载旧版本。 我将保持包的名称不变。 我怎样才能做到这一点?
I have an InstallShield 12 installscript. I want to uninstall the old version before installing the new version. I will keep the name of the package unchanged. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设这不是 MSI 项目并且您保留了相同的项目 GUID,则只需在
OnMaintUIBefore
函数中调用ComponentUninstall()
即可。如果项目 GUID 不同,您可以查看注册表中
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{PROJECT_GUID}
下的卸载字符串,然后使用该字符串执行 LaunchApp。希望能帮助到你。
Assuming this is not an MSI project and youve kept the same Project GUID, you could simply call
ComponentUninstall()
in theOnMaintUIBefore
function.If the Project GUID is not the same you can look at the uninstall string in the registry under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{PROJECT_GUID}
and then do a LaunchApp with that.Hope it helps.
对于基于 MSI 的项目,这可以通过为项目配置主要升级来完成。 InstallScript 项目不存在升级,但没有 Windows Installer 限制来阻止您同时运行多个安装。 您应该能够简单地在 InstallScript 代码中手动运行以前版本的卸载(可能在 OnFirstUIBefore 函数中)。
With an MSI-based project, this would be accomplished by configuring a Major Upgrade for your project. Upgrades don't exist for InstallScript projects, but there are no Windows Installer restrictions to keep you from running multiple installations simultaneously. You should be able to simply run the uninstallation of the previous version manually in your InstallScript code (maybe in the OnFirstUIBefore function).