Today, I got a task to deliver a msp file (Windows Installer Patch) to the user machine. To install *.msp files, we usually have to issue following command line:
msiexec /p “<msp file name with path>” REINSTALLMODE=oums REINSTALL=ALL /qr
For more details, see this article
And it seems odd to ask user to issue that log, horrible command line. So either, either I have to provide my user with a .bat/.cmd file containing above command line, or a self extractive archive containing the Patch and its command line.
The best convenient method I found for my user is some self extractive archive and I quickly choose NSIS ((Nullsoft Scriptable Install System).
Plan was simple:
- Deliver *.msp file to a Temp folder
- Launch Patch installation with above command line and log the installation
- NSIS installer should not show the details of installation.
- Remove *.msp File but leave the Log file thereat the End of Patch installation
- Auto-Close the NSIS Window.
So making long story short, here is that NSIS script.
- !define PRODUCT_NAME "Patch for build 225"
- !define PRODUCT_VERSION "8.11.9.357"
- !define PRODUCT_PUBLISHER "My Company, Inc."
- !define PRODUCT_WEB_SITE "http://www.google.com"
- Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
- OutFile "Patch for build 225.exe"
- InstallDir "$TEMP"
- Icon "Bentley.ico"
- SilentInstall normal
- ;//This will make installer not to show the details
- ShowInstDetails nevershow
- Section "MainSection" SEC01
- ;//This will close the NSIS Installer Window at end.
- SetAutoClose true
- SetOutPath "$TEMP\PATCH_225_357"
- SetOverwrite ifnewer
- File "PATCH_225_357.msp"
- SectionEnd
- Section -Post
- ExecWait '"msiexec.exe" /p "$TEMP\PATCH_225_357\PATCH_225_357.msp" REINSTALLMODE=oums REINSTALL=ALL /qr /l*v "$TEMP\PATCH_225_357\PATCH_225_357.log"'
- Delete /REBOOTOK "$TEMP\PATCH_225_357\PATCH_225_357.msp"
- SectionEnd
No comments:
Post a Comment