473,657 Members | 2,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Uninstall - Target Still Running?

During an uninstall, how can I check to see if the application I an
uninstalling is currently running?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

Nov 16 '05 #1
24 3706
Hi Thom,

Based on my understanding, you want to un-install an application, so you
want to know whether an application is running before un-install.

=============== =============== ==
You can refer to System.Diagnost ics namespace.

You can use Process.GetProc essesByName method to return a list of running
processes, whoes name is your application.

If you can not determine your application's name, I think you may use
Process.GetProc esses method to get all the processes current running. Then
for each process, you may use Process.MainMod ule.FileName to get the
process's main module's full file path.(You can compare this with your
application's path to determine if it is your application's process)

=============== =============== =
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #2
You unfortunately answered the question I asked and not the question I
thought I asked ...

Is there a way to shutdown the running task after you have identified it or
are you restricted to "tell the user to shut it down and exit the
uninstall"?

My assumption is that there is no way to shut it down.

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

""Jeffrey Tan[MSFT]"" <v-*****@online.mi crosoft.com> wrote in message
news:j9******** ******@cpmsftng xa06.phx.gbl...
Hi Thom,

Based on my understanding, you want to un-install an application, so you
want to know whether an application is running before un-install.

=============== =============== ==
You can refer to System.Diagnost ics namespace.

You can use Process.GetProc essesByName method to return a list of running
processes, whoes name is your application.

If you can not determine your application's name, I think you may use
Process.GetProc esses method to get all the processes current running. Then
for each process, you may use Process.MainMod ule.FileName to get the
process's main module's full file path.(You can compare this with your
application's path to determine if it is your application's process)

=============== =============== =
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #3
Hi Thom,

Thanks very much for your feedback.

If you have determined the process is running now, the normal way is notify
the user that the application is going to be un-installed, and letting the
user to close it properly.

You also may use Process.Kill method to terminate it yourself, but data
edited by the process or resources allocated to the process can be lost. So
it is not recommanded to use this way.

All in all, you should use your second option.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #4
Hi Thom,

Does my reply make sense to you? Do you still have any concern on this
issue?

Please feel free to post. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #5
It ALMOST does. What came up with was ...

using System ;
using System.Windows. Forms ;
using System.Diagnost ics ;

namespace ThomLittleAssoc iates
{
public class tlaSystemTrayDe tect
{
public static void Main( string[] args )
{
for ( ; ; )
{
Process[] procMain = Process.GetProc essesByName(
"tlaSystemT ray" );
if ( procMain.Length > 0 )
MessageBox.Show ( "Your system is currently running
tlaSystemTray.\ nRight-clicktlaSystemT ray and select Exit.\nThen respond OK
to this message.", "tlaSystemT ray" );
else
break ;
}
}
}
}

.... and this works fine when added as a custom action to uninstall.

The only problem is that it displays an empty command line window as it
runs.

My NEXT dumb question is how do I get rid of the bogus command line window?

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

""Jeffrey Tan[MSFT]"" <v-*****@online.mi crosoft.com> wrote in message
news:ie******** ******@cpmsftng xa06.phx.gbl...
Hi Thom,

Does my reply make sense to you? Do you still have any concern on this
issue?

Please feel free to post. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #6
I found it ...

I needed to change the Output Type for this class to Windows Application.

The uninstall is now running correctly and it will sit in the loop waiting
for all occurrences of the application to be removed.

It is really strange that two standard dialogs are not present in the MSI
....

1. Start this application after installation.
2. Shut down this application if running during uninstall.

--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

"Thom Little" <th**@tlanet.ne t> wrote in message
news:uF******** ******@TK2MSFTN GP10.phx.gbl...
It ALMOST does. What came up with was ...

using System ;
using System.Windows. Forms ;
using System.Diagnost ics ;

namespace ThomLittleAssoc iates
{
public class tlaSystemTrayDe tect
{
public static void Main( string[] args )
{
for ( ; ; )
{
Process[] procMain = Process.GetProc essesByName(
"tlaSystemT ray" );
if ( procMain.Length > 0 )
MessageBox.Show ( "Your system is currently running
tlaSystemTray.\ nRight-clicktlaSystemT ray and select Exit.\nThen respond OK
to this message.", "tlaSystemT ray" );
else
break ;
}
}
}
}

... and this works fine when added as a custom action to uninstall.

The only problem is that it displays an empty command line window as it
runs.

My NEXT dumb question is how do I get rid of the bogus command line window?
--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

""Jeffrey Tan[MSFT]"" <v-*****@online.mi crosoft.com> wrote in message
news:ie******** ******@cpmsftng xa06.phx.gbl...
Hi Thom,

Does my reply make sense to you? Do you still have any concern on this
issue?

Please feel free to post. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Nov 16 '05 #7
Hi Thom,

I think the dialog for "Shut down this application if running during
uninstall" does exisit but the wording is a little bit different.

The dialogs in MSI are quite different from the dialogs in WinForm
applications. We have the option to author our customized MSI dialogs,
either through VS.Net Setup project, or through Windows Installer Platform
SDK.

If you need any further assistance on MSI issues, please feel free to post
under "microsoft.publ ic.platformsdk. msi".

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #8

I searched rather aggressively with no luck. If dialogs for ...

1. Start this application after installation.
2. Shut down this application if running during uninstall.

.... exist in the MSI their location is the best kept secret in Visual Studio
..NET 2003.

Do you have a suggested information source?
--
-- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd.
--

"Felix Wang" <v-*****@online.mi crosoft.com> wrote in message
news:T%******** *******@cpmsftn gxa10.phx.gbl.. .
Hi Thom,

I think the dialog for "Shut down this application if running during
uninstall" does exisit but the wording is a little bit different.

The dialogsI looked rather agressibely and if ...Setup project, or through Windows Installer Platform SDK.

If you need any further assistance on MSI issues, please feel free to post
under "microsoft.publ ic.platformsdk. msi".

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #9
Hi Thom,

Thanks for your update. The "2. Shut down this application if running
during uninstall." dialog is not shown in VS.Net. If we open the MSI
generated by Setup project with Windows Installer Platform SDK tool "Orca",
we can see there is a dialog named "FilesInUse ", which contains the
following "Text" control:

The following applications are using files which the installer must update.
You can either close the applications and click "Try Again", or click
"Continue" so that the installer continues the installation, and replaces
these files when your system restarts.

Regards,

Felix Wang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 16 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1742
by: David Bolen | last post by:
Although it isn't often necessary, I tend to be in the habit of uninstalling Python before updating to new minor releases, or especially during the alpha/beta cycle. I'm in the process of uninstalling 2.4a2 to install 2.4a3 and the uninstall is running absolutely dog slow and burning 100% cpu while doing it (all going to mshta.exe). Watching the progress bar it almost seems to be doing a whole bunch of operations per file or something....
2
3014
by: Dave A | last post by:
I have an application that runs in the system tray (taskbar notification area) and it runs at startup. Occasionally I need to release a new version. I have created a deployment project in .Net. With the MSI it detects whether a current version is installed and requests that the user uninstalls it prior to installing the new version. Also, MSI detects a running instance of the application during the uninstall and requests that it be closed...
3
293
by: Thom Little | last post by:
During an uninstall, how can I check to see if the application I an uninstalling is currently running? -- -- Thom Little -- www.tlaNET.net -- Thom Little Associates, Ltd. --
0
8717
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8498
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8600
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7311
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1600
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.