|
Hello. I have created simple application (Windows.Form) + setup project. Everything works fine. I am able to install and uninstall my application if it is not running. But when it is running and i try to uninstall it form add/remove programs, the app will be uninstalled but will be still running. How close application before uninstall. Thanks and regards. EDIT: It doesn't work when my application is HIDDEN. When it is visible then unistaller ask about closing the app. - Moved byOmegaManMVPWednesday, May 27, 2009 3:15 PM (From:Visual C# General)
-
| | kuki1384 Wednesday, May 27, 2009 12:01 PM | This is normal, although it's apparently not what you want. Windows will ask the user toshut down a running app, but only if the apphas atop level window that the user can actually shut down, and then the user might need to save something, then shut it down etc. Windows isn't going to ask a user to run Task Manager to forcible terminate a program, and it's not going to force termination of a program and perhaps cause data loss.I don't know how your app works, but how would a user close it down if the main window is hidden?
The app gets marked for removal after the next reboot.
People handle this with something like a named event that the app checks or has thread waiting on. The uninstall sets the event then the app sees it and finishes.
Phil Wilson- Marked As Answer bykuki1384 Tuesday, August 18, 2009 6:19 AM
-
| | PhilWilson Monday, August 10, 2009 8:00 PM | Hi Kuki,
I performed a test on this issue but didn't reproduce the problem on my side.
I install the application and then run it. Then I uninstall the application from Add/Remove Program. The Windows Installer detects that the file to be removed is currently in use during the uninstallation.
I also have a try making the installed executable hidden and I perform the above test again. I get the same result, i.e. Windows Installer detects that the executable is in use.
I'm using Windows XP. What's the OS version on your target machine?
Sincerely, Linda Liu Please remember to mark the replies as answers if they help and unmark them if they provide no help.
end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com. | | Linda Liu Tuesday, June 02, 2009 10:05 AM | Hello. I did not hide the executable but I hide The form by calling this.Hide().
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
this.Hide();
}
}
I am using Windows XP. I have created InallerClass:
[RunInstaller(true)]
public partial class Installer1 : Installer
{
public Installer1()
{
InitializeComponent();
}
protected override void OnAfterUninstall(IDictionary savedState)
{
//delete all files in directory that created my project
///....
base.OnAfterUninstall(savedState);
}
}
I also added project output of my project to CustomActions in SetupProject. | | kuki1384 Tuesday, June 02, 2009 10:38 AM | Hi Kuki, I perform another test based on your description, i.e. run the application and hide the form and try to remove the application through Add/Remove Program. I do see the uninstallation succeed leaving the process of the application still running. I suggest you submit a bug report on this issue in the Microsoft Connect web site: http://connect.microsoft.com/visualstudio/feedbackSincerely, Linda Liu
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
end us any feedback you have about the help from MSFT at fbmsdn@microsoft.com. - Proposed As Answer byLena Nichols Monday, August 10, 2009 2:41 PM
- Unproposed As Answer bykuki1384 Tuesday, August 18, 2009 6:20 AM
-
| | Linda Liu Wednesday, June 03, 2009 3:59 AM | Downloaded Yesterdaya program called Registry Mechanic (pctools.com) and can't unistall - tried since yesterdayto removed but I see it is"still running"till now- they don' let me removed it. Please, help me to remove it. Appreciate. Thank you. Lena | | Lena Nichols Monday, August 10, 2009 2:46 PM | This is normal, although it's apparently not what you want. Windows will ask the user toshut down a running app, but only if the apphas atop level window that the user can actually shut down, and then the user might need to save something, then shut it down etc. Windows isn't going to ask a user to run Task Manager to forcible terminate a program, and it's not going to force termination of a program and perhaps cause data loss.I don't know how your app works, but how would a user close it down if the main window is hidden?
The app gets marked for removal after the next reboot.
People handle this with something like a named event that the app checks or has thread waiting on. The uninstall sets the event then the app sees it and finishes.
Phil Wilson- Marked As Answer bykuki1384 Tuesday, August 18, 2009 6:19 AM
-
| | PhilWilson Monday, August 10, 2009 8:00 PM |
|