Use Inno Setup to delete another application not installed with Inno Setup during installation

a 夏天 提交于 2020-01-01 03:33:09

问题


I have an old VB6 application that is deployed using a very old 16 bit version of InstallShield. I have created a new installer with Inno Setup to be 64 bit friendly for my VB6 application with updates.

All of my users already have the existing InstallShield version installed. Currently, I have Inno Setup working. The problem is, I do not want to overwrite the old InstallShield installation files, so my Inno Setup installs to another directory. This causes problems because now I have two versions installed, with two separate icons.

I need a way to invoke the uninstaller of the old InstallShield application when I install the new Inno Setup version. How do I call the uninstaller from the Windows Add/remove programs through Inno Setup? If i reuse the app id for the InstallShield version to be the same as the Inno Setup, and then manually delete the old files, would that work?


回答1:


You would have to locate the InstallShield uninstall registry key which will reside under either HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ or HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ and then execute its UninstallString value. Once that is done, delete the registry key: it is not possible to reuse the same key with Inno Setup since it will always append _is1 to your AppId to generate the uninstall registry key name. Additionally on older Windows versions it may also truncate this key name and append a checksum, because of length limitations.

Do all this from a PrepareToInstall event function.



来源:https://stackoverflow.com/questions/2470084/use-inno-setup-to-delete-another-application-not-installed-with-inno-setup-durin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!