Skip to content

Package Stays in Installing Because the Installer Cannot Find Its Files

A package stays in Installing and never finishes. The installer, for example setup.exe, keeps running on the computer. The same command works when you run it yourself from an elevated command prompt.

If you end the installer process, the package can show Installed, although nothing was installed.

For example, a package installs Microsoft Office with the Office Deployment Tool:

If bStatus Then bStatus = Shell_Execute("setup.exe", "/configure configuration-Office2021Enterprise.xml", True, 0, False)

The script refers to files in the package’s kit folder with a relative path. When the CapaInstaller agent runs a package, the working directory isn’t the kit folder, so the installer can’t find the file. The installer shows an error dialog, but the package runs as SYSTEM, so the dialog isn’t visible. The installer waits for an answer that never comes.

The package shows Installed after you end the installer because the script doesn’t check the installer’s exit code.

  1. In the package script, build full paths from gsPackageRoot for the installer and for every file you pass as an argument. Put quotation marks around paths in arguments.

  2. Check giErrorLevel after Shell_Execute, so the package fails when the installer fails.

    Dim sSetup, sConfig
    sSetup = gsPackageRoot & "\kit\setup.exe"
    sConfig = gsPackageRoot & "\kit\configuration-Office2021Enterprise.xml"
    If bStatus Then bStatus = Shell_Execute(sSetup, "/configure """ & sConfig & """", True, 0, True)
    If bStatus And giErrorLevel <> 0 Then bStatus = False
  3. Save the package, and set its status to Waiting on the computers.

The package runs to the end, and its status shows whether the installation succeeded.