a_j_burgess
Posts: 15
Joined: Tue Oct 18, 2005 12:24 pm

Deferred Custom Actions are not deferred in version 3.3

Hi,

I built an installer that used deferred custom actions some time ago using version AI 2.2. I am now trying to upgrade to the latest version (3.3). However, the deferred actions do not seem to work in the same way.

I want to run a "File installed with the product" type of action after all of the files and folders have been installed and check the result of the action.

What previously worked in 2.2 was to set it as follows:
Execution properties: Asychronous, wait for return code
Execution options: Deferred
Scheduling options: Always execute.

I have attached the (slightly truncated) log file below to show you the issue. But, at the point of failure, I check the place where the files are supposed to have been copied to on the file system and they are not there yet.

If anyone can help or suggest other settings to try, it would be most appreciated.

Regards,

Anthony

=== Logging started: 3/18/2005 12:51:01 ===
Action start 12:51:01: INSTALL.
Action start 12:51:01: LaunchConditions.
Action ended 12:51:01: LaunchConditions. Return value 1.
Action start 12:51:01: FindRelatedProducts.
Action ended 12:51:01: FindRelatedProducts. Return value 1.
...
Action start 12:51:01: InstallScriptProperty. <-- THIS IS MINE TO PASS [TARGETDIR] to InstallScript
Action ended 12:51:01: InstallScriptProperty. Return value 1.
...
Action start 12:51:05: DeleteServices.
Action ended 12:51:05: DeleteServices. Return value 1.
Action start 12:51:05: UnregisterComPlus.
Action ended 12:51:05: UnregisterComPlus. Return value 0.
...
Action start 12:51:05: InstallFiles.
Action ended 12:51:07: InstallFiles. Return value 1.
...
Action start 12:51:07: PublishProduct.
Action ended 12:51:07: PublishProduct. Return value 1.
Action start 12:51:07: InstallScript. <--THIS IS THE CUSTOM ACTION
Action ended 12:51:07: InstallScript. Return value 1.
Action start 12:51:07: InstallFinalize.
1: RunInstallScript received targetDir: C:\myapp\
Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action InstallScript script error -2146828212, : Line 111, Column 2,
MSI (s) (94:B8): Product: ADC -- Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action InstallScript script err
or -2146828212, Microsoft VBScript runtime error: Path not found Line 111, Column 2,

Action ended 12:55:25: InstallFinalize. Return value 3.
Action ended 12:56:53: INSTALL. Return value 3.
=== Logging stopped: 3/18/2005 12:56:53 ===
MSI (s) (94:B8): Product: ADC -- Installation failed.

=== Logging started: 3/18/2005 13:12:49 ===
Action start 13:12:50: INSTALL.
Action start 13:12:50: LaunchConditions.
Action ended 13:12:50: LaunchConditions. Return value 1.
Action start 13:12:50: FindRelatedProducts.
Action ended 13:12:50: FindRelatedProducts. Return value 1.
Action start 13:12:50: AppSearch
a_j_burgess
Posts: 15
Joined: Tue Oct 18, 2005 12:24 pm

Update..test install

Hi,

I created a small test installer to narrow down the problem. The test file does (/ is supposed to do) the following:
Install two files - 1 is a .txt, 1 is a .vbs that attempts to read the .txt
Added custom action "InstallScriptProperty" to pass the install directory:
  • After standard action: FileCost
    Type: Property set with formatted
    PropertyName: InstallScript
    Formatted Text: [TARGETDIR]
    Exe props: Synchronous, check return code
    Exe options: Immediate
Added custom action "InstallScript" to run the .vbs
  • After standard action: PublishProduct
    Type: File installed with product
    Source path: <installed file path>
    Source type: .vbs
    Function name: RunInstallScripts
    Exe props: Asych, wait for return
    Exe options: Deferred
When I run this I get the output given at the end of this post(note line 8 in the log error refers to a call to .OpenTextFile). At the point at which the error occurs, no files have been installed. Is this something that I am doing wrong or is this a bug in the latest installer?

Regards,

Anthony

---LOG---
Action ended 10:26:48: PublishProduct. Return value 1.
Action start 10:26:48: InstallerScript.vbs.
Action ended 10:26:48: InstallerScript.vbs. Return value 1.
Action start 10:26:48: InstallFinalize.
1: RunInstallScript received targetDir:
1: InputFile = templates\server.txt
Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action InstallerScript.vbs script error -2146828212, : Line 8, Column 2,
MSI (s) (C0:6C): Product: Test -- Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action InstallerScript.vbs scr
ipt error -2146828212, Microsoft VBScript runtime error: Path not found Line 78, Column 2,

Action ended 10:26:50: InstallFinalize. Return value 3.
Action ended 10:26:50: INSTALL. Return value 3.
=== Logging stopped: 3/19/2005 10:26:50 ===
MSI (s) (C0:6C): Product: Test -- Installation failed.
---LOG END---
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

There could be two possible things that might go wrong:

The first CA should be placed after the "Install Validate" standard action. This is because the value of some properties might not be resolved until this point.

The second CA being deffered, should receive it's "parameter" from the CustomActionData property. Anyway, you could have a debug version of the script that displays the value of the filename, before attempting to open it.

Hope this helps. If you have further problems you could send the test AIP and the script file to support at advancedinstaller dot com

Regards,
Mihai
Last edited by Mike on Tue Oct 25, 2005 8:13 am, edited 1 time in total.
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
a_j_burgess
Posts: 15
Joined: Tue Oct 18, 2005 12:24 pm

reply to Mihai

Mihai.

Thanks for your post. Both of your possible faults refer to the value of TARGETDIR not being passed to the .vbs script. I don't think that this is the problem as I have been able to output the value of TARGETDIR within the .vbs:

Action start 14:05:17: InstallFinalize.
1: RunInstallScript received targetDir: C:\Your Company\Test


I will send the file to support and report back to this post once the issue has been resolved.

Regards,

Anthony

Return to “Common Problems”