# Package Stays in Installing Because the Installer Cannot Find Its Files

> Fix a VBScript package that stays in Installing, or shows Installed although nothing was installed, because the installer uses a relative path to a file in the kit folder.

Source: https://docs.capaone.com/capainstaller/troubleshooting/package-stays-in-installing-because-the-installer-cannot-find-its-files/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

## 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:

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

## Cause

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

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.

   ```vb
   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.

## Related

- [Shell_Execute](/capainstaller/vb-scripting-library/shell-function/shell-execute/)
- [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
- [PowerPack Stuck in Installing After a VBScript Package](/capainstaller/troubleshooting/powerpack-stuck-in-installing-after-a-vbscript-package/)
