ccozart Nov 20, 2018 @ 1:42pm
Programmatically find out if a game is updating
Hello,

I have no idea if anyone here will be able to help with this question. I'm currently building an automated testing system for a project that is on steam. I have it configured to launch steam, and launch the game, BUT as I'm pushing builds to steam with some relative frequency the odds of it needing to update are high. If the app is updating when I call the launch command it will not launch when the app is finished updating. I know if you do this in the GUI it has the boolean checkbox that says "Launch game as soon as it's ready" so my question is this....

Is there a way I can either A. see if steam is updating a game from an external program, or B. set that flag to true when calling the -appLaunch <appid> command line argument?

Edit: For clarification, this system should be able to completely run with no human interaction once I have it fully configured.
Last edited by ccozart; Nov 20, 2018 @ 1:42pm
< >
Showing 1-8 of 8 comments
Satoru Nov 20, 2018 @ 1:52pm 
https://developer.valvesoftware.com/wiki/Command_Line_Options#SteamCMD

Seems like you want steamcmd to do all this

app_update <appid> [-validate] [-language <lang>] [-beta <betaname>] [-betapassword <pwd>] Make sure a Steam application is up-to-date

B-o-B Nov 20, 2018 @ 2:01pm 
Originally posted by ccozart :
BUT as I'm pushing builds to steam with some relative frequency the odds of it needing to update are high.

The platform has went through many changes lately, so updates a plenty, far more than what ive normally seen. Some bugs needing fixed over night. Hopefully it returns to a more normal experience eventually.
ccozart Nov 20, 2018 @ 2:58pm 
Originally posted by Satoru:
https://developer.valvesoftware.com/wiki/Command_Line_Options#SteamCMD

Seems like you want steamcmd to do all this

app_update <appid> [-validate] [-language <lang>] [-beta <betaname>] [-betapassword <pwd>] Make sure a Steam application is up-to-date

Yea I ran that one, the biggest problem is that it installs the game to a different directory than the standard steam client does, and it's app_run doesn't work as this isn't a dedicated server. The documentation suggest that the commands from steamcmd.exe are for setting up servers, not game clients.

Originally posted by Bear™:
Originally posted by ccozart :
BUT as I'm pushing builds to steam with some relative frequency the odds of it needing to update are high.

The platform has went through many changes lately, so updates a plenty, far more than what ive normally seen. Some bugs needing fixed over night. Hopefully it returns to a more normal experience eventually.

I'm referring to my game updating, not steam itself updating
anarcher Nov 20, 2018 @ 9:04pm 
Can you launch the game, then check running processes to see if it's actually running? If not, it's updating.
ccozart Nov 21, 2018 @ 9:19am 
Originally posted by anarcher:
Can you launch the game, then check running processes to see if it's actually running? If not, it's updating.

Done this, the problem with this approach is, when you try to run the game while it's updating, it brings up a new window showing the progress of the download with a checkbox for launch when it's ready, a check updates button, and a play game button.

If you run the -appLaunch command again while that's up it won't start the game even if the download is finished.

I had tried running a loop that waited x seconds and retried launching the game, checked if the process is running, and if it wasn't waited again until the process started. That wasn't working so I stepped through my code breaking after the second attempt, waiting for the download to finish, then letting the loop complete again and no luck...

I think I might be SOL on this issue my only other option is to open steam then wait like 5 mins before trying to launch the game as my updates usually never take longer than that.
anarcher Nov 21, 2018 @ 10:14am 
There are 3rd party programs (maybe Autohotkey?) that can detect the popup and close it automatically.
ccozart Nov 21, 2018 @ 3:17pm 
So what I ended up doing today, which is working is I found that under the steam installation directory there is a logs folder with a file named content_log.txt this file is where Steam puts the information about downloads and installs when an install is complete the line would look something like

[2018-11-21 16:14:38] AppID <appID> scheduler finished : remove from schedule

where <appID> is the ID of the app being updated.

So I had to set a string to the start time of my operation, copy the content_log.txt file, read it, pull the lines from where my start time was to the end, and see if it contained the line shown above...and to keep it from reading every chance it could while in the loop, I just set up timers to read every X seconds until the download was complete, then restarted steam and started the app again...

A little hacky but it's working now.
anarcher Nov 21, 2018 @ 6:18pm 
Great. Maybe there's a way to set steam to be silent with no popups, that would be helpful.
< >
Showing 1-8 of 8 comments
Per page: 1530 50

Date Posted: Nov 20, 2018 @ 1:42pm
Posts: 8