Jump to content
Excelsior Forums
Sign in to follow this  

Custom Uninstall

Recommended Posts

Hello there,

I am making an installer which installs a java program normally and as a windows service.

Everything works fine except for the fact that during the uninstall process I need to have the service uninstalled first and the java program later. How do I do that? There is an uninstall script for the service but I do not know how to invoke it from the Uninstaller.

I have also read something about writing an uninstallation callback dll but I do not know how to do that. Is there some sample code for that? How do I name the dll? Do I place it in the HOME folder of my installation?


Share this post

Link to post
Share on other sites

I am also interested in this topic.

Instead of us writing custom DLLs, why not provide a generic DLL that calls a shell script or two or just the ability to run a few shell scripts before the uninstall proceeds?


Share this post

Link to post
Share on other sites

In the version 1.8 the uninstall Callback DLL is a single way to add extra functionality to the uninstallation process. Your own callback DLL will be invoked once just before uninstallation is started, so it can perform custom uninstallation actions.

A uninstall callback DLL must be added to the package files and may have any name. There is no restriction to the place inside package where a uninstall сallback DLL is located.

The uninstall callback DLL should export the function:

int __stdcall PreUninstall (void)

Return value of the functions is a return code. If they return a non-zero value, the uninstallation process will be terminated and a dialog displaying the respective message and the return code, will appear.

Note: when building the DLL, enable the static linking mode so that they do not depend on any other DLLs except those implementing the system API.

Excelsior Delivery includes a sample named "InstallCustomization". This sample shows how to use installation and uninstallation callback DLLs.

It is a good idea to support pre-uninstall actions like the post-install actions, say, "Run always". In one of the next versions we will do it. 

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this