viewpoint-particle

Author Topic: Installing .MSI File Passivly  (Read 67 times)

geauga

  • Newbie
  • *
  • Posts: 29
Installing .MSI File Passivly
« on: October 24, 2019, 07:32:11 am »
I am trying to install a MSI package from within a winbatch program.  I need to run the MSI in quiet mode or passively.  To that end I need to do the install using a msiexec command wrapped in a RunWithLogon command.  I have tried many different interactions trying to put the .msi file as part of the program name and as part of the parameter all to no avail.  Any suggestions on the correct syntxt?

strCmd = Environment("COMSPEC")
RunWithLogon ("msiexec c:\Data\GoToAssist_Corporate_Customer_Setup.msi","/passive ",  "", @NORMAL, @WAIT, runas_user, runas_domain, runas_pass,1)
 exit

td

  • Tech Support
  • *****
  • Posts: 3079
    • WinBatch
Re: Installing .MSI File Passivly
« Reply #1 on: October 24, 2019, 09:00:36 am »
Using "RunWithLogon" in a UAC environment is not going to fly if you are attempting to elevate a process to full admin privileges.  You would need to use a Bootstrapper script as documented on this forum and in the Tech Database.

You also need to learn the proper usage of MSIEXEC command-lines options.  You can find that information on Microsoft's Website or by typing "msiexec /?" at the command prompt.

You also have some extraneous code in your posted example.  You obtain the full path to the command prompt executable but never use it.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

geauga

  • Newbie
  • *
  • Posts: 29
Re: Installing .MSI File Passivly
« Reply #2 on: October 24, 2019, 10:20:50 am »
I was really looking for suggestions on the MSIEXEC command.  I am familiar with the parameters available for MSIEXEC but I cannot figure out syntactically how to build the line.  Is the actual MSI file go in the parameter section or like I have it where I put the MSI file part of the program name.  I have tried every interaction that I can think of all to no avail.

td

  • Tech Support
  • *****
  • Posts: 3079
    • WinBatch
Re: Installing .MSI File Passivly
« Reply #3 on: October 24, 2019, 11:24:05 am »
As previously stated, no syntax is going to work in a UAC environment if you are attempting to execute MSIEXEC as an elevated admin and, obviously, a msi file is not part of an executable's name so it doesn't belong in the first parameter to the RunWithlogon function when that parameter also has the executable's name.  That said, if the file extension is registered in the registry, as the .msi extension usually is, the function will attempt to use the associated executable to launch the file.  But you can't use the executable's name in any parameter when you choose to take that approach.  Of course, if you try that route you are dependent on the registry entries existing and being configured to accept additional parameters when needed.

You stated that you "tried every interaction".  Not sure what you mean by that but have you tried placing the correct command-line options for the msiexec executable in the "RunWithLogon" function?  You also said that you are familiar with parameters to MSIEXEC but, if memory serves, your posted script seems to be missing one of the switches (like "/i" or "/a" ??) that usually precedes and indicates the msi file parameter when launching MSIEXEC from the command line. 

You may also wish to read the documentation for the RunWithLogon function in the Consolidated WIL Help file.  It explains the operations and limitations of the function in great detail.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade