Jump to content


Photo

Help With Scripting An Auto-installer


  • Please log in to reply
8 replies to this topic

#1 DJB

DJB

    X-S Member

  • XS-BANNED
  • Pip
  • 109 posts
  • Location:NSW, Australia
  • Interests:XBOX, PSP, Movies, Music, Web Design
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 07 October 2004 - 08:07 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
<Config>

<Main>
<DiscTitle>XS Filter - Links to Xbox Warez and Torrents ** Auto-Installer v2.0</DiscTitle>
<DiscSubtitle>Created by DJB</DiscSubtitle>
<MoveDelay>240</MoveDelay>
<AllowAutoConfig>No</AllowAutoConfig>
<AllowAutoTitle>No</AllowAutoTitle>
<AllowAutoDescr>No</AllowAutoDescr>
<RemoveDuplicates>False</RemoveDuplicates>
<RemoveInvalid>False</RemoveInvalid>
</Main>

<Network>
<UseDHCP>False</UseDHCP>
<IP>192.168.0.2</IP>
<SubnetMask>255.255.255.0</SubnetMask>
<DefaultGateway>192.168.0.100</DefaultGateway>
<DNS1>0.0.0.0</DNS1>
<DNS2>0.0.0.0</DNS2>
</Network>

<FTPServer>
<ServerPort>21</ServerPort>
<AllowAnon>False</AllowAnon>
<AnonRoot>\</AnonRoot>
<User>
<Name>xbox</Name>
<Password>xbox</Password>
<Root>\</Root>
</User>
</FTPServer>

<Preferences>
<UseCelsius>True</UseCelsius>
<UseEuroNumbers>False</UseEuroNumbers>
<DateFormat>3</DateFormat>
<DateSepChar>/</DateSepChar>
<TimeFormat>1</TimeFormat>
<TimeSepChar>:</TimeSepChar>
<DeepMultiSearch>False</DeepMultiSearch>
<AutoLoadMulti>False</AutoLoadMulti>
<AutoLaunchGame>False</AutoLaunchGame>
<AutoLaunchMovie>False</AutoLaunchMovie>
<FTPPriority>Highest</FTPPriority>
<SynchronizeClock>True</SynchronizeClock>
<TimeServerIP>128.252.19.1</TimeServerIP>
</Preferences>

</Config>


menu.xml
CODE
<Menu>

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

<Submenu><Title>Format HDD</Title>
<Item><Title>Format Large HDD</Title><Action>Callfile D:\Scripts\Format\large.xas</Action></Item>
<Item><Title>Format Retail HDD</Title><Action>Callfile D:\Scripts\Format\retail.xas</Action></Item>

<Item><Title>Format C</Title><Action>Callfile D:\Scripts\Format\c.xas</Action></Item>
<Item><Title>Format E</Title><Action>Callfile D:\Scripts\Format\e.xas</Action></Item>
<Item><Title>Format F</Title><Action>Callfile D:\Scripts\Format\f.xas</Action></Item>
<Item><Title>Format G</Title><Action>Callfile D:\Scripts\Format\g.xas</Action></Item>

<Item><Title>Format Cache</Title><Action>Callfile D:\Scripts\Format\cache.xas</Action></Item>
</Submenu>

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

<Submenu><Title>Prepare HDD</Title>
<Item><Title>Prepare E Drive</Title><Action>Callfile D:\Scripts\Prepare\e.xas</Action></Item>
<Item><Title>Prepare F Drive</Title><Action>Callfile D:\Scripts\Prepare\f.xas</Action></Item>
<Item><Title>Prepare G Drive</Title><Action>Callfile D:\Scripts\Prepare\g.xas</Action></Item>
</Submenu>

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

<Submenu><Title>Install Dashboards</Title>
<Item><Title>Install MS Dash</Title><Action>Callfile D:\Scripts\Dash\ms.xas</Action></Item>

;### C Drive Installs ###
;------------------------
<Submenu><Title>C Drive Dashboards</Title>

<Submenu><Title>Install Avalaunch</Title>
<Item><Title>Retail Drive</Title><Action>Callfile D:\Scripts\Dash\Avalaunch\c\e.xas</Action></Item>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\Avalaunch\c\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\Avalaunch\c\g.xas</Action></Item>
</Submenu>

<Submenu><Title>Install EvoX 3921</Title>
<Item><Title>Retail Drive</Title><Action>Callfile D:\Scripts\Dash\EvoX3921\c\e.xas</Action></Item>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\EvoX3921\c\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\EvoX3921\c\g.xas</Action></Item>
</Submenu>

<Submenu><Title>Install EvoX 3935</Title>
<Item><Title>Retail Drive</Title><Action>Callfile D:\Scripts\Dash\EvoX3935\c\e.xas</Action></Item>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\EvoX3935\c\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\EvoX3935\c\g.xas</Action></Item>
</Submenu>

