This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Return error code from failed msi to vbscript
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 19, 2014
08:42 AM
Return error code from failed msi to vbscript
I have a parent msi installer where I call a vbscript that calls a silent install of a child msi. Both msi installers are written by me...
The vbscript looks like:
call objShell.Run(strPath,0,true) where strpath = msiexec.exe /i "child.msi" /qn /norestart /L*v.
If the child msi fails at some point, it rollbacks and the parent process continues... without informing the user that something went wrong.
Is there a possibility to pass a returncode from the child msi to the calling vbscript (and from the vbscript to the calling parent msi)?
Is some property is setted when during a silent install a rollback has been initiated or something else...?
Thanks!
The vbscript looks like:
call objShell.Run(strPath,0,true) where strpath = msiexec.exe /i "child.msi" /qn /norestart /L*v
If the child msi fails at some point, it rollbacks and the parent process continues... without informing the user that something went wrong.
Is there a possibility to pass a returncode from the child msi to the calling vbscript (and from the vbscript to the calling parent msi)?
Is some property is setted when during a silent install a rollback has been initiated or something else...?
Thanks!
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Sep 19, 2014
10:52 AM
This is fully up to you, within the constraints of Windows Installer. Msiexec.exe will return a code similar to those returned from MsiInstallProduct (e.g. 0 for success, 1603 or similar for various errors), and I assume that vbscript will give you a way to access this. However if you return an error code from a custom action in the outer project, it will immediately fail the outer installation. If you're in an immediate action, you can probably set a property that can be shown on a dialog. Otherwise about all you can do is call Session.Message to inform the user (if the outer installation is being run with UI), and then return either a success or failure code, respectively allowing the outer installation to continue, or causing it to abort and likely roll back.
Windows Installer isn't all that well suited for installing multiple packages this way; it may be worth examining a bootstrap-driven approach (such as using prerequisites in your Basic MSI project or using a Suite project).
Windows Installer isn't all that well suited for installing multiple packages this way; it may be worth examining a bootstrap-driven approach (such as using prerequisites in your Basic MSI project or using a Suite project).