如何检查已安装的程序是否在install4j卸载程序的开头运行? [英] How do I check if the installed program is running at the beginning of the install4j uninstaller?

查看:105
本文介绍了如何检查已安装的程序是否在install4j卸载程序的开头运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Java程序(如果需要的话,可以使用Eclipse RCP),该程序可以通过install4j进行安装和卸载.除卸载程序会在程序运行时愉快地卸载(大部分)程序,导致卸载不完全和程序崩溃(可能导致数据丢失)外,此程序运行正常.

I have a Java program (Eclipse RCP in case that matters) that is installed and uninstalled with install4j. This works fine, except that the uninstaller will happily uninstall (most of) my program while it is running, leading to an incomplete uninstall and a program crash (with potential data loss).

我希望卸载程序在删除任何文件之前检查程序是否正在运行,并在必要时提示用户退出程序.

I would like the uninstaller to check whether the program is running before deleting any files, and prompt the user to exit the program if necessary.

在install4j文档或论坛中找不到支持此功能的任何选项.

I could not find any options to supports this in the install4j documentation or forums.

在stackoverflow上,我找到了 NSIS的答案 Inno ,但不适用于install4j.

On stackoverflow I found answers for NSIS and Inno, but not for install4j.

可以使用install4j完成此操作,还是需要自定义代码?我是否必须让我的程序对请求/消息做出反应以使其可检测?

Can this be done with install4j, or do I need custom code? Do I have to make my program react to requests/messages to make it detectable?

推荐答案

您可以在卸载文件"操作之前添加检查正在运行的进程"操作.

You can add a "Check for running processes" action before the "Uninstall files" action.

这篇关于如何检查已安装的程序是否在install4j卸载程序的开头运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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