<Submenu><Title>Install Media X Menu</Title>
<Item><Title>Retail Drive</Title><Action>Callfile D:\Scripts\Dash\MXM\c\e.xas</Action></Item>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\MXM\c\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\MXM\c\g.xas</Action></Item>
</Submenu>

<Submenu><Title>Install UnleashX</Title>
<Item><Title>Retail Drive</Title><Action>Callfile D:\Scripts\Dash\UnleashX\c\e.xas</Action></Item>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\UnleashX\c\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\UnleashX\c\g.xas</Action></Item>
</Submenu>

<Submenu><Title>Install XBMC</Title>
<Item><Title>Retail Drive</Title><Action>Callfile D:\Scripts\Dash\XBMC\c\e.xas</Action></Item>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\XBMC\c\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\XBMC\c\g.xas</Action></Item>
</Submenu>

</Submenu>

;### F Drive Installs ###
;------------------------
<Submenu><Title>F Drive Dashboards</Title>

<Submenu><Title>Install Avalaunch</Title>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\Avalaunch\f\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\Avalaunch\f\g.xas</Action></Item>
</Submenu>

<Submenu><Title>Install EvoX 3921</Title>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\EvoX3921\f\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\EvoX3921\f\g.xas</Action></Item>
</Submenu>

<Submenu><Title>Install EvoX 3935</Title>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\EvoX3935\f\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\EvoX3935\f\g.xas</Action></Item>
</Submenu>

<Submenu><Title>Install Media X Menu</Title>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\MXM\f\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\MXM\f\g.xas</Action></Item>
</Submenu>

<Submenu><Title>Install UnleashX</Title>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\UnleashX\f\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\UnleashX\f\g.xas</Action></Item>
</Submenu>

<Submenu><Title>Install XBMC</Title>
<Item><Title>Large Drive</Title><Action>Callfile D:\Scripts\Dash\XBMC\f\f.xas</Action></Item>
<Item><Title>Larger Drive</Title><Action>Callfile D:\Scripts\Dash\XBMC\f\g.xas</Action></Item>
</Submenu>

</Submenu>

</Submenu>

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

<Submenu><Title>Tools and Settings</Title>
<Item><Title>boXplorer</Title><Exe>D:\Files\Apps\boXplorer\boXplorer\default.xbe</Exe></Item>
<Item><Title>ConfigMagic</Title><Exe>D:\Files\Apps\ConfigMagic\ConfigMagic\default.xbe</Exe></Item>
</Submenu>

</Menu>


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

#2 geniusalz

geniusalz

    Team MXM

  • Head Moderators
  • PipPipPipPipPip
  • 1,827 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:unknown

Posted 08 October 2004 - 02:03 AM

A description of the actual problem would be great, as opposed to just copying all the files onto here. wink.gif

#3 flattspott

flattspott

    X-S Freak

  • Moderator
  • PipPipPipPipPip
  • 1,787 posts
  • Location:Southern California
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 08 October 2004 - 03:26 PM

Thats what I was thinking.

#4 DJB

DJB

    X-S Member

  • XS-BANNED
  • Pip
  • 109 posts
  • Location:NSW, Australia
  • Interests:XBOX, PSP, Movies, Music, Web Design
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 10 October 2004 - 02:12 PM

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?

#5 SumDumGuy3

SumDumGuy3

    X-S Young Member

  • Members
  • Pip
  • 53 posts

Posted 10 October 2004 - 11:28 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


#6 SumDumGuy3

SumDumGuy3

    X-S Young Member

  • Members
  • Pip
  • 53 posts

Posted 10 October 2004 - 11:41 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


#7 DJB

DJB

    X-S Member

  • XS-BANNED
  • Pip
  • 109 posts
  • Location:NSW, Australia
  • Interests:XBOX, PSP, Movies, Music, Web Design
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 11 October 2004 - 01:48 AM

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

#8 SumDumGuy3

SumDumGuy3

    X-S Young Member

  • Members
  • Pip
  • 53 posts

Posted 11 October 2004 - 02:20 AM

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

<Config>
<Main>
 <DiscTitle>TitleName</DiscTitle>
 <LoadSkin>SkinName</LoadSkin>
 <SkinsPath>SkinPath</SkinsPath>
</Main>
<scripts>
<ActionScript Name="ScriptName1">
;insert scripts code here
<ActionScript>
<ActionScript Name="ScriptName2">
;insert scripts code here
<ActionScript>
<ActionScript Name="ScriptName3">
;insert scripts code here
<ActionScript>
</Scripts>
</Config>


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.


Edited by SumDumGuy3, 11 October 2004 - 02:27 AM.


#9 DJB

DJB

    X-S Member

  • XS-BANNED
  • Pip
  • 109 posts
  • Location:NSW, Australia
  • Interests:XBOX, PSP, Movies, Music, Web Design
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 11 October 2004 - 03:44 AM

Thanks once again SumDumGuy3, you don't know how much this has steered me in another direction smile.gif

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users