PDA

View Full Version : Custom Action during Uninstallation (Repair, Modify)



pekrpekr
01-06-2005, 12:10 PM
Hello,
I want to create a custom action during uninstallation (After System Changes) which would be launched only when the product is being repaired or modified (not removed). Is there any recommended general way how to differentiate between these cases in IS Express?
Thank you for advice, Petr

TsungH
01-06-2005, 12:54 PM
Say, Installed AND REMOVE <> "ALL". If I am not wrong, Express IDE will automatically add a condition when the custom action is scheduled during uninstallation. You may have to play around to get it behave the way you desire.

For a complete list of properties, please refer to Property Reference (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/property_reference.asp).

pekrpekr
01-06-2005, 01:18 PM
Say, Installed AND REMOVE <> "ALL". If I am not wrong, Express IDE will automatically add a condition when the custom action is scheduled during uninstallation. You may have to play around to get it behave the way you desire.

For a complete list of properties, please refer to Property Reference (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/property_reference.asp).

But, I thought I cannot use MSI properties in custom actions in IS Express. If yes, how can I do that?

TsungH
01-06-2005, 01:29 PM
You are able to set condition on custom actions. For information, please see this (http://documentation.installshield.com/Robo/BIN/Robo.dll?tpc=/robo/projects/isxhelpx/IHelpISXCustomActionsDLL.htm).

pekrpekr
01-07-2005, 11:09 AM
Of course, I tried to use the custom action conditions before I asked my question. Using the conditions I can check up presence or absence of files, registry values, ini file entries but not a status of the MSI properties. Thanks for your response.

TsungH
01-07-2005, 12:29 PM
Doh! I just took a look at InstallShield X Express Edition Help, and it seems like Condition Builder Dialog does not work with properties directly. My apology. I should have verified it with Express Edition.

TsungH
01-07-2005, 08:20 PM
If you use a DLL custom action with New Function Signature, essentially a Windows Installer DLL, or a VBScript custom action, you will still be able to obtain and use the value of properties in your code, DLL or VBScript, by using CustomActionData property right after After System Changes (or Deferred Execute Sequence in MSI terminology). For starter, you can read up on MSI Properties and Deferred Execution (http://www.installshield.com/news/newsletter/0308-articles/CustomActionData.asp). You should also look up Obtaining Context Information for Deferred Execution Custom Actions (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/obtaining_context_information_for_deferred_execution_custom_actions.asp).

pekrpekr
01-08-2005, 07:24 PM
I want to try an analogous way with an auxiliary DLL custom action (with the New Function Signature) by means of which I can set some flag (e.g. in the registry). Then, I think, my original EXE custom actions could be handled by the standard conditions offered. Thank you for your help.