简体   繁体   English

在安装之前强制Installshield卸载

[英]Forcing Installshield to uninstall before an install

I have an InstallShield 12 installscript. 我有一个InstallShield 12安装脚本。 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? 我怎样才能做到这一点?

Assuming this is not an MSI project and youve kept the same Project GUID, you could simply call ComponentUninstall() in the OnMaintUIBefore function. 假设这不是MSI项目,并且您保留了相同的Project GUID,则可以只在OnMaintUIBefore函数中调用ComponentUninstall() 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. 如果Project GUID不相同,则可以在注册表中的HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{PROJECT_GUID}下查看卸载字符串,然后执行LaunchApp。

Hope it helps. 希望能帮助到你。

With an MSI-based project, this would be accomplished by configuring a Major Upgrade for your project. 对于基于MSI的项目,这可以通过为项目配置主要升级来实现。 Upgrades don't exist for InstallScript projects, but there are no Windows Installer restrictions to keep you from running multiple installations simultaneously. InstallScript项目不存在升级,但是没有Windows Installer限制,可以防止您同时运行多个安装。 You should be able to simply run the uninstallation of the previous version manually in your InstallScript code (maybe in the OnFirstUIBefore function). 您应该能够简单地在InstallScript代码中手动运行先前版本的卸载(也许在OnFirstUIBefore函数中)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM