iruff
Posts: 5
Joined: Tue Jul 17, 2007 1:32 pm

Execution of Custom Actions

Hello all,

I have a custom action vbscript that's purpose is to update a configuration xml file I will be installing with a parameter from the UI. The challenge is (for me anyway) that this custom action is part of a merge module. The problem I have is that I am not sure when (as in which standard action) I need to add my custom action to such that the new files have been copied to the computer (my script depends on the file being in its installed location to read it and update it) but yet still have access to a GLOBAL property that defines it.

To be clear (I hope):

In my main installer, I accept via an Edit Box a value from the user, with which on the Published Event for the 'Next' button, I set the property [APP_PARM.GUID] with the value from the user. When logging, I can confirm that the value I expect is being updated.

In my merge module, in my vbscript, I confirm (for testing of course) with a MsgBox that I have the expected value from the UI for the parm, and then attempt to load the xml configuration file that should have been copied to the computer.

So, if I execute the custom action in any of the standard actions I have attempted with Immediate Execution, the file does not seem to be available.

What can I do?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Execution of Custom Actions

Hi,
The problem I have is that I am not sure when (as in which standard action) I need to add my custom action to such that the new files have been copied to the computer (my script depends on the file being in its installed location to read it and update it) but yet still have access to a GLOBAL property that defines it.
In order to run a custom action which uses installer properties after the files are installed, you can schedule it under "InstallExecuteSequence" -> "InstallFinalize". This way, it will run as Immediate (so it can access properties) at the end of the installation.

Another approach would be to schedule the custom action under "InstallExecuteSequence" -> "InstallFiles" as "Deferred". In this case, you can use the "Action Data" field in the Custom Action Properties page to pass properties to it. The values of the properties can then be retrieved in the custom action from the "CustomActionData" property. Please note that this type of custom action can only read properties, it cannot set them.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
iruff
Posts: 5
Joined: Tue Jul 17, 2007 1:32 pm

Re: Execution of Custom Actions

cosmin wrote: In order to run a custom action which uses installer properties after the files are installed, you can schedule it under "InstallExecuteSequence" -> "InstallFinalize". This way, it will run as Immediate (so it can access properties) at the end of the installation.
I could have sworn that I tried this one, but clearly not because it worked. Thanks for your help.

Return to “Common Problems”