Client Management Suite

 View Only

Using Deferred Custom Actions in Wise Package Studio 

Aug 16, 2007 12:06 PM

We use deferred custom actions to perform actions and manipulate system files. Here's an example where I learned something new about these actions and Installshield \ VB Script.

One of my applications needs to append a value to the Autoexec.bat file, and we use VBScript to do this work. I wrote a custom action to append a value in the .bat file. Since the file is present in "c:\" I used "WindowsVolume" but it was not recognized in the deferred custom action. This is because deferred custom actions doesn't recognize installer properties like SourceDir or WindowsVolume.

To solve this issue, here are the steps we took. This is not an issue if you use WiseScript. But not all projects use WiseScripts.

  1. Create a custom action which has embedded VB code in it that appends the value to the .bat file. Let the custom action name be "APPBAT" and set the custom action as deferred system context and leave the sequence blank -- to be modified later
  2. Create another custom action "Set Property Custom Action". Set the property name to "APPBAT" and the value to "[WindowsVolume]". Place it before Installfinalise.
  3. Now place the VB code custom Action "APPBAT" after the Set Property custom action.
  4. Now your deferred custom action will work and append the expected value to the necessary files.

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Sep 17, 2007 11:26 AM

Yes it do not give you direct result, You need to use CustomActionData with Session Property in Deffered Execution. Stored it into Variable and get the output. And its all done in only one VBScript. This is more simple solution what I think.

Sep 17, 2007 09:33 AM

I guess session.property cannot call the MSI property or directory values into the CA while running an action in deffered context.

Sep 17, 2007 08:52 AM

Why can't we use session.property ? I guess it is simplest solution.

Related Entries and Links

No Related Resource entered.