安装Shield 2009 Premier,卸载不会关闭进程/ gui

时间:2009-05-29 09:46:59

标签: window installshield uninstall

我的应用程序(使用C#.net开发)现在打开我卸载,InstallShield给出消息,说明应用程序已经打开,是否真的要关闭应用程序。选择'忽略'继续卸载。某些文件和应用程序的exe文件未关闭。如何在卸载时通过installshield关闭它们。或者我必须设置一些属性。我知道在卸载时添加自定义操作我可以终止进程,但不应该installshield吗?

2 个答案:

答案 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帮助文档以及源代码

希望这会有所帮助...

相关问题