SNOOPY33
Posts: 8
Joined: Mon Jan 09, 2006 2:39 pm

Where to place Custom Action

Hi,

We've just licensed your product and I've already got some questions.

I'm trying to call a custom action every time after the target directory is specified by the user, and, regardless, if it a fresh install, an install of a new version or if the product is removed.

I placed a "Attached custom action" into the section:
--> InstallExecuteSequence
-------> InstallInitialize
----------> <my Custom Action>

However, using this approach does not call the custom action on a fresh install.

My questions are:
- Why doesn't it work this way?
- Where do I have to place my custom action and why
- For me, it's not clear. in which sequence Windows Installer goes throught the installation process. I contacted the Windows Installer documentation and now my ??? are even bigger. Do you know any simple description, where all this stuff (Standard Actions etc) is described in a "newbie understandable" way :-)

Thank you very much for your help

Michael
SNOOPY33
Posts: 8
Joined: Mon Jan 09, 2006 2:39 pm

Hi,

Huuu, how much time I wasted... :-(

Just found the solution for myself. It must be a bug of AI:

The custom actions where moved via drag & drop from another sequence location to the location mentioned above. Testing around, I inserted "Script Inline Actions", that just display a message box, before and after my "Attached Actions". It worked. So, i removed my "Attached Actions" and re-created them at te same place: Bingo: Now it works!

Any comments?

Michael
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,
Why doesn't it work this way?
Maybe you set an Execution Condition for the Custom Action and it evaluates to false.
Where do I have to place my custom action and why
It depends on what your Custom Action is supposed to do. Please give me more details about its type (EXE, DLL, script), its Execution Properties, Execution Condition etc.
For me, it's not clear. in which sequence Windows Installer goes throught the installation process.
The "InstallUISequence" is executed first (unless a silent install is performed). In this sequence you can use only immediate Custom Actions. The "ExecuteAction" Standard Action (from "InstallUISequence") launches the "InstallExecuteSequence" as a sub procedure. After all the Actions (Standard or Custom) from the "InstallExecuteSequence" have completed, the installer returns to the "InstallUISequence" and displays the "Installation Complete" dialog.

The part of the "InstallExecuteSquence" between "InstallInitialize" and "InstallFinalize" is processed in 2 phases. First the installer goes through the Actions (Standard and Custom) and notes them down in an installation script. Then it goes through the script and actually executes the commands. This second phase is where the target computer is modified, i.e. files are copied, registry entries are written, etc.

While the installer builds the script, only Immediate Execution Custom Actions are actually executed. All other actions (Standard Actions like "InstallFiles" and Deferred Execution Custom Actions) are only noted in the script.

When the script is built ("InstallFinalize" is reached) the installer starts to execute the script. During this phase the Deferred Execution Custom Actions are executed in the order they have been written to the script and only if their condition was true at the time the script was built.

This is just a short overview of the installation process.
Do you know any simple description, where all this stuff (Standard Actions etc) is described in a "newbie understandable" way
I am afraid I do not, but I will let you know if I find something.

Regarding your second post, I do not believe there is a bug. Most likely, your Custom Action needs to have a certain Scheduling Option and this setting has changed when you have dragged the item in the tree control.

Hope this helps.

Regards,
Denis
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”