Install Software with MSIEXEC with GPO Shutdown Script
Solution 1
The specific problem you're having is that MSIEXEC
, called in that manner, runs asynchronously. Run it with a start /wait msiexec ...
command and you'll get what you're looking for.
Having said that, you're replicating a subset of functionality that's already built into the Group Policy client. You should research Software Installation policy to see what it can do for you. You can create a reasonably scalable, deterministic automated software installation environment without writing any scripts. It's not perfect but it does the job in a lot of cases. It'll also be much easier for The Next GuyTM to understand than a maze of batch scripts that you'll create this way.
Solution 2
Use the User logoff script. Not Computer shutdown. Network service is not available at shutdown, only at logoff.
You could copy the .msi file to the local drive and change the setup path so it doesn’t point to \\10.0.0.201\*
but to c:\*
.
Related videos on Youtube
Burak Oguz
Updated on September 17, 2022Comments
-
Burak Oguz over 1 year
I am trying to install software with GPO at comptuer shutdown.
My first question is it is possible to do it with Software Install in Win2003 Server?
Then I tried to put a batch script to shutdown script of computer from GPO. Script is like that:
if exist c:\mydlp-0.7.12.txt goto end echo %date% %time% >> c:\mydlp-0.7.12.txt msiexec /i \\10.0.0.201\deploy\mydlp-endpoint-0.7.12.msi /qb /passive /forcerestart /l* C:\log.txt :end
It does not install it on shutdown, it starts to install however it does not complete installation. However, when I run batch script normally it runs and installs software successfully.
Thanks in advance.
-
JamesK over 13 yearsHi, why are you choosing the install software on shutdown? surely using the group policy to deploy software would be more efficant and cause less problems?
-
Burak Oguz over 13 yearsOur users are not patient enough to wait software installation on startup :)
-
-
Burak Oguz over 13 yearsThank you.. I will try that.. Our users are not patient enough to wait software installation on startup :).
-
Bobe Kryant over 13 yearsMy users are equally as anal :) (not all of them, in case they find this post!)
-
Burak Oguz over 13 yearsTried it. Not working :(, still same problem. Not waiting for installation and shutting down the computer.
-
Spence over 13 years@Burak: I'm occupied with a Customer right now. When I get some time I'll take a look at this. Shutdown scripts will be forcibly terminated after 10 minutes, by default. How long does this install take, normally?
-
Burak Oguz over 13 yearsIt is not a huge file. msi size is ~10 MBs and installed size is 20 MBs. It should not take longer than 2 mins under normal circumstances.