Rollback if file is in use. - Advanced Installer Community
SubZero
Posts: 63
Joined: Mon Mar 14, 2011 10:29 am

Rollback if file is in use.

Hi AI-Team,
I have a *.jar file that should be overwritten during the update phase (we have install new version first then uninstall old version in order to perform proper rollback). Unfortunately under Server2008 64bit if the file is in use the system plans a reboot at the end....that is problematic because the new file is needed during the installation.
Is it possible to detect if the file is in use and if so perform a direct rollback? Unfortunately I can't just kill all java.exe because our customer may have other java programs running during update.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Rollback if file is in use.

Hello,

Any action which have the return value 3 will trigger the rollback of the installation process. Here's the Logging of Action Return Values article with related information.

You can have a Detect Process custom action in order to see if your process java.exe is running. If the process is running, the value of the AI_PROCESS_STATE property will be Running . You can take advantage of this property in order to condition the execution of the custom action which will trigger the rollback.

Also, another approach is the one from the Checking for the running process and terminating the same forum thread.

Please let me know if there is anything else I can help you with.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”