Chaddy Posted June 17, 2013 Posted June 17, 2013 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
BKGarry Posted June 17, 2013 Posted June 17, 2013 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
Steve21 Posted June 17, 2013 Posted June 17, 2013 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
themightymrp Posted June 17, 2013 Posted June 17, 2013 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)" ?
Rawns Posted June 17, 2013 Posted June 17, 2013 (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 June 17, 2013 by Rawns
tom_newton Posted June 17, 2013 Posted June 17, 2013 Possibly better to look in the registry for installed s/w rather than the filesystem?
Arthur Posted June 17, 2013 Posted June 17, 2013 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
Chaddy Posted June 18, 2013 Author Posted June 18, 2013 (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 June 18, 2013 by Chaddy
Arthur Posted June 18, 2013 Posted June 18, 2013 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now