views:

1284

answers:

2

My application (developed using C#.net) is open now i uninstall, InstallShield gives message stating the application is already open and whether really want to close the application. Selection 'Ignore' continues uninstall. Some files and the exe of the application are not closed. How to close them by installshield on uninstall. Or there are some properties I have to set. I know adding a custom action at uninstall i can kill the process, but shouldn't installshield do it?

A: 

If your goal is to restart the open applications and not honor the "Ignore" selection, you might consider setting the "REBOOT" property to "Force". That will ask that user to restart the system, thus achieving your desired result.

William Leara
1. Setup application(running setup.exe), 2. run the program, 3. now uninstall the program(the program is still open), 4. UnInstall warns that application is open, 5. Continue uninstall choosing ignore, 6 Uninstallation completes, 7. now the result is the exe and some dlls have not been deleted and the application is still open!!!My point is, during uninstall should not the application be closed automatically and the related dll and exe files be deleted by uninstall?If the the application is not open, uninstall deletes every files/directories it copied during install.
Samir
Is this an MSI installer, or an InstallScript installer? If MSI, are you using Restart Manager? Do the files get removed after a reboot? In MSI, the way it should work is a) MSI detects open files that it wants to delete; b) it uses Restart Manager to shut them down; c) if unsuccessful, it will prompt you to reboot, and will remove them on the next reboot.
William Leara
A: 

If your project type is InstallScript MSI or it supports Installscript, i prefer to write code for this for example:

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;

The above example give the skeleton, you need to implement the logic for ProcessRunning, ProcessEnd and ServiceRemoveDuringUninstallation methods, you can refer Installshield help doc they have given documentation with along with source code

hope this helps...

Chetan

related questions