Package Stays in Installing Because the Installer Cannot Find Its Files
Problem
Section titled “Problem”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.
Solution
Section titled “Solution”-
In the package script, build full paths from
gsPackageRootfor the installer and for every file you pass as an argument. Put quotation marks around paths in arguments. -
Check
giErrorLevelafterShell_Execute, so the package fails when the installer fails.Dim sSetup, sConfigsSetup = 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 -
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.