I have a setup made with installshield 2012, framework 3.5 and I am generating a new setup. My problem is that my UpgradeCode had to be changed. So I need to Update mi .exe with a different UpgradeCode. My problem is tan when I have the old .exe versión running, the installation do not execute well and the .exe failed when execute. What I need to do is to CONFIRM that Old versión is not running before Install the new version. I have tried to include in my Installer class
我使用installshield 2012,框架3.5进行了设置,我正在生成一个新的设置。我的问题是我的UpgradeCode必须改变。所以我需要使用不同的UpgradeCode更新mi .exe。当我运行旧的.exe文字时,我的问题就是晒黑了,安装执行得不好,执行时.exe失败了。我需要做的是确认在安装新版本之前Oldversión没有运行。我试图在我的Installer类中包含它
public override void Install(IDictionary stateSaver)
{
Process[] processes = Process.GetProcessesByName(processID);
foreach (Process process in processes)
{
process.Kill();
process.WaitForExit();
process.Close();
}
}
But it does not work. Any Ideas? Thanks
但它不起作用。有任何想法吗?谢谢
1 个解决方案
#1
2
Instead of killing without any notifications your application (which myight lead to your users losing unsaved data, etc...) you could ask the user to close it and stop the installation of the new version until the old application is closed.
您可以要求用户关闭它并停止安装新版本,直到旧应用程序关闭,而不是在没有任何通知的情况下杀死您的应用程序(这会导致您的用户丢失未保存的数据等)。
The above link explains how to do it with another tool, but with the right set of custom actions it can be achieved in any setup authoring tool.
上面的链接解释了如何使用其他工具执行此操作,但使用正确的自定义操作集可以在任何设置创作工具中实现。
#1
2
Instead of killing without any notifications your application (which myight lead to your users losing unsaved data, etc...) you could ask the user to close it and stop the installation of the new version until the old application is closed.
您可以要求用户关闭它并停止安装新版本,直到旧应用程序关闭,而不是在没有任何通知的情况下杀死您的应用程序(这会导致您的用户丢失未保存的数据等)。
The above link explains how to do it with another tool, but with the right set of custom actions it can be achieved in any setup authoring tool.
上面的链接解释了如何使用其他工具执行此操作,但使用正确的自定义操作集可以在任何设置创作工具中实现。