xboxscene.org forums

Author Topic: Individual Game Context Installer  (Read 100 times)

Unbewoffnet

  • Archived User
  • Newbie
  • *
  • Posts: 14
Individual Game Context Installer
« on: January 22, 2004, 09:48:00 PM »

First off, lemme compliment BenJeremy on the coolest dashboard ever.  I'm especially impressed with the usefulness of the context menus.  Even just using the current, non-WIP version we can already do more with this dashboard than with anything else.

This is working, at least on my box, in most cases.  I've had problems with what I believe is its failing to read bad media that don't appear to be fixable without exception handling.  I've also had problems on some retail games (which this should hypothetically copy, though I haven't had much success of yet) with detecting gamesize (which is why I've got an option to skip if 0) and with getting the math to work out.  Try this on a multigame, and tell me if the remaining space it predicts is right or not.  I've tried dividing by both 1000000 and 1024*1024, but it doesn't come out right either way.  Also, filepath is currently set at f:\HDDLoaderSomething, with something being selectable by the user from three options: MXM_entry.xml title, XBE title, and game directory title.  User will get more control once I've got ahold of a non-WIP virtual keyboard and/or the highly-anticipated next version.  :)

Last, this needs to be in a context menu to work.  It relies a lot on the variables that it inherits by being in one.  That said, knock yourselves out.  :)

CODE

:begin
 BeginDraw UseCurrent
   MessageBox "Checking game size . . ."
 EndDraw
 Setfunc GameSize FILESIZE %_GameDir%
 IF# %GameSize% == 0 GOTO SkipSpaceCheck
 Set TmpA $ShortDriveFFree$
 Setfunc TmpB LENGTH %TmpA%
 Sub TmpB 3
 Setfunc TmpC RIGHT %TmpB% %TmpA%
 Setfunc TmpD LENGTH %TmpC%
 Sub TmpD 7
 Setfunc TmpE LEFT %TmpD% %TmpC%
 Setfunc NetSpace REPLACE "," "" %TmpE%
 Set SmallGame %GameSize%
 Div SmallGame 1000000
 Sub NetSpace %SmallGame%
 BeginDraw UseCurrent
   MessageBox "This will install %_GameTitle%.$eol$$ShortDriveFFree$$eol$Game Size: %SmallGame%$eol$Net Free Space: %NetSpace%$eol$Press A to Continue$eol$Press B to Cancel"
 EndDraw
 GOTO Step0

:SkipSpaceCheck
 BeginDraw UseCurrent
   MessageBox "This will install %_GameTitle%.$eol$Press A to Continue$eol$Press B to Cancel"
 EndDraw

:Step0
 Input
   If %_GP_A% == "1" GOTO Step1
   If %_GP_B% == "1" GOTO End
 QUIT

:Step1
 Setfunc DirLen LENGTH %_GameDir%
 SUB DirLen 3
 Setfunc DirName RIGHT %DirLen% %_GameDir%
 Setfunc XBT XBETITLE %_GameDir%\default.xbe

 BeginDraw UseCurrent
   MessageBox "Install to:$eol$A: F:\\HDDLoader\\%_GameTitle%$eol$B: F:\\HDDLoader\\%DirName%$eol$X: F:\\HDDLoader\\%XBT%"
 EndDraw

 Input
   If %_GP_B% == "1" GOTO Dir
   If %_GP_A% == "1" GOTO Title
   If %_GP_X% == "1" GOTO XBT
 QUIT
 
:Dir
 Set NewPath %DirName%
 GOTO Step2

:Title
 Set Newpath %_GameTitle%
 GOTO Step2

:XBT
 Set Newpath %XBT%
 GOTO Step2

:Step2
 Setfunc DirIs FILEEXISTS f:\HDDLoader\%NewPath%
 If# %DirIs% == 1 GOTO DirExists

 MkDir f:\HDDLoader\%NewPath%
 BeginDraw UseCurrent
   Messagebox "Copying..."
 EndDraw
 Copy %_GameDir% "F:\\HDDLoader\\%NewPath%"

 BeginDraw UseCurrent
   Messagebox "Copy complete."
 EndDraw
 Delay 3

 BeginDraw UseCurrent
   MessageBox "%_GameTitle% is installed to F:\\HDDLoader\\%NewPath%$eol$"
 EndDraw
 Delay 3

 attr F:\HDDLoader\%NewPath% rw

 BeginDraw UseCurrent
   MessageBox "Reset Menu Cache?$eol$A: Yes$eol$B: No"
 EndDraw

 Input
   If %_GP_A% == "1" GOTO Cache
   GOTO AskRB

:Cache
 ResetMenuCache
 GOTO AskRB

:AskRB

 BeginDraw UseCurrent
   MessageBox "Reboot?$eol$A: Yes$eol$B: No"
 EndDraw

 Input
   If %_GP_A% == "1" GOTO RB
 QUIT

:RB
 Reboot
 QUIT

:DirExists
 BeginDraw UseCurrent
   MessageBox "F:\\HDDLoader\\%NewPath% exists.$eol$Please choose another option."
 EndDraw
 Delay 3
 GOTO Step1

:End
 QUIT
Logged

Kthulu

  • Archived User
  • Hero Member
  • *
  • Posts: 787
Individual Game Context Installer
« Reply #1 on: January 23, 2004, 04:50:00 AM »

cool!  good idea!

maybe an uninstall too?

yes, FILESIZE doesn't seem to work as expected.  i haven't tested it in WIP, but in non-WIP it seems to pick one file in a directory and report that as the filesize for the whole directory.  it is consistent about which file it picks, but i never could figure out how it was picking the file.

as far as the non-WIP keyboard goes, check out the scripts on www.allxboxskins.com
Logged

Unbewoffnet

  • Archived User
  • Newbie
  • *
  • Posts: 14
Individual Game Context Installer
« Reply #2 on: January 23, 2004, 08:02:00 AM »

Yeah, I have an uninstaller written, too.  Just didn't post it.  I'll toss it up there when I get home.  I'll check out AXS, too.  I thought all the keyboards were for the WIP release, so if not, then I'm one happy scripter.  :)

Also, I've had trouble copying games from my old MenuX discs with this.  I imagine that's just because they're old beat-up DVD+Rs.

And here's a weird phenomenon I've run into because of this.  Some retail games appear to detect wrong.  My MXM only detects the demos on Halo, for instance, and both Morrowind and THUG come up with the HD mode options instead of the DVD ones.  Weird, eh?
Logged

Yuyu

  • Archived User
  • Hero Member
  • *
  • Posts: 908
Individual Game Context Installer
« Reply #3 on: January 23, 2004, 09:46:00 AM »

Yeah once next "public" release is out, scripters wil want to rewrite there scipts using the internal Vkeyboard though, to give users a consistency of what to expect when they want to input something.... WIll be nice too, cause you can break it down to have just the numeric keypad for numbers and so on...
Logged