Skip to main content

Install-GenericMSIApplication

Overview

Installs an MSI application on Windows, confirms it installed correctly, optionally checks version and service status, and then removes temporary files. Run this script once from your RMM or as an administrator.


Requirements

  • Windows with PowerShell 5.0 or later
  • Must be run as Administrator
  • Internet access only if:
    • You provide a web URL for -InstallerPath
    • The Strapper module needs to be installed or updated from PSGallery

What It Does

StepWhat happens
PrepareCreates a working folder under C:\ProgramData\_Automation\App\<ApplicationName>
Acquire MSIUses -InstallerPath as URL, local full path, or filename in the script folder
InstallRuns msiexec silently with /qn /norestart and writes an MSI log
ValidateConfirms install by checking uninstall registry entries for -ApplicationName
Optional ChecksIf provided, validates -ApplicationVersion and confirms -ServiceName is running
CleanupRemoves the temporary working directory

The script handles logging automatically and supports standard MSI return codes.


Basic Usage

Install using a download URL

.\Install-GenericMSIApplication.ps1 -ApplicationName 'My Custom App' -InstallerPath 'https://example.com/app.msi'

Downloads the MSI, installs it silently, confirms the app appears in uninstall entries, and cleans up.


Install using a local full path

.\Install-GenericMSIApplication.ps1 -ApplicationName 'RMM Agent' -InstallerPath 'C:\Temp\agent_installer.msi'

Copies the local MSI into the working folder and installs it silently.


Install using a filename in the script folder

.\Install-GenericMSIApplication.ps1 -ApplicationName 'My App' -InstallerPath 'MyAppInstaller.msi'

Looks for the file in the script folder and installs it.


Install with MSI properties

.\Install-GenericMSIApplication.ps1 -ApplicationName 'RMM Agent' -InstallerPath 'C:\Temp\agent_installer.msi' -AdditionalParameters 'SITETOKEN=12345'

Adds your custom MSI properties after the default silent install parameters.


Validate minimum version

.\Install-GenericMSIApplication.ps1 -ApplicationName 'My Custom App' -InstallerPath 'https://example.com/app.msi' -ApplicationVersion '1.2.0'

Fails if the installed version is below 1.2.0.


Validate a service is running

.\Install-GenericMSIApplication.ps1 -ApplicationName 'My Service App' -InstallerPath 'https://example.com/svc.msi' -ServiceName 'MySvcApp'

Fails if the service is missing or not in the Running state.


Parameters

ParameterRequiredDefaultDescription
-ApplicationNameYes-App display name to match in uninstall entries for validation
-InstallerPathYes-MSI source as a URL, full local path, or filename in the script folder
-ApplicationVersionNo-Minimum version expected after install
-AdditionalParametersNo-Extra MSI properties or arguments added to the install command
-ServiceNameNo-Service to verify exists and is running after installation
-WhatIfNoOffShows what would happen without running the installation

Preview Changes Without Making Them

Append -WhatIf to preview actions without installing:

.\Install-GenericMSIApplication.ps1 -ApplicationName 'My Custom App' -InstallerPath 'https://example.com/app.msi' -WhatIf

Log Files

The script writes two log files in the same folder it runs from:

Install-GenericMSIApplication-log.txt ← General activity and results
Install-GenericMSIApplication-error.txt ← Errors only

An MSI verbose log is also written under ProgramData in the script working folder, for example:

C:\ProgramData\_Automation\App\My_Custom_App\My_Custom_App_install.log

Common Scenarios

Installer is in the same script folder - pass only the filename:

.\Install-GenericMSIApplication.ps1 -ApplicationName 'Line of Business App' -InstallerPath 'LOBApp.msi'

Need to pass tenant/site/license properties - use -AdditionalParameters:

.\Install-GenericMSIApplication.ps1 -ApplicationName 'Agent App' -InstallerPath 'C:\Temp\agent.msi' -AdditionalParameters 'SITETOKEN=12345 TENANTID=abcd'

Install succeeds but app not found in validation - verify -ApplicationName matches the installed display name in Programs and Features.

Need service-level validation - provide -ServiceName to enforce post-install service health:

.\Install-GenericMSIApplication.ps1 -ApplicationName 'My Service App' -InstallerPath 'https://example.com/svc.msi' -ServiceName 'MySvcApp'

Changelog

2026-06-05

  • Initial version of the document