问题
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.
I could not find any options to supports this in the install4j documentation or forums.
On stackoverflow I found answers for NSIS and Inno, but not for 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?
回答1:
You can add a "Check for running processes" action before the "Uninstall files" action.
来源:https://stackoverflow.com/questions/54476403/how-do-i-check-if-the-installed-program-is-running-at-the-beginning-of-the-insta