Oliver Paals
Posts: 7
Joined: Fri Apr 24, 2020 10:05 am
Location: Germany

Know when post-install setup finishes

Hi everyone,

I'm trying to install some setup.exe files capsuled in an installer which has .msi format.
To achieve this, I put the existing .exe setups as post-install prerequisites into my AIP file.

My problem is now, that the post-install setups run asynchonously and I do not know when the last setup finishes. The main setup is completed while the post-install setups are still running.
After my complete setup is finished there are other setups to be run and these have not to be started before the last post-install setup finishes.

I tried the following to know when the last post-install setup finishes:
[*] In Files and Folder section I created a dummy file in Common Application data
[*] In Prerequisites section I added an .msi setup as the last post-install msi to be executed, which deletes this file again. So I know that as long as the dummy file exists the setup is running.
[*] Now I built a new AIP file calling the whole setup as chained package and containing a Custom Action of type Attached Native Dll containig a C# FileSystemWatcher object watching for the deletion of the dummy file. The Custom Action runs after Finish Execution.

Unfortunately this does not work. The .msi file of my setup is copied to %TEMP% folder but is not executed. The Custom Action is executed but surely can't find the deletion of the dummy file because it is never installed cause the installation does not start.

My questions:
[*]Can this approach work at all?
[*]How are Chained Packages and Custom Actions scheduled?
[*]Is there a better way to know when setup finishes?

Thanks in advance
Oliver
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: Know when post-install setup finishes

Hello Oliver,

Your train of though here is really good, indeed.

However, as you mentioned, it might not quite work.

So, first of all, let's discuss why the two setups do not actually run synched - that's because they can not, due to a limitation that does not allow two setups running at the same time.

This is the reason why the setup is ran async and the action that launches the prerequisites happens right after InstallExecute action ends.
Screenshot_90.png
Screenshot_90.png (8.62 KiB) Viewed 16455 times
Note: you can see the above in the "Table Editor" --> "InstallExecutionStage" table (available starting in Enterprise suite).
After my complete setup is finished there are other setups to be run and these have not to be started before the last post-install setup finishes.
This could simply be achieved by adding all setups in the "Prerequisites" page. The setups are installed in order and therefore you know for sure one will not start before the one preceding it is finished.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”