Uninstall custom action cannot access file - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

rand
Posts: 22
Joined: Tue Sep 29, 2009 4:10 pm

Uninstall custom action cannot access file

I am very impressed with the functionality AI provides.

However, I am stuck on the last piece, something that I must have.
I'm sure it is something I set up incorrectly, but I'm not sure where it look.

Prior to the AI uninstall running I call back into one of my application's jar files.

The java code does three things
1. Removes any windows tasks that my application created
2. Stops a locally running database if it is running (so it can be deleted be AI)
3. Stops an exe process that my application created

As part of step #1 my application code must first get a connection to my database.
For some reason the code cannot find the driver class for the database connection. It resides in a jar that is part of my project.
When it is installed I can start my application, logon and everything is working fine (connecting to the database, etc)
The code used for the connection is the same class file for both the running of the application (that works wonderfully) and the three things above that run at uninstall time.

While # 1 is running the files still exist on my machine, #2 & #3 use various files from the installation and execute correctly.
From the attached uninstall log that I captured, the execution of the custom action occurs before any files are deleted by AI.

Perhaps something is incorrect in a setting for my custom action? I know that it is calling the jar specified via alerts in my code and the fact that #2 & #3 are occurring.

I have attached two files, an uninstall log and my custom action.

Any help is greatly appreciated.

Thanks
Danny
Attachments
uninstall.log
uninstall log
(281.87 KiB) Downloaded 284 times
screen shot of my custom action
screen shot of my custom action
Custom Action with EXE.gif (53.34 KiB) Viewed 5167 times
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Uninstall custom action cannot access file

Hi Danny,

Could you please try to move custom action under the Begin standard action from the InstallExecuteSequence. To show Begin phase right click Uninstall -> Show Standard Action-> Before Initialization -> Begin.
Please note that the condition of the custom action should remain the same, this way the custom action will run only when uninstalling the product.

If the problem persists could you please send us the .aip file to support at advancedinstaller dot com so we can investigate the problem.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rand
Posts: 22
Joined: Tue Sep 29, 2009 4:10 pm

Re: Uninstall custom action cannot access file

Thank you for the quick reply.

I tried the suggestion, install still seems fine, on uninstall I get a error 2732.

Attached is the log from the uninstall.

I'll send the aip file to support
Attachments
uninstall.log
(36.89 KiB) Downloaded 324 times
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Uninstall custom action cannot access file

Hi Danny,

The error you've encountered appears because the reference of the file hasn't been resolved yet. To fix the problem you can move
the custom action under the CostFinalize custom action in the IstallExecuteSequence.

Please let me know if the problem persists.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rand
Posts: 22
Joined: Tue Sep 29, 2009 4:10 pm

Re: Uninstall custom action cannot access file

Finally, I figured it out, I made an incorrect assumption.

First off, I followed your suggestion to move the custom action to CostFinalize that got rid of the error 2732, but
my code still could not find the driver file which was my original problem.

I had assumed that when calling my jar from the custom action with javaw -jar "[#App.jar_1]" -UNINSTALLACTION that the classpath from the Java Product would be used, of course, it is not, as I am calling javaw directly
so the manifest in the jar is used and the path was not correct for the class I was trying to access.

So it's good to figure it out finally on a Friday afternoon. Everything is now working flawlessly, I think I will recommend to management that we move forward and use AI.

I was very impressed with the speed of support from the AI Team, not something you see much of these days.

Thanks for the help

Return to “Common Problems”