So I just got out from a meeting with our developer.
Here are the conclusions I've reached after discussing with him + the notes from the issue I've created in our bug tracking tool.
Basically, there are 4 possible cases here:
- If the custom action is run from under the SystemAccount (NO UI) -> NON DETERMINISTIC
- If the custom action is run from under the LocalAccount (NO UI) -> NON DETERMINISTIC
- If the custom action runs on the Execute Sequence as Immediately -> NON DETERMINISTIC
- If the custom action runs on UI Sequence (Finish Dialog Stage) -> FOREGROUND
Under the "Remarks" section we can see what the conditions are for the above:
I will attach below two screenshots, as it follows:The process is the foreground process.
The process was started by the foreground process.
The process received the last input event.
There is no foreground process.
The foreground process is being debugged.
The foreground is not locked (see LockSetForegroundWindow).
The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo).
No menus are active.
- when the CA is executed under the "InstallExecuteSequence" --> the CA is run from under the msiexec server process and it is launched in the background
- when the CA is executed under the "Finish Dialogs Stage" --> the CA is run from under the msiexec process that was launched by our bootstrapper and the executable is launched in the foreground
With that being said, a possible solution to this would be moving the Custom Action under the "Finish Dialogs Stage".
This way, I believe all the boxes will be ticked for you, including this one:
I have run the setup you have provided myself, around 30 times and everytime the executable was launched in the foreground.I don't want the actions to be performed after the "Finish" button has been clicked, since they might take some time and if they don't succeed my application won't work as expected. This is why, I want them to be performed "during" the setup, after having copied the files, before showing the finish page.
Hope this will help!