Jump to content

ShellExecuteWait MSI No User Session


Nomis
 Share

Recommended Posts

Afternoon all, or Morning depending what part of the world you are in

In my ever increasing attempt to make my work life easy, I’m trying to setup a generic script to install MSIs or EXEs in a predetermined order via AD, all was going well (minus a scripting fopar yesterday thanks for help guys) until I wrapped the complied script in to a MSI and deployed via AD in the Computer GPO. When the script execute all MSIs were executed one after another so windows installer failed to install any further MSIs other that the first one but the installation would time out as it is waiting for a user response that “An MSI installation is already running Please wait” type message.

So I have looked at script and spotted my newbie mistake that I was executing an MSI directly, but when tested while logged on it worked fine, waiting for each MSI before executing the next one any way so I have rewritten the script to execute MsiExec.exe and pass it the required command line options See below:

I have looked through the forum and there is a mixture of syntaxes so the question is do I need the @Systemdir on the end or does it not matter.

Thanks in advance Simon

#NoTrayIcon
$RNum = Random(500, 3000, 1)

Sleep($RNum)
ShellExecuteWait("MsiExec.exe", "/i " & '"' & @ScriptDir & '\Material Library 2012\MaterialLibrary2012.msi" /qb', @SystemDir)
Sleep($RNum)
ShellExecuteWait("MsiExec.exe", "/i " & '"' & @ScriptDir & '\Image Library 2012\BaseImageLibrary.msi" /qb', @SystemDir)
Sleep($RNum)
ShellExecuteWait("MsiExec.exe", "/i " & '"' & @ScriptDir & '\Content Service\ContentService.msi" /qb', @SystemDir)
Sleep($RNum)
Exit
Link to comment
Share on other sites

I have never needed the third parameter. I played with the syntax to make an silent install for 7zip. Here's what I came up with that worked:

$link = "/i " & '"' & @ScriptDir & '\7z920.msi' & '"' & " /qb"
ShellExecuteWait("MsiExec.exe", $link)

Hope it helps!

#include <ByteMe.au3>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...