Ho To get exit code from VBS custom action and abort MSI installation if does not meet requirement
I have problem statement in which I have to check that if MS office excel is running then give three prompt messages to users to close it and if still excel is running then I have to abort the installation and give failure message.
Please advise
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
itolutions
7 years ago
If you use AdminStudio:
1) In AdminStudio create VB custom action. Select function you want to use from VBScript body. 2) In AdminStudio set "check exit code" parameter for custom action you created.
3) Return non zero exit code in your VBScript function in the case if you see unessasary applications are runing.
In this case MSI will fail if your custom action returns non zero exit code. And don't forget to set correct sequence for CA.
Comments:
-
You can do the same in any MSI editor (not only AdminStudio), but it will be more comlicated to look at requred parameters in MSDN - itolutions 7 years ago
Posted by:
rileyz
7 years ago
Putting on my clairvoyance hat, here goes!
Assumptions:
- Enterprise environment.
- No reboots
- No pop ups
You have mentioned that you would like pop ups to notify the user, but Im still going to presume a enterprise environment. If this is the case then you should consider using PS App Deployment Toolkit, it does a nice job and popping up and deferring, it also integrates well with SCCM. This would also save you the returning a failure in the MSI thus causing SCCM and your reports some grief.
Applying my clairvoyance hat more and you are authoring this MSI, the FileInUse should take care of that for you and copy the file into place on reboot. If you really don't want this to happen then you would need a VBS script, of which slightly complex as you would like it to prompt 3 times - I would use inbuilt dialogs to prompt, I cant write VBS so cant help here.
Applying my clairvoyance hat more and you are authoring this MSI, the FileInUse should take care of that for you and copy the file into place on reboot. If you really don't want this to happen then you would need a VBS script, of which slightly complex as you would like it to prompt 3 times - I would use inbuilt dialogs to prompt, I cant write VBS so cant help here.
If you are adding a Excel Add-on, you should be using a different method as there is a registry key ordering that needs to be taken into account.
Clairvoyance hat off (:
Clairvoyance hat off (:
Good luck!