xboxscene.org forums

Author Topic: Help With Scripting An Auto-installer  (Read 235 times)

DJB

  • Archived User
  • Jr. Member
  • *
  • Posts: 70
Help With Scripting An Auto-installer
« on: October 07, 2004, 02:18:00 AM »

Hello.

Over the last few weeks I have been scripting a new auto-installer using MXM 0.9n6. I've been reading posts here plus looking at examples, and I thought I had it all worked out, until I try and execute it.

What I've done is pasted my mxm.xml file, my menu.xml file, plus a few examples of the .xas files I've scripted.

Could someone show me where I'm going wrong please, as it's not obvious to me...

mxm.xml
CODE



Xbox-Hq Auto-Installer v2.0
Created by DJB
240
No
No
No
False
False



False
192.168.0.2
255.255.255.0
192.168.0.100
0.0.0.0
0.0.0.0



21
False
\

xbox
xbox
\




True
False
3
/
1
:
False
False
False
False
Highest
True
128.252.19.1




menu.xml
CODE


;------------------
;### Format HDD ###
;------------------

Format HDD
Format Large HDDCallfile D:\Scripts\Format\large.xas
Format Retail HDDCallfile D:\Scripts\Format\retail.xas

Format CCallfile D:\Scripts\Format\c.xas
Format ECallfile D:\Scripts\Format\e.xas
Format FCallfile D:\Scripts\Format\f.xas
Format GCallfile D:\Scripts\Format\g.xas

Format CacheCallfile D:\Scripts\Format\cache.xas


;-------------------
;### Prepare HDD ###
;-------------------

Prepare HDD
Prepare E DriveCallfile D:\Scripts\Prepare\e.xas
Prepare F DriveCallfile D:\Scripts\Prepare\f.xas
Prepare G DriveCallfile D:\Scripts\Prepare\g.xas


;--------------------------
;### Install Dashboards ###
;--------------------------

Install Dashboards
Install MS DashCallfile D:\Scripts\Dash\ms.xas

;### C Drive Installs ###
;------------------------
C Drive Dashboards

Install Avalaunch
Retail DriveCallfile D:\Scripts\Dash\Avalaunch\c\e.xas
Large DriveCallfile D:\Scripts\Dash\Avalaunch\c\f.xas
Larger DriveCallfile D:\Scripts\Dash\Avalaunch\c\g.xas


Install EvoX 3921
Retail DriveCallfile D:\Scripts\Dash\EvoX3921\c\e.xas
Large DriveCallfile D:\Scripts\Dash\EvoX3921\c\f.xas
Larger DriveCallfile D:\Scripts\Dash\EvoX3921\c\g.xas


Install EvoX 3935
Retail DriveCallfile D:\Scripts\Dash\EvoX3935\c\e.xas
Large DriveCallfile D:\Scripts\Dash\EvoX3935\c\f.xas
Larger DriveCallfile D:\Scripts\Dash\EvoX3935\c\g.xas


Install Media X Menu
Retail DriveCallfile D:\Scripts\Dash\MXM\c\e.xas
Large DriveCallfile D:\Scripts\Dash\MXM\c\f.xas
Larger DriveCallfile D:\Scripts\Dash\MXM\c\g.xas


Install UnleashX
Retail DriveCallfile D:\Scripts\Dash\UnleashX\c\e.xas
Large DriveCallfile D:\Scripts\Dash\UnleashX\c\f.xas
Larger DriveCallfile D:\Scripts\Dash\UnleashX\c\g.xas


Install XBMC
Retail DriveCallfile D:\Scripts\Dash\XBMC\c\e.xas
Large DriveCallfile D:\Scripts\Dash\XBMC\c\f.xas
Larger DriveCallfile D:\Scripts\Dash\XBMC\c\g.xas




;### F Drive Installs ###
;------------------------
F Drive Dashboards

