AutoHotkey Community

It is currently May 27th, 2012, 12:19 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: October 28th, 2008, 10:36 pm 
Offline

Joined: October 20th, 2008, 7:54 pm
Posts: 7
Location: Illinois
Ok, so with all the help from this forum, I have a set of scripts that work together to detect that a disc is in the drive, if it's a game disc that the script is programmed for, it will install (if necessary) the game, then launch it, else, it assumes it's already installed and launches the game...all on disc insertion...like a console.

Now for the pain. I DO NOT know where to begin:

I need to automatically manage hard drive space. In theory, a user could have a 20GB hard drive and be able to play every game he drops in because my scripts would do a drive free space check before starting the install. If there wasn't enough free space, it would start scripts that automated the uninstall processes of the LEAST PLAYED GAMES, then continue with the install and launch routine.

Do I create a CSV database of games installed (during the installation routine) with a number at the end for the number of times launched? If so, how do I make any number of given scripts add 1 to JUST THAT NUMBER at the end of the line for the CORRECT GAME THAT WAS JUST LAUNCHED?

I mean, if I could get a self-updating list like that, then I could use some of the file commands to sort it in order of lowest to highest and then start running uninstall scripts starting with the games with the lowest play numbers.

And even then, as a design decision, would I want to keep the play counts for uninstalled games since they could be reinstalled and continued, or wipe all memory of them from the list when they're uninstalled?

I want to build a PC that acts like a console. Drop in a game and it installs if necessary and plays. I've gotten that far (in as far as I have to write a script for EVERY game...that's where my forums at openextreme.crashandthefury.com/forum comes in).

But as for how to get the system to automatically uninstall games appropriately (and keep doing so until disk space is free) to free up disk space, I don't know where to start.

Any help in this direction would be appreciated.

Thanks to you all in advance.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Manual quick fix
PostPosted: October 29th, 2008, 1:58 am 
Offline

Joined: October 20th, 2008, 7:54 pm
Posts: 7
Location: Illinois
Right now, I just have each install script doing a Drive Space Free check. If it's not enough for what the game says it needs, a message box pops up telling the user to make some room and try again, then the script aborts (lest it try to install the game anyway). If the test passes, the install continues as usual (IF/ELSE statements...gotta love them).

But this is still too manual for a game console that plays PC games. The automatic management of game installation and uninstallation is the thing. Auto-manage hard drive space.

Just had an idea. What do you think of this? A REVERSE DIRECTORY of games. The disc detect script that knows what discs have been inserted, figures out what game it is, and figures out whether to install it first or just launch it has a built-in database (it's in the code, not an external file) of every game we support.

What if there were another script that ALSO had info on every game we support. If there weren't enough hard drive space according to an installer, then it would call this script up to verify if games were installed, and if so, call up their uninstall routines, doing this on a loop with drivespace checks until it finally had enough room to install the game. Then it would re-call the installer.

All I need to know for this is HOW to pass a variable from one script to another.

Seriously, what do you think? Sounds more brute force to me and less intelligent, but sometimes, brute force is better.

_________________
openextreme.crashandthefury.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2008, 7:36 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
I think I see where you're going with this and the idea is pretty neat. I does take out the joy of getting right in to a game if you have to go through the uninstall of one game and then the install of the game you want to play, but that's neither here nor there.

Here's what I would do ... theoretically:

I would create an csv or ini database of all games that you want to work with this. The database would included the executable (or rather) autorun filename (and possible the volume name of the disc... since a lot of games use autorun.exe or setup.exe), the amount of drive space the game uses after installation, a path to the AHK installer script and AHK unistaller script, the executable name of the main exe to play the game, (seperately) the full path of the main exe (to check if game is installed already), and a spot for the number of playes.

My best thoughts here are that you may need 2 scripts running at all times for this to work.

The first would be used to check for the autorun process/volume ID of your games every second or two. This script will be your main script for detect which game you've inserted and what course of action to take by checking the drive space, comparing the database of times the games have been played and then telling your system to uninstall a game or to just install the new game, if needed and then launch the game.

The second script would be for detection of a game being played. It would detect to see the the main exe is actually running and if so will increment the play count in your database file.

This is how I would set it up. Commands you might be interested in would be PROCESS, DRIVEGET, DRIVESPACEFREE, LOOP (or GOTO), GOSUB, IF (of course), and probably others that I'm over looking

on a side note: I would probably make a twist on your idea of uninstalling the least played game by changing how you check for it. Instead of the number times it is played, I would instead for how long it was played. I would set up a timer to time how long the exe is in use and when it is no longer running, add that time to the total time in the database. I'm just thinking along the lines that I could play one game for a LONG period of time, but not actually open it much and then turn around and play a game a lot, for a short amount of time, but still spend more time in the first one.

Anyways, I know I didn't program one for you. I don't have the limitation of drive space when you have 3TB of it. I hope this all helps and good luck


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 13 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group