InstallExecuteSequence->InstallFinalize Behavior - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

invalidptr
Posts: 79
Joined: Thu Nov 18, 2010 7:10 pm

InstallExecuteSequence->InstallFinalize Behavior

I have some VBscripts I want to execute after the files have been laid down but before setup completes so I placed them under InstallExecuteSequence->InstallFinalize. Tonight after the install was complete I opened setup.exe again and selected the remove option and noticed my VBscripts placed under InstallFinalize were executing again. This surprised me. Two questions:

1. Why am I seeing this behavior?
2. Is there a tutorial that goes into depth on the "Standard Actions"? Esp. the cascading options under "Before Initialization'', "Before File Installation", and "Before Finalization"

Thanks!
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: InstallExecuteSequence->InstallFinalize Behavior

Hello,
Why am I seeing this behavior?
This is happening because the InstallFinalize standard action executes both on install and uninstall. In order to execute your VBScript custom actions only on install you will need to set them with the following execution condition:

Code: Select all

NOT Installed
Is there a tutorial that goes into depth on the "Standard Actions"? Esp. the cascading options under "Before Initialization'', "Before File Installation", and "Before Finalization"
Here is an article from our user guide that has a brief description on each standard action.
If you want to understand standard actions in more depth, here is the MSDN article to get you started.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
invalidptr
Posts: 79
Joined: Thu Nov 18, 2010 7:10 pm

Re: InstallExecuteSequence->InstallFinalize Behavior

This is happening because the InstallFinalize standard action executes both on install and uninstall.
OK, I didn't get that at all from the brief description of the standard action.

Is it correct to say InstallUISequence executes and then InstallExecuteSequence executes? Microsoft says you can change the order of actions and AI exposes this via "Right-mouse-Move After". I'm surprised by the amount of overlap between UI Sequence and Exe Sequence. The items in the Show Standard Action menu are the default order in which AI executes them (unless you tweak with Move After).

I'm having trouble with StartServices in InstallExecuteSequence. Does my Immediate execution Attached Custom Action execute before or after StartServices? Imperically it would appear before (and I presume is true for all other Standard Actions). I posted a MsgBox to halt execution so I could poke around. None of the files had been laid yet - not even the service. I'm surprised because StartServices happens after InstallFiles. I need to make file modifications before the service starts (XML and changes to an .MDB). This puts me in a catch-22: the service starts before I can make the changes; I can only change the files after the service starts.

I did a little experiment to see when the files actually get installed. For each Standard Action I created a ScriptInline which threw a MsgBox with the Standard Action name. In the screen shot I've appended a number to ScriptInline which indicates the order in which they appeared. The files got installed between MsiPublishAssemblies and Install. What? They didn't get installed at InstallFiles. I'm not sure how my InstallServices works since that executes before the files get laid down. Why are they executing out of order (assuming they execute top-down)? What is the different colored Standard Action icons communicating?
Screen shot 2010-12-14 at 11.43.53 PM.png
Screen shot 2010-12-14 at 11.43.53 PM.png (14.08 KiB) Viewed 9493 times
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: InstallExecuteSequence->InstallFinalize Behavior

Hello,
Is it correct to say InstallUISequence executes and then InstallExecuteSequence executes?
Actually the correct order is described in the picture from this article. All the "Before File Installation" and "Before Finalization" standard actions execute twice(first and second phase) and at the end of the second phase("Execute installation script") the install returns to "ExecuteAction".
Does my Immediate execution Attached Custom Action execute before or after StartServices?
If your custom actions are set with "Immediate execution" they will be executed in the "Create installation script" phase when no modifcations are made to the machine. You should set them to "Deferred, with no impersonation" if you wish to execute them after the files are installed.
None of the files had been laid yet - not even the service. I'm surprised because StartServices happens after InstallFiles.
As I answered on your previous question, the files are not present because your custom actions are set to an "Immediate execution". As described in the above article, "Immediate execution" actions execute in the "Create installation script" phase and "Deferred" execute in the "Execute installation script" phase.
The files got installed between MsiPublishAssemblies and Install. What? They didn't get installed at InstallFiles. I'm not sure how my InstallServices works since that executes before the files get laid down. Why are they executing out of order (assuming they execute top-down)?
The files are not created during the "Create installation script" phase, they are created in the second phase when the script executes.
What is the different colored Standard Action icons communicating?
The difference is that the blue arrow standard actions do not end up in MSI. They are just an UI reference for the user when adding custom actions.
These are opposed to the lime arrow standard actions, which do have an action that can be traced in the built MSI.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
invalidptr
Posts: 79
Joined: Thu Nov 18, 2010 7:10 pm

Re: InstallExecuteSequence->InstallFinalize Behavior

Thanks Mihai. This is starting to make more sense. I've more fully realized your working on top of a Microsoft technology that you don't control. And are stuck with what they've done to an extent.

So if I have a “Deferred” “Attached Custom Action” hanging off of “StartServices”, does my action happen before or after the service starts? My testing says after.
The difference is that the blue arrow standard actions do not end up in MSI. They are just an UI reference for the user when adding custom actions.
Could you restate this or expound on it a little more?

Thanks
Mark
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: InstallExecuteSequence->InstallFinalize Behavior

Hello Mark,
So if I have a “Deferred” “Attached Custom Action” hanging off of “StartServices”, does my action happen before or after the service starts? My testing says after.
If by hanging off you mean right click on “StartServices” and add your "Deferred" "Attached Custom Action" there, then yes it is intended to execute after.
If you would have placed it per say after "MsiConfigureServices", it would execute before.
Could you restate this or expound on it a little more?
The MSI is a database which contains information required to install your application on the local machine stored in tables just like a normal database.
You can see and edit its information using the Orca application. You can also check the modifications in the "Table Editor" page.
In your case please notice that none of the standard actions mentioned in the "Action Text" table have a blue arrow in the "Custom Actions" page.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”