-
Notifications
You must be signed in to change notification settings - Fork 5
msi_install_from_url.ps1
Corey Watson edited this page Dec 24, 2025
·
2 revisions
Downloads and silently installs an MSI package from a specified URL.
Downloads and silently installs an MSI package from the URL specified in $MsiScriptUrl. The file is saved to the temporary directory and cleaned up after installation completes.
Downloads and silently installs an MSI package from the URL specified in $MsiScriptUrl. The file is saved to the temporary directory and cleaned up after installation completes.
- PowerShell 5.1+
- Admin rights
- Network connectivity
Edit $MsiScriptUrl with the full URL to the MSI file.
- Uses curl for fastest, most reliable downloads with automatic redirect handling
- Fallback filename logic for URLs without valid filenames or .msi extensions
- Full decimal precision (no rounding)
- Uses PowerShell defaults for timeouts
- Validates URL and prepares temp directory path
- Downloads MSI file using curl with redirect following
- Verifies downloaded file exists and reports size
- Executes silent MSI installation via msiexec
- Cleans up temporary MSI file
- Reports installation success or failure
- Exits 0 on success (including code 3010 for reboot required), exits 1 on failure
- No secrets logged
- Downloads only from the specified URL
- Temporary files cleaned up after installation
- 0 : Success (includes msiexec exit codes 0 and 3010)
- 1 : Failure (download error or msiexec non-zero exit code)
[ DOWNLOAD AND INSTALL ]
--------------------------------------------------------------
MSI Source URL : https://example.com/installer.msi
Filename Used : installer.msi
Temporary Path : C:\Users\admin\AppData\Local\Temp\installer.msi
STARTING DOWNLOAD (CURL)...
Download Status : SUCCESS
File Size : 45.8 MB
Installation Status : STARTING SILENT INSTALL
Command Executed : msiexec /i "C:\Users\admin\AppData\Local\Temp\installer.msi" /qn /norestart
Process Exit Code : 0
[ FINAL STATUS ]
--------------------------------------------------------------
Cleanup Result : SUCCESSFUL
INSTALLATION COMPLETED SUCCESSFULLY
[ SCRIPT COMPLETED ]
- v1.5.0 (2025-10-30) - Switched to curl for fastest, most reliable downloads with automatic redirect handling and better error reporting.
- v1.4.0 (2025-10-30) - Added fallback filename logic for URLs without valid filenames or .msi extensions.
- v1.3.0 (2025-09-22) - Minimal version, removing all non-essential diagnostic placeholders and sections as requested.
- v1.2.0 (2025-09-22) - Reduced placeholders; adopted $MsiScriptUrl variable.
- v1.1.0 (2025-09-22) - Added $MsiUrl variable and logic for download/install.
- v1.0.0 (2025-09-22) - Initial release: silent MSI install wrapper.
- View Script Source
- Scripts - Back to script index