【问题标题】:Install Shield 2009 Premier, Uninstall doesn't close the process/gui安装 Shield 2009 Premier,卸载不会关闭进程/gui
【发布时间】:2010-10-29 20:09:59
【问题描述】:

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

【问题讨论】:

    标签: window installshield uninstallation


    【解决方案1】:

    如果您的目标是重新启动打开的应用程序而不支持“忽略”选择,您可以考虑将“REBOOT”属性设置为“Force”。这将要求该用户重新启动系统,从而达到您想要的结果。

    【讨论】:

    • 1.安装应用程序(运行 setup.exe),2.运行程序,3.现在卸载程序(程序仍然打开),4.卸载警告应用程序已打开,5.继续卸载选择忽略,6 卸载完成,7 . 现在结果是exe和一些dll没有被删除,应用程序仍然打开!我的意思是,卸载过程中不应该自动关闭应用程序并通过卸载删除相关的dll和exe文件吗?如果应用程序未打开,卸载会删除它在安装过程中复制的所有文件/目录。
    • 这是 MSI 安装程序,还是 InstallScript 安装程序?如果是 MSI,您使用的是重启管理器吗?重启后文件会被删除吗?在 MSI 中,它应该工作的方式是 a) MSI 检测到它想要删除的打开文件; b) 它使用重启管理器来关闭它们; c) 如果不成功,它将提示您重新启动,并在下次重新启动时将其删除。
    【解决方案2】:

    如果您的项目类型是 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帮助文档以及源代码

    希望这会有所帮助...

    【讨论】:

      猜你喜欢
      • 2010-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多