enjay Posted October 22, 2013 Posted October 22, 2013 I need to deploy some software (to an RM CC3 network) which has a setup.exe and some command lines, so I can't package it. I can deploy it via a batch file in the startup scripts GPO (sshh, don't tell RM!), but that installs it every time it boots. Is there a way that I can run a script which first checks whether the application exists? I'm sure it is possible, but I've spent too long on an RM network to know how!
X-13 Posted October 22, 2013 Posted October 22, 2013 (edited) I need to deploy some software (to an RM CC3 network) which has a setup.exe and some command lines, so I can't package it. I can deploy it via a batch file in the startup scripts GPO (sshh, don't tell RM!), but that installs it every time it boots. Is there a way that I can run a script which first checks whether the application exists? I'm sure it is possible, but I've spent too long on an RM network to know how! Why not just install it via GPO and use a transform file? For referance: http://www.itninja.com/blog/view/deploying-mst-files-using-group-policy Edited October 22, 2013 by X-13
enjay Posted October 22, 2013 Author Posted October 22, 2013 Why not just install it via GPO and use a transform file? Because it is a .exe, not an MSI.
Steve21 Posted October 22, 2013 Posted October 22, 2013 Assuming it's a normal VBS startup script? Then just run a check on the installed exe location, and do an if not then install etc Example, not tested Set fso = CreateObject("Scripting.FileSystemObject") If (fso.FileExists("MyExe.Com")) Then Else "InstallCrap" End If Steve
X-13 Posted October 22, 2013 Posted October 22, 2013 Because it is a .exe, not an MSI. Even though I read that... it didn't register. Sorry.
Arthur Posted October 22, 2013 Posted October 22, 2013 (edited) I need to deploy some software (to an RM CC3 network) which has a setup.exe and some command lines, so I can't package it. You just need to create a suitable package.ini file to deploy the EXE. [Package] Description=Example Application Version=1.0.0.0 OS=5.WS,6.WS ExeFile=NameOfYourInstaller.exe Addcommand= /passive /quiet /norestart UninstallCommand= /passive /quiet /norestart See TEC21757 (RM KB article) for more details. Edited October 22, 2013 by Arthur
enjay Posted October 22, 2013 Author Posted October 22, 2013 You just need to create a suitable package.ini file to deploy the EXE. Forgot that was possible. I think the script might be the way to go, though, as there is another file it needs which has to be in the same location as the setup.exe, and I don't know what AppAgent would make of that.
Chuckster Posted October 22, 2013 Posted October 22, 2013 What you want is something like this.. @echo off REM * Installing EloTouch Drivers 5.5.0 32-bit * if exist "C:\Program Files\Elo TouchSystems" goto lastbit :Install_EloTouch \\schoolname.internal\Applications$\Drivers\SW602132_EloTouchMouse_5.5.0\32Bit\EloSetup.exe [/Reboot] [/NoHandshake] [/s] [/iu] [/is] [/P:1,2,3,4] :lastbit exit
enjay Posted October 22, 2013 Author Posted October 22, 2013 Thanks @Chuckster, that is a .bat file, right?
mac_shinobi Posted October 22, 2013 Posted October 22, 2013 Failing that isn't there a registry key where it logs all the installed applications and just enumerate through that registry key to see if it shows as an installed application ?
Garacesh Posted October 23, 2013 Posted October 23, 2013 (edited) What you want is something like this.. -- Code -- Using GoTo's @Chuckster? Shame on you! I believe there's a velociraptor heading your way (Somebody be a darling and post the link? XKCD's blocked here) Although if you insist on it, I might point out :lastbit wasn't required.. Batch will interpret "goto :eof" (end-of-file) as an immediate quit, iirc @echo off REM * Installing EloTouch Drivers 5.5.0 32-bit * if not exist "C:\Program Files\Elo TouchSystems" ( [indent]\\schoolname.internal\Applications$\Drivers\SW602132_EloTouchMouse_5.5.0\32Bit\EloSetup.exe [/Reboot] [/NoHandshake] [/s] [/iu] [/is] [/P:1,2,3,4][/indent] [indent])[/indent] Edited October 23, 2013 by Garacesh
enjay Posted October 23, 2013 Author Posted October 23, 2013 So, a velociraptor-free command would be: if not exist "C:\Program Files\PaperCut NG\licence.txt" "\\server1\software installers\papercut\pcng-setup-13.3.23186.exe" /TYPE=secondary_print /VERYSILENT /NOICONS Yes?
Garacesh Posted October 23, 2013 Posted October 23, 2013 (edited) With brackets, yes.if not exist "C:\Program Files\PaperCut NG\licence.txt" ("\\server1\software installers\papercut\pcng-setup-13.3.23186.exe" /TYPE=secondary_print /VERYSILENT /NOICONS) Personally I like to 'branch' my code across multiple lines and with indents, just for easier readability, so I'd personally have it as:if not exist "C:\Program Files\PaperCut NG\licence.txt" ( [indent]"\\server1\software installers\papercut\pcng-setup-13.3.23186.exe" /TYPE=secondary_print /VERYSILENT /NOICONS[/indent] [indent])[/indent] But the command line interprets it the same, either way. Currently, the code character-for-character, as-posted, is two separate commands, one of which being an IF with a condition but no action, the other being the install. It would check for licence.txt, and if it found it, progress to the next command (install PaperCut). If it didn't find it, it would proceed to the next command. The brackets make it all one command, and it will only process the if the IF statement is true (in this case, if the license.txt file doesn't exist).. Else's also work (but not ELIF, but you can nest IF commands to the same effect).. if not exist "C:\Program Files\PaperCut NG\licence.txt" ( [indent]"\\server1\software installers\papercut\pcng-setup-13.3.23186.exe" /TYPE=secondary_print /VERYSILENT /NOICONS[/indent] [indent]) ELSE ([/indent] [indent][indent]Echo "Yup, it's there!"[/indent] [/indent] [indent][indent])[/indent] [/indent] Edited October 23, 2013 by Garacesh 1
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