简体   繁体   English

Windows Installer-防止覆盖DLL

[英]Windows installer - prevent overriding a dll

I'm creating a setup project (Windows installer) in vs2010. 我正在vs2010中创建一个安装项目(Windows安装程序)。 When the user install it for the 1st time – everything is working just fine, but when the user try to upgrade the old application that's running prevent of coping the new dlls to the installed folder. 当用户第一次安装它时-一切工作都很好,但是当用户尝试升级正在运行的旧应用程序时,无法将新的dll复制到已安装的文件夹中。 How to show a user a dialog box that force him to shut down an application that prevent the installer from override a dll? 如何向用户显示一个对话框,迫使他关闭一个阻止安装程序覆盖dll的应用程序?

You need to check if a process with the name of your executable is running. 您需要检查具有可执行文件名称的进程是否正在运行。

Then you can either abort the installation, ask the user to shut down the process or shut it down for them. 然后,您可以中止安装,要求用户关闭该过程或为他们关闭该过程。

If you go for the second option you'll need to double check that they actually have shut it down before proceeding. 如果您选择第二个选项,则需要仔细检查他们是否确实已将其关闭,然后再继续。

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

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