Skip to content

MSI_GetPackageStatus

Returns the Windows Installer status of the product in the specified MSI package file. The function reads the product code from the file and then gets the status of that product, as MSI_GetPackageStatusByGuid does.

MSI_GetPackageStatus(sMSIFile) As Boolean

Path and filename of the MSI-package

Result will be stored in gsValue. MSI Status:

gsValue Meaning
The package is installed. The product is installed for this computer or user.
The package is not installed. The product isn’t known on this computer.
The package is advertised, but not installed. The product is advertised only.
The package is absent. The product is installed for another user.
Invalid argument. The product code isn’t valid.
Bad configuration. The Windows Installer configuration data for the product is corrupt.

To check whether a package is installed, compare gsValue with The package is installed., or use MSI_IsPackageInstalled.

If bStatus Then bStatus = MSI_GetPackageStatus("C:\CapaInstaller.msi")
If bStatus Then bStatus = Job_WriteLog("Custom", "gsValue: " & gsValue, bStatus, True)

Scripting Guidelines

MSI_InstallPackage MSI_UnInstallByFile MSI_IsPackageInstalled Constants Package Property Variables