卸载 - 目标仍在运行? [英] Uninstall - Target Still Running?

查看:69
本文介绍了卸载 - 目标仍在运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在卸载过程中,如何检查我的卸载应用程序当前是否正在运行?


-

- Thom Little - www.tlaNET.net - Thom Little Associates,有限公司

-

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.
--

推荐答案

你好,


根据我的理解,你想要卸载一个应用程序,所以你想要在卸载之前知道应用程序是否正在运行。


================================

您可以参考System.Diagnostics命名空间。


您可以使用Process.GetProcessesByName方法返回运行

进程的列表,其名称是您的应用程序。


如果您无法确定应用程序的名称,我认为您可以使用

Process.GetProcesses方法来使所有进程当前运行。然后

为每个进程,你可以使用Process.MainModule.FileName获取

进程'的主模块'的完整文件路径。(你可以比较一下)用你的

应用程序的路径来判断它是否是你的应用程序的过程


=========== ====================

请在上面提出我的建议并告诉我它是否有助于解决您的问题

问题。


感谢您的耐心与合作。如果您有任何疑问或

担忧,请随时将其发布在小组中。我正准备等待

的帮助。


祝你好运,

Jeffrey Tan

Microsoft在线合作伙伴支持

安全! - www.microsoft.com/security

此帖子按原样提供没有保证,也没有授予任何权利。

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.Diagnostics namespace.

You can use Process.GetProcessesByName 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.GetProcesses method to get all the processes current running. Then
for each process, you may use Process.MainModule.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.


你很遗憾地回答了我问的问题,而不是我问的问题。
以为我问过...


有没有办法在确定后关闭正在运行的任务或

你被限制为告诉用户关闭它下来并退出

卸载"?


我的假设是无法关闭它。


-

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

-


"" Jeffrey Tan [MSFT]"" <,V - ***** @ online.microsoft.com>在消息中写道

news:j9 ************** @ cpmsftngxa06.phx.gbl ...
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.microsoft.com> wrote in message
news:j9**************@cpmsftngxa06.phx.gbl...
Hi Thom,

根据我的理解,你想要卸载一个应用程序,所以你想在卸载之前知道一个应用程序是否正在运行。

=== =============================
您可以参考System.Diagnostics命名空间。

您可以使用Process.GetProcessesByName方法返回正在运行的进程列表,whoes name是您的应用程序。

如果您无法确定应用程序的名称,我想您可以使用
Process.GetProcesses方法使所有进程当前运行。然后,对于每个进程,您可以使用Process.MainModule.FileName来获取
进程的主模块的完整文件路径。(您可以将其与您的
应用程序进行比较'确定它是否是你的应用程序的过程的路径

=========================== ====
请在上面提出我的建议并告诉我它是否有助于解决您的问题。

感谢您的耐心与合作。如果您有任何疑问或担忧,请随时在小组中发布。我很乐意帮助您。

致以最诚挚的问候,
Jeffrey Tan
Microsoft在线合作伙伴支持
获得安全保障! - www.microsoft.com/security
此帖子提供就像没有保证,也没有授予任何权利。
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.Diagnostics namespace.

You can use Process.GetProcessesByName 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.GetProcesses method to get all the processes current running. Then
for each process, you may use Process.MainModule.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.



您好,


非常感谢您的反馈。


如果您已确定进程现在正在运行,通常的方法是通知

用户将卸载该应用程序,并让

用户正确关闭它。


您也可以使用Process.Kill方法自行终止它,但数据

编辑通过分配给该过程的过程或资源可能会丢失。所以

不推荐使用这种方式。


总而言之,你应该使用你的第二个选项。


感谢您的耐心与合作。如果您有任何疑问或

担忧,请随时将其发布在小组中。我正准备等待

的帮助。


祝你好运,

Jeffrey Tan

Microsoft在线合作伙伴支持

安全! - www.microsoft.com/security

此帖子按原样提供没有保证,也没有赋予任何权利。

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.


这篇关于卸载 - 目标仍在运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