Custom Action

I have to run a fairly large vbscript code block on uninstall.I have tried using the Custom Action ->run vbscript from installed file option in wise.I have chosen the condition as REMOVE~="All" ,and I am putting the action after InstallFinalize.Is this right ? but the its not working as I want it to ?

Please, can any of you guide me on this ? Am i putting the action where it is supposed to be?

What the code does is run some commands using Shell.run and a regdelete.

I tried putting the action just before the InstallFinalize, but I dont see the action being run.I am writing to a log file to see if the commands are being run.But dont see the log file if i put the action before install finalize or after installfinalize.

Let me expand on what I am trying to do:

1.During install check to see if a registry key is there, if not, run four commands invoving two exe's within the installation .And also a regwrite .I have put this after InstallFinanize and its working fine, I can see the log being written,the registry entry is also there.I have given the condition as 'NOT Installed'.

2.During Uninstall check to see if a registry key is there, if yes, run four commands invoving two exe's within the installation,and also a regdelete .I have put this just before InstallFinanize and , I can see the log being written.But the app is still there in the add/remove programs section and no files are being removed.I have given the condition as 'REMOVE~="All"'.

I am obviously confused. :-) . Could you tell me where I am going wrong, and how can I do this using ORCA ?

Hi Flakes,
have you altered your scripts to comply with the Installer Rules? See:
http://msdn2.microsoft.com/en-gb/library/aa371538.aspx
http://msdn2.microsoft.com/en-gb/library/aa372865.aspx
Especially, you have to make sure, that you don't have "WScript.CreateObject" call in them (Instead simply use "CreateObject").
Hope this helps.
Regards, Nick

Hi Flakes,
what is your script doing exactly? We need to know that, before we could make any suggestions.
You where writing about deleting reg keys. This can be achieved with entries to the 'RemoveRegistry' table.
Hope this helps.
Regards, Nick

Hi Flakes,
yes this should be possible with built in MSI technics.
To find the registry key, use a RegLocator/AppSearch entry. This populates a public property with the reg key.
For the jobs to be done:
1. Put the regwrites in 1 component and set a condition in the components table with the property from AppSearch.
2. To call the exe's, you still need a CA, set a condition in the InstallExecuteSequence table with the Appsearch property and 'NOT Installed'