Running SophosSetup.exe Command from Fixlet

Hello all,

We have a fixlet to install Sophos cloud client but we also need another fixlet/task that will run a command to point our servers to the right message relay, however, the cmd needs to be in the directory when we run the command manually so I wasn’t sure if my below action script would work as I think it would.

copy “\vailsys.deerfield\opsdfs\WinOps\SophosCloudInstaller\Server Installer\SophosSetup.exe” “__Download\SophosSetup.exe”

copy __Download\SophosSetup.exe “C:\SophosSetup.exe”

waithidden cmd.exe /C “C:\SophosSetup.exe --messagerelays=RELAY_SERVER_IP_ADDRESS:8190”

It’s not clear to me whether you’re saying that the above action script does not work, or if you haven’t tried it. If it doesn’t work, does it fail on a particular line? Any idea how far it’s getting?

If your issue is that the command needs to be run from the directory the SophosSetup.exe executable is in, I’d suggest making a createfile that first does a cd into the root of C and then runs your last line.

Thanks alinder so the script is copying the executable to the C drive, but it looks like the last line its just sitting at running forever until I stop it and doesn’t actually install Sophos. Does something look off about this script I made? Maybe its not actually getting into the C: like the create file specifies?

copy “\vailsys.deerfield\opsdfs\WinOps\SophosCloudInstaller\Server Installer\SophosSetup.exe” “__Download\SophosSetup.exe”

copy __Download\SophosSetup.exe “C:\SophosSetup.exe”

createfile until end
cd c:
end

waithidden cmd.exe /C “C:\SophosSetup.exe --messagerelays=172.25.150.35:8190”

Oh I forgot to put the waithidden in the create file so Im guessing thats the issue?

Also is there a way I can delete the installer after its done, possibly after that last line, like delete “C:\SophosSetup.exe”?

You don’t actually seem to be doing anything with the createfile? Remember this just creates a file called __createfile that you then need to manipulate. It doesn’t actually do anything

https://developer.bigfix.com/action-script/reference/file/createfile-until.html

Also if you run that file you change drives to “C:” but then that goes away for the next command in the actionscript. You would need to do all this in one line for a change directory to affect the command.

Yeah you are right AlanM sorry Im not the best at this.

So this seems to run until “run SophosInstall.bat” at which point it fails. Is there a different way I should be specifyign that line?

copy “\vailsys.deerfield\opsdfs\WinOps\SophosCloudInstaller\Server Installer\SophosSetup.exe” “__Download\SophosSetup.exe”

copy __Download\SophosSetup.exe “C:\SophosSetup.exe”

createfile until end
cd c:
cmd.exe /C "C:\SophosSetup.exe --messagerelays=172.25.150.35:8190"
end
delete "C:SophosInstall.bat"
copy __createfile "C:\SophosInstall.bat"
run SophosInstall.bat
delete “C:\SophosSetup.exe”

You probably want

run "C:\SophosInstall.bat"

yeah thats what Im trying now actually but it doesn’t seem to be completing the install. I see the Sophos setup appear in task manager processes but never actually installs. Maybe it needs user interaction normally? Usually for an exe when making a fixlet I would add a /S or something, but doesn’t seem to work in this case because Im making a create file to add the relay part.

If you use “run” it will delete the EXE before its done. You want to use “wait”

1 Like

If any user interaction is required then remember this action is running as local system and might not work in that environment.