cancel
Showing results forย 
Showย ย onlyย  | Search instead forย 
Did you mean:ย 
sammathew
Level 4

OnUninstall (Install Script) Event not called

Hi All,

I am using InstallShield 2008 .OnUninstall event in the script is not get called when the product is uninstalled.

Can anyone help me how to fix this problem and all let me know whats the reason behind this.

My advance Thanks !

Thank You.
Labels (1)
0 Kudos
(10) Replies
Holger_G
Level 10

What type of project do you use?
1) pure InstallScript
or
2) InstallScript MSI
0 Kudos
sammathew
Level 4

Hi Nick Rivers,

I appreciate you'r replie ,thanks a lot.

I am using pure InstallScript project. I went through InstallShield Help Library,which says

--------------------------------------------------------------------------
OnUninstall
InstallShield 2008 ยป InstallScript Language Reference

For InstallScript installations, the OnUninstall event is called when the installation is run with the -uninst parameter. This is the only event that is called when the -uninst parameter is used. The default code for the OnUninstall event uninstalls a previously installed product

--------------------------------------------------------------------------

I allso tried using that but still ,i am not able to fix the problem.The Acutal problem is when i try to uninstall the product through Start Menu ,the OnUninstall event should be called but thats not happening.

My code:

szCommand = UNINSTALL_STRING + "-uninst";

AddFolderIcon( szPgmFolder_Path ^ svFolder , "Uninstall " + @PRODUCT_NAME + " for ResumeGrabber Pro" , szCommand , TARGETDIR , TARGETDIR^"Uninst.ico", 0, "", REPLACE );

Wating for you'r replie Nike.

My advance Thanks .
0 Kudos
Not applicable

Is there a space at the end of UNINSTALL_STRING? I'm really not sure for InstallScript, but you might try something like UNINSTALL_STRING + " -uninst" instead as a thought.
0 Kudos
MarkEarle
Level 6

bryanwolf is correct. There is no space in UNINSTALL_STRING as of IS 7.0.

Cheers,

ME
0 Kudos
sammathew
Level 4

Hi bryanwolf & MarkEarle,

Thanks a lot guys.It's working good.Can You allso help me for a other problem which i am facing.

The problem is when i try to uninstall the product from the control panel its calling OnMaintUIBefore but it should call OnUnistall.

It would be nice if you could help me in this.

My advance Thanks !
0 Kudos
areatza
Level 3

Hello Sammathew

In InstallShield 2008 the function OnUninstall does not work, you must use OnMaintUIBefore and OnMaintUIAfter.
0 Kudos
Holger_G
Level 10

sammathew wrote:
Hi bryanwolf & MarkEarle,

Thanks a lot guys.It's working good.Can You allso help me for a other problem which i am facing.

The problem is when i try to uninstall the product from the control panel its calling OnMaintUIBefore but it should call OnUnistall.

It would be nice if you could help me in this.

My advance Thanks !


Thatยดs correct. OnMaintUIBefore will be called by default. If you want to prompt for uninstall directly you could do this for example:
Add a custom command line paramater to UNINSTALL_STRING at the end of 'OnFirstUIBefore' and evaluate the commandline parameter at the beginning of 'OnMaintUIBefore' like this:
if (CMDLINE % "-uninstall") then
'put your code for uninstall here'
else
'default OnMaintUIBefore code'
endif;
0 Kudos
sammathew
Level 4

Hi Nick Rivers,

I tried the code that you have mentioned .

--------------------------------------------------------------------------
if (CMDLINE % "-uninstall") then
'put your code for uninstall here'
else
'default OnMaintUIBefore code'
endif;
--------------------------------------------------------------------------

But when i debbuged the script it does'nt check the if condition.Is there any thing that i need to include in the script.If so, its my request kindly help me please.

Is there any way to find that the user is trying to uninstall the product through the control panel.If so , please let me know.

My advance Thanks!
0 Kudos
brianthegood
Level 6

I've always used

if(ADDREMOVE) then

as the first line of OnMaintBefore

This was my way of preventing an uninstall experience if someone relaunched the setup. In other words users could only uninstall if they went to the Add/Remove of the control panel.

Good luck.
0 Kudos
VivekGupta
Level 2

I am using IS12. If you go General Information -> Product Properties and set "Enable Maintenance" = No then it calls OnUninstallEvent. If Value is set to YES then it calls OnMaintUIBefore event.
0 Kudos