installing windows package with msiexec...

Hi…

I should probably know how to search for this as I am sure others have asked it - I have a very short time frame to get something working and then I have to work on another project - if anyone could help me with this I would really appreciate it!

I need to use the following command to install a windows package…

msiexec /qn /i “c:/bak/msodbcsql.msi” IACCEPTMSODBCSQLLICENSETERMS=YES

I have tried:

win_package:
path: \mydomain.local\share\sqltools\msodbcsql.msi

product_id: ‘{7E425BFB-1DEB-499F-8F3F-3522A6E98754}’
state: present
aruguments: /qn /i IACCEPTMSODBCSQLLICENSETERMS=YES

and that has a fatal error that fills several screens with red unhappiness that I am trying to make sense of but no luck so far… the first bit looks like this:

fatal: [AnsWin201601]: FAILED! => {“changed”: false, “exit_code”: 1603, “log”: "=== Verbose logging started: 4/19/2018 10:21:12 Build type: SHIP UNICODE 5.00.10011.00 Calling process: C:\Windows\system32\msiexec.exe ===\r\nMSI (c) (D0:80) [10:21:12:367]: Resetting cached policy values\r\nMSI (c) (D0:80) [10:21:12:367]: Machine policy value ‘Debug’ is 0\r\nMSI (c) (D0:80) [10:21:12:367]: ******* RunEngine:\r\n ******* Product: \\mydomain.local\share\sqltools\msodbcsql.msi\r\n ******* Action: \r\n ******* CommandLine: **********\r\nMSI (c) (D0:80) [10:21:12:367]: Client-side and UI is none or basic: Running entire install on the server.\r\nMSI (c) (D0:80) [10:21:12:367]: Grabbed execution mutex.\r\nMSI (c) (D0:80) [10:21:12:382]: Cloaking enabled.\r\nMSI (c) (D0:80) [10:21:12:382]: Attempting to enable all disabled privileges before calling Install on Server\r\nMSI (c) (D0:80) [10:21:12:382]: Incrementing counter to disable shutdown. Counter after increment: 0\r\nMSI (s) (20:28) [10:21:12:382]: Running installation inside multi-package transaction \\mydomain.local\share\sqltools\msodbcsql.msi\r\nMSI (s) (20:28) [10:21:12:382]: Grabbed execution mutex.\r\nMSI (s) (20:10) [10:21:12:382]: Resetting cached policy values\r\nMSI (s) (20:10) [10:21:12:382]: Machine policy value ‘Debug’ is 0\r\nMSI (s) (20:10) [10:21:12:382]: ******* RunEngine:\r\n ******* Product: \\century.terrapin.local\share\sqltools\msodbcsql.msi\r\n ******* Action: \r\n

If the product is already installed no error… I install another package from the same location on the line before this … but it does not require the msiexec … you can just use the /s switch on it and that works fine, so I know my setup is basically working, but I think I am just not calling msiexec correctly or something and I don’t know how and googling hasn’t found me anything yet. Sorry for the long post, but any help on this would be hugely appreciated.

Thanks
Bill

The log doesn’t really indicate what is going wrong here, usually the error is near the end but MSI logs can be quite verbose. Network paths and WinRM usually don’t play well due to a multitude of issues stemming from how WinRM works but I would try

  • Use become to bypass the WinRM hell http://docs.ansible.com/ansible/latest/user_guide/become.html#become-and-windows. This will run the command like you would when logging on locally and trying it

  • Test out to see if this installs when the path is a local path instead of from the network path, you also don’t need the product id in that case

  • Remove the /qn, win_package automatically adds /qn and /norestart to the arguments when the path is to an MSI

Thanks

Jordan

Thanks for the input Jordan, I believe I am using become. I tried without the /qn… no difference, I copied the installer locally no difference.

The end of the error looks like this

MSI (s) (70:98) [18:25:43:104]: Product: Microsoft ODBC Driver 13 for SQL Server – Installation failed.

MSI (s) (70:98) [18:25:43:104]: Windows Installer installed the product. Product Name: Microsoft ODBC Driver 13 for SQL Server. Product Version: 13.1.4414.46. Product Language: 1033. Manufacturer: Microsoft Corporation. Installation success or error status: 1603.

MSI (s) (70:98) [18:25:43:104]: Deferring clean up of packages/files, if any exist

MSI (s) (70:98) [18:25:43:104]: MainEngineThread is returning 1603

MSI (s) (70:CC) [18:25:43:104]: RESTART MANAGER: Session closed.

MSI (s) (70:CC) [18:25:43:104]: No System Restore sequence number for this installation.

=== Logging stopped: 4/19/2018 18:25:43 ===

MSI (s) (70:CC) [18:25:43:104]: User policy value ‘DisableRollback’ is 0

MSI (s) (70:CC) [18:25:43:104]: Machine policy value ‘DisableRollback’ is 0

MSI (s) (70:CC) [18:25:43:104]: Incrementing counter to disable shutdown. Counter after increment: 0

MSI (s) (70:CC) [18:25:43:104]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2

MSI (s) (70:CC) [18:25:43:104]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2

MSI (s) (70:CC) [18:25:43:104]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1

MSI (s) (70:CC) [18:25:43:104]: Destroying RemoteAPI object.

MSI (s) (70:B4) [18:25:43:104]: Custom Action Manager thread ending.

MSI (c) (9C:E8) [18:25:43:104]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1

MSI (c) (9C:E8) [18:25:43:104]: MainEngineThread is returning 1603

=== Verbose logging stopped: 4/19/2018 18:25:43 ===

", “msg”: “unexpected rc from install C:\Windows\system32\msiexec.exe /i c:\temp\msodbcsql.msi /L*V C:\Users\billd\AppData\Local\Temp\apknplam.2td /qn /norestart: see rc, stdout and stderr for more details”, “rc”: 1603, “reboot_required”: false, “restart_required”: false, “stderr”: “”, “stderr_lines”: , “stdout”: “”, “stdout_lines”: }

I looked up that RC and Microsoft said it could be because SYSTEM does not have access to install, so I followed their solution and gave SYSTEM full access to the C: drive

But it still fails. Any other ideas?

Thanks again, appreciate any help I can get on this.

Bill

Hi, I found the problem! problems actually… a. I can’t spell…

state: present
aruguments: /qn /i IACCEPTMSODBCSQLLICENSETERMS=YES

aruguments, not sure why that didn’t get picked up sooner… and I took all the switches out and then the event viewer said I did need the IACCEPTMSODBCSQLLICENSETERMS=YES for it to install, and thats when I noticed the mispelling when I put that argument back in and now it works.

Thanks… slow progress… but progress is progress and keeps me optimistic!

Your error says no ui at client side. Does your msi needs UI after execution? If yes you should know Ansible is not interactive to make it interactive use PSexecute64.exe search on Google for more info or reply back to know how to.