我的应用程序(使用C#.net开发)现在打开我卸载,InstallShield给出消息,说明应用程序已经打开,是否真的要关闭应用程序。选择'忽略'继续卸载。某些文件和应用程序的exe文件未关闭。如何在卸载时通过installshield关闭它们。或者我必须设置一些属性。我知道在卸载时添加自定义操作我可以终止进程,但不应该installshield吗?
答案 0 :(得分:0)
如果您的目标是重新启动打开的应用程序而不遵守“忽略”选项,则可以考虑将“REBOOT”属性设置为“强制”。这将要求用户重新启动系统,从而实现所需的结果。
答案 1 :(得分:0)
如果您的项目类型是InstallScript MSI或它支持Installscript,我更喜欢为此编写代码,例如:
export prototype _Server_UnInstalling();
function _Server_UnInstalling()
STRING Application, ServiceName;
begin
//application name
Application = "Demo";
MessageBox("In _Server_UnInstalling",INFORMATION);
//Check whether application is running or not.
if ProcessRunning( Application ) then
MessageBox("Demo is running",INFORMATION);
//Close server Application
ProcessEnd(Application);
endif;
//if application is having service at the background then
ServiceName = "Demo Server";
//Uninstall the server windows services on uninstallation.
ServiceRemoveDuringUninstallation(ServiceName);
end;
上面的示例给出了框架,您需要实现 ProcessRunning,ProcessEnd和ServiceRemoveDuringUninstallation 方法的逻辑,您可以参考他们提供文档的Installshield帮助文档以及源代码
希望这会有所帮助...