Error 1722 with Custom Action in Hello World Project - Advanced Installer Community
Ruben
Posts: 57
Joined: Fri Apr 10, 2015 2:35 pm

Error 1722 with Custom Action in Hello World Project

Hello AI users and team,

There are some threads about Error 1722 already in this forum ("There is a problem with this Windows installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.")

We had this error and could reproduce it with a minimum setup:

1. Create a new enterprise project
2. Add a file "sayhello.bat" into Files and Folders, with unsuspicious content:

Code: Select all

echo "Hello"
3. Add a Custom Action of type Launch File. The "File To Launch" looks like:

Code: Select all

[#sayhello.bat]
4. Run AdvancedInstaller 12.0 to create an MSI file.

That setup will fail with Windows XP SP3 reproduceably, showing the Error 1722 above.
Remark: The installer works fine when sayhello.bat is added as a temporary file.


Attached are the project and the log.
Thanks for any hint how to solve that.
Ruben
Attachments
demo.log
(175.63 KiB) Downloaded 588 times
Demo.aip
(11.25 KiB) Downloaded 712 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Error 1722 with Custom Action in Hello World Project

Hi Ruben,

The installation fails because the LaunchFile custom action is of Immediately custom action. Note that the files are copied on the target machine during the deferred execution. Since the BAT file is not available to be launched, the setup fails.

Temporary Files are copied during the CostFinalize standard action, at the beginning of the setup and removed during the InstallFinalize standard action. This is why the installation does not fails when the BAT file is added as a temporary file.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ruben
Posts: 57
Joined: Fri Apr 10, 2015 2:35 pm

Re: Error 1722 with Custom Action in Hello World Project

Dan, thank you!
The installation runs well when the "Execution Time" is one of "deferred" or "commit".

Please let me describe something that's still puzzling me:
The order of the actions under "Install Execution Stage" suggested that the "LaunchFile" is run after "Add Resources" (see Arrow).
launchfile.jpg
launchfile.jpg (68.25 KiB) Viewed 7391 times
Thus my wrong expectation that when LaunchFile starts, copying the Files (Add Resources) has finished -- no matter what the "Execution Time" is.

Obviously, LaunchFile runs before AddResources, when the Execution Time is immediately. But now, what does the order under "Install Execution Stage" mean ?

Warm regards,
Ruben
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Error 1722 with Custom Action in Hello World Project

Hi Ruben,

Here, you can read more about the Setting execution time for custom actions and Windows Installer Custom Actions.

If you have any question, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Ruben
Posts: 57
Joined: Fri Apr 10, 2015 2:35 pm

Re: Error 1722 with Custom Action in Hello World Project

That's for others trying to find orientation, like me:

The first link says:
The immediately - custom action will be executed immediately upon encountering it in a action sequence.
Following the second link, I think we are talking about the "Install Execute Sequence". To be more exactly, the LaunchFile action should be found in the sequence that starts with InstallInitialize and ends with InstallFinalize:
The sequence that starts with the InstallInitialize standard action and ends with InstallFinalize will be gone through twice. The first time the installer scans all the actions contained by the Execute Sequence ...
Combining these info, I assume that the LaunchFile immediate - custom action (from the Screenhot) is executed in the first loop (1), while Add Resources happens in the second (2).
(That's my assumption of the day. Don't rely on it.)

Ruben
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Error 1722 with Custom Action in Hello World Project

Hi Ruben,

Indeed, your assumption is correct.
Since the LaunchFile is an immediate custom action, it will be executed upon encountering it in the action sequence. However, the resources are added on the target machine during the deferred phase, after the execution of the immediate custom actions.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”