View Full Version : Multiple Costom Actions

Johnny Thunder
10-30-2013, 06:25 AM
I have been attempting to get my script to execute different functions at different times during to install/uninstall process. My question is how do I do this. My goal is to run function1, download the installer files, run function2, then on uninstall run function3. I tried creating the setup.rul with exported prototypes for function1 and function2. I also tried having 3 .rul files, setup.rul, function1.rul and function2.rul where setup.rul includes function1.rul and function2.rul. Also, on top of this can someone show me how to include function3 during and uninstall or point me in the right direction? I really appreciate the help.

10-30-2013, 06:35 AM
Under 'Custom Actions and Sequences
Take a look at adding conditions
so that they only run for the desired conditions.

Johnny Thunder
10-30-2013, 06:50 AM
Thanks for the quick reply, but my first problem is that I can't even get 2 CAs to work together. What I want is to run CA1 after event1 and then CA2 after event2. I haven't gotten that to work yet. and then After that I can add CA3 on REMOVE="ALL"

10-30-2013, 08:14 AM
What kind of CA?
What are you using for 'Return Processing' choice?
What are you using for 'In-Script Execution'?
Are you passing any Properties to CA?
In which 'Sequence' are you executing?
Can you run either one of the CAs individually?
You should not need multiple .rul files. I use 2 (1 is for common CAs that I use in multiple packages) and 1 is specific to the package.

Johnny Thunder
10-30-2013, 09:39 AM
As for what kind of CA, I am not sure how to answer that. I am very new to installsheild. I only used to rule files because I though it would help. It seems that if I use to different entry points on the same setup.rul that installer ends abruptly, but it works fine with one entry point. I am Using a Basic MSI Project with Return Processing = Synchronous (Check Exit Code), In-Script Execution = Immediate Execution, Execution Scheduling = Always Execute. Under Sequence -> Install Exec Sequence = After InstallFinalize. I would like method1 to run After costFinalize and method 3 to run on removal.

10-30-2013, 07:52 PM
If you right click on 'Custom Actions' it brings up the Custom Action Wizard and you can see all the various types of CAs. Presumably you are working with an InstallScript CA. I don't know what you mean by "multiple entry points in a .rul file. You can have scripts for many custom actions in a .rul file. Can you post your .rul file? You are going to have to schedule your CAs prior to InstallFinalize.

Johnny Thunder
10-31-2013, 06:52 AM
Thanks for your help, but I just forgot the HWND and hMSI parameters in the prototype and function definition. It all works well now. And I want my script to execute after all the files are placed on the target computer which is why for method2 I selected After InstallFinalize, is there a better way to do that? By entry point function I meant the function that the CA tries to call, I read the name somewhere.

10-31-2013, 07:25 AM
Click on HELP and search for Custom Actions or go to
and scroll to the bottom to read all about it.