Jump to content

Recommended Posts

Posted

Trying to force an MSI out to the remaining computers which seem to be playing stubborn installing Chrome with software installation GPO, so going to do it with a script instead.

However I'm not getting anywhere with this script so far, and I don't know what I'm doing wrong :(

 

@echo off

Set File="C:\%programfiles%\Google\Chrome\Application\chrome.exe"


If Not Exist %file% Goto Google


If Exist %File% Goto TheEnd


:Google
msiexec /package "\\SERVER\SOFTWARE\GOOGLEAPPS\GoogleChrome\GoogleChromeStandaloneEnterprise.msi" /quiet




:TheEnd 
echo Chrome exists!

 

Regards,

Chaddy

Posted
Does the set file need to have c:\ specified before the program files variable, as that may be causing two incidents of C:\ to be showing in the script
Posted

May be missing the obvious, but you didn't tell it to install?

 

msiexex /i "PackageName" etc? Your line /package doesn't do anything as far as I know unless I'm being stupid this morning

 

*Edit - Seems it does work on some versions with /package too, so ignore me!

 

Steve

Posted

I would normally use the syntax of

 

msiexec /I "package source" /q

 

But looking at your script it seems to be viable? When you say its not working, does it fail straight away? Could it be anything to do with 64bit windows? As in, is it trying to install to "C:\Program Files (x86)" ?

Posted (edited)

You may also want to take into account 64-bit devices (if you have them) as Chrome will be installed to %ProgramFiles(x86)%.

 

Also, @BKGarry is right, remove the C: from the SET FILE line as it's included in the %ProgramFiles% variable path.

Edited by Rawns
Posted

Try this...

 

@ECHO OFF

IF DEFINED ProgramFiles(x86) (
  :: 64-bit OS
  Set CHROME="%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe"
) ELSE (
  :: 32-bit OS
  Set CHROME="%ProgramFiles%\Google\Chrome\Application\chrome.exe"
)

IF NOT Exist %CHROME% msiexec /i "\\SERVER\SOFTWARE\GOOGLEAPPS\GoogleChrome\GoogleChromeStandaloneEnterprise.msi" NOGOOGLEUPDATEPING=1 REBOOT=ReallySuppress /QN

Posted (edited)

Removing the drive letter sorted it, I wasn't aware that the programfiles variable included. I should of known that tbh, silly me.

 

Thanks Arthur, I may look at that in the future, but atm isn't necessary as our machines are all 32bit.

 

Thanks for the help guys!

Edited by Chaddy
Posted
I may look at that in the future, but atm isn't necessary as our machines are all 32-bit.

The batch file will still work even if you only ever use it on 32-bit OSs. :)

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



×
×
  • Create New...