Install Avalaunch
Large DriveCallfile D:\Scripts\Dash\Avalaunch\f\f.xas
Larger DriveCallfile D:\Scripts\Dash\Avalaunch\f\g.xas


Install EvoX 3921
Large DriveCallfile D:\Scripts\Dash\EvoX3921\f\f.xas
Larger DriveCallfile D:\Scripts\Dash\EvoX3921\f\g.xas


Install EvoX 3935
Large DriveCallfile D:\Scripts\Dash\EvoX3935\f\f.xas
Larger DriveCallfile D:\Scripts\Dash\EvoX3935\f\g.xas


Install Media X Menu
Large DriveCallfile D:\Scripts\Dash\MXM\f\f.xas
Larger DriveCallfile D:\Scripts\Dash\MXM\f\g.xas


Install UnleashX
Large DriveCallfile D:\Scripts\Dash\UnleashX\f\f.xas
Larger DriveCallfile D:\Scripts\Dash\UnleashX\f\g.xas


Install XBMC
Large DriveCallfile D:\Scripts\Dash\XBMC\f\f.xas
Larger DriveCallfile D:\Scripts\Dash\XBMC\f\g.xas






;--------------------------
;### Tools and Settings ###
;--------------------------

Tools and Settings
boXplorerD:\Files\Apps\boXplorer\boXplorer\default.xbe
ConfigMagicD:\Files\Apps\ConfigMagic\ConfigMagic\default.xbe




c.xas (Format C Drive)
CODE
Callscript _DisplayMessageBox "Press A to continue, or any other button to exit..."
If %_GP_A% == "1" GOTO HDDFormatC
Quit
:HDDFormatC
BeginDraw UseCurrent
MessageBox "Formatting, Please Wait..."
EndDraw
AllowFormat 1
Format C:
AllowFormat 0
Quit


f.xas (Prepare F Drive with blank folders)
CODE
BeginDraw UseCurrent
MessageBox "Preparing, Please Wait..."
EndDraw
mkdir F:\Apps
mkdir F:\Apps\Emulators
mkdir F:\Games
mkdir F:\GamesHomebrew
mkdir F:\MP3
mkdir F:\Videos
Quit


g.xas (Install XBMC to F Drive as dash, plus read drives e, f, and g.
CODE
BeginDraw UseCurrent
MessageBox "Installing, Please Wait..."
EndDraw
rmdir F:\media true
rmdir F:\mxmscripts true
rmdir F:\shoutcast true
rmdir F:\skins true
rmdir F:\trainers true
rmdir F:\xbmc true
delete F:\*.ini
delete F:\*.xml
delete F:\evoxdash.xbe
mkdir F:\XBMC
copy D:\Files\Apps\XBMC\XBMC F:\XBMC
rename F:\default.xbe F:\evoxdash.xbe
copy D:\Config\Dash\XBMC\G F:
Quit


Sorry for the weird filenames, but as you can see I have folders structed with various .xas files. Those 3 .xas files are basically what I'm using, just varied in small ways (either different drives or locations). The commands I use are the same...

It would be great is someone experienced in MXM scripting could look at this and possibly find out where I've gone wrong...

Thanks in advance.

DJB  <
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Help With Scripting An Auto-installer
« Reply #1 on: October 07, 2004, 07:03:00 PM »

wink.gif
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Help With Scripting An Auto-installer
« Reply #2 on: October 08, 2004, 09:37:00 AM »

Thats what I was thinking.  <
Logged

DJB

  • Archived User
  • Jr. Member
  • *
  • Posts: 70
Help With Scripting An Auto-installer
« Reply #3 on: October 10, 2004, 08:23:00 AM »

I apologise, I was hoping that a problem might have been obvious...

Basically what happens is when the menu goes to use / load an actionscript, it always says that the actionscript has failed.

Is there any idea why at all?  <
Logged

SumDumGuy3

  • Archived User
  • Newbie
  • *
  • Posts: 48
Help With Scripting An Auto-installer
« Reply #4 on: October 10, 2004, 05:39:00 PM »

Hey DJB,

I couldn't say off hand... I will glance at your code in a few minutes to see. But the more info you can provide the better. i.e. what is the exact message you receive when it "fails"... now as far as you writing an autoinstaller... I wrote one for mxm myself... there are some things you should be aware of/keep in mind... I would be happy to talk to you more about it... just private message me...

Regards,
SDG
 <
Logged

SumDumGuy3

  • Archived User
  • Newbie
  • *
  • Posts: 48
Help With Scripting An Auto-installer
« Reply #5 on: October 10, 2004, 05:52:00 PM »

A couple of suggestions for debugging. When I was writing my scripts for n6, one of the things I did was, if a problem exists in a script, it will not give you any real useful information about what line it failed on or anything, if it is in a xas file.

Try putting the code into an internally defined script and run it. That may point you in the direction.

Also, It could be one or more of the sub scripts. Trying running them all and see if all of them fail or if some of them work. If some work what things are different between them and the ones that don't.

Remark out most of the script until there is very little left to run then run it and unremark little by little until you find which lines made it fail.

Also some tips for scripts... you may find it better to reduce the number of scripts and use variables to help determine the desired action. For example, instead of having 5 format xas files named, formatc.xas, formate.xas, formatf.xas, formatg.xas, just have one xas file named format.xas that looks at the first argument for the drive letter. Then you could call one file with 5 different arguments such as, format.xas c, format.xas e, format.xas f, format.xas g. This is more efficient and it also makes you 5 times less likely to have a bug in one format command that is not in the others...

Anyway, just food for thought... I didn't see anything obvious wrong with your scripts, but I didn't look too close... try my suggestions. If you still cant figure it out post some additional info such as the results of the afforementioned troubleshooting tests...

Regards,
SDG
 <
Logged

DJB

  • Archived User
  • Jr. Member
  • *
  • Posts: 70
Help With Scripting An Auto-installer
« Reply #6 on: October 10, 2004, 07:59:00 PM »

Thanks for your information on that.

What I might do is try and use lesser actionscripts and use the arguments (good idea actually).

One last question, what would be the best way to embed actionscripts, in the menu.xml file? I think I've read somewhere you can also put them in your mxm.xml file, or does this go more in line with putting the menu in mxm.xml aswell?

I appreciate your help, it's gotta be only a few small problems here (more than likely just placement of actionscripts etc), because looking at the scripting I'm doing I can't see any obvious mistakes either.

Cheers!!

DJB  <
Logged

SumDumGuy3

  • Archived User
  • Newbie
  • *
  • Posts: 48
Help With Scripting An Auto-installer
« Reply #7 on: October 10, 2004, 08:31:00 PM »

sure thing man...

As far as the embedded scripts... that was exactly what I meant. When you embed an actionscript into the menu.xml and then launch it, if it was broken, it will still fail, but it will give you more information about the failure and makes a HUGE difference in debugging... You can embed them by using the following:

CODE


   

 TitleName
 SkinName
 SkinPath
   

   
   
;insert scripts code here
   
   
;insert scripts code here
   
   
;insert scripts code here
   
   




Then when you want to use that script, instead of using the CallFile function, use the CallScript function with the name of the function you want to use.

Hope that helps,
SDG

Edit: Sorry, just noticed that you said in the Menu.xml. this would actually go in the mxm.xml and not in the menu.xml. I believe that both the Menu.xml and the MXM.xml can contain menu information. However, as I understand it only the MXM.xml can contain the Config tags which is where the Scripts need to go.



This post has been edited by SumDumGuy3: Oct 11 2004, 03:38 AM <
Logged

DJB

  • Archived User
  • Jr. Member
  • *
  • Posts: 70
Help With Scripting An Auto-installer
« Reply #8 on: October 10, 2004, 08:44:00 PM »

smile.gif

I'll let you know how I go after I redo it all with your recommendations.
Logged