Welcome! Log In Create A New Profile

Advanced

Idea for a file downloader

Posted by BionicSonic 
Idea for a file downloader
October 19, 2009 12:18AM
I'm trying to make a Brawl+ Installer for Homebrew, as opposed to my creation of a Brawl+ Installer for Windows/Mac. (If you don't know what B+ is, it's a project that modifies Brawl to be more like the Smash formula by way of using Gecko OS and Project SA) Most of the community would prefer a Homebrew downloader as opposed to using a computer to get it... but I know little about C++ to start on it, and my program is coded primarily in PHP. Are there some examples or can someone make this?

Here's how the program currently works:

- The end user selects what their SD card letter is (E, F, G, etc). This should be removed in the Homebrew program
- If it finds sd:/codes/RSBE01.gct, ask them if they want to overwrite their GCT. A is Yes, B is No. If it's no, rename it to RSBE02.gct
- If we have no internet, make sure all files are in the "brawlplus" directory for offline install.
- Make ALL of the required directories before the actual install is.
- Retrieve [brawlplus.net] and put it into memory. If the first line is a +, move on with the program. If it's a -, then exit since it's an old version.
- Split the file by lines, then split by a colon. Example:
fighter/marth/FitMarth.pac:private/wii/app/RSBE/pf/fighter/marth/FitMarth.pac:ead23a155e3a5605563eb7e9cb019416
fighter/marth/FitMarth.pac is where it's downloading from, e.g. [brawlplus.net]
private/wii/app/RSBE/pf/fighter/marth/FitMarth.pac is where it's downloading to
ead23a155e3a5605563eb7e9cb019416 is the MD5 hash of FitMarth.pac.
- If FitMarth.pac exists, check its MD5 sum and see if it matches. If it does, skip it. Otherwise, download it (with a percentage meter)
- In the homebrew app, when the files are done being checked/downloaded, launch "gecko.dol" or "gecko.elf" aka Gecko OS and launch the game.
Re: Idea for a file downloader
October 19, 2009 01:20PM
Wow! I would like this app. I actually suggested it yesterday on the B+ IRC.

I guess you could check the netsend example and the HTTP download example located at the downmost place on this page: [wiibrew.org].

If you want to learn C++ from scratch i suggest this page: [newdata.box.sk].

Also, to learn to program for the Wii from scratch i suggest: [www.codemii.com].

Good luck!
Re: Idea for a file downloader
October 20, 2009 01:28AM
Now... this interests me. I'll see if I can get anywhere with it.
Edit: I hate networking again. Will try again tomorrow.



Edited 1 time(s). Last edit at 10/20/2009 04:21AM by PhoenixTank.
Re: Idea for a file downloader
October 21, 2009 01:34AM
It'd be awesome if you can do it, certainly good for me too since I'm still learning C++.

profetylen: the HTTP download example ends in a ld -lpng missing error upon compiling in devkitpro, I'm not sure what that means



Edited 1 time(s). Last edit at 10/21/2009 01:34AM by BionicSonic.
Re: Idea for a file downloader
October 21, 2009 05:38AM
I figure that means you don't have libpng installed, which would seem odd.
Haven't had a chance to try again today, but I am having issues getting the HTTP request to return anything other than the standard "cPanel/Apache installed" from my shared hosting... which I find to be bizarre... given that I'm connecting to the correct IP and using a valid host header. If anyone drops by this thread and has any idea why this is, please let me know.
Re: Idea for a file downloader
October 21, 2009 09:03AM
i have almost got this finished but i don't know what URLs need to be DLed. the link leads to a page not found. any chance of a full list of urls?

EDIT>>>>>>>
Ok, well aside from the broken URLs, I have a fully functional program. It isn't much to look at, just a black screen with white text buzzing by, but it gets the job done....

Start the WiFi and SD card
Download the php with the file list
parse the list and turn it into usable text strings
check for files on the list against those in the SD card
verify MD5
download a file if needed and check the hash again
create any necessary directories before saving a file
look for the boot.elf in the default location and try to boot it

there are currently no pauses and the text goes by really fast, but it can be captured with a USB gecko to read. right now every time i try to DL i file, i get the same "page not found" so that gets saved for all 43 on the list (hence all my files have the same MD5). the whole process takes about 45 seconds to right now. it should take longer though when it is getting more than 3KB "page not found" for every file.

here is the captured output so far... [pastie.org]

if somebody wants to hook it up with the URL list, ill slap a little pretty on it and send it out.



Edited 1 time(s). Last edit at 10/21/2009 05:38PM by giantpune.
Re: Idea for a file downloader
October 21, 2009 07:46PM
Quote
PhoenixTank
I figure that means you don't have libpng installed, which would seem odd.
Haven't had a chance to try again today, but I am having issues getting the HTTP request to return anything other than the standard "cPanel/Apache installed" from my shared hosting... which I find to be bizarre... given that I'm connecting to the correct IP and using a valid host header. If anyone drops by this thread and has any idea why this is, please let me know.
The trick with downloading from this server is using:

GET [brawlplus.net] HTTP/1.1
Host: www.brawlplus.net
Connection: close

at least I think. but the GET line has to have the full URL too because its sharing a site with others.

Quote
giantpune
i have almost got this finished but i don't know what URLs need to be DLed. the link leads to a page not found. any chance of a full list of urls?

EDIT>>>>>>>
Ok, well aside from the broken URLs, I have a fully functional program. It isn't much to look at, just a black screen with white text buzzing by, but it gets the job done....

Start the WiFi and SD card
Download the php with the file list
parse the list and turn it into usable text strings
check for files on the list against those in the SD card
verify MD5
download a file if needed and check the hash again
create any necessary directories before saving a file
look for the boot.elf in the default location and try to boot it

there are currently no pauses and the text goes by really fast, but it can be captured with a USB gecko to read. right now every time i try to DL i file, i get the same "page not found" so that gets saved for all 43 on the list (hence all my files have the same MD5). the whole process takes about 45 seconds to right now. it should take longer though when it is getting more than 3KB "page not found" for every file.

Everything is "page not found"? o_O

download list: [brawlplus.net]
FitCaptain.pac: [brawlplus.net]
etc.

edit: I know why you're getting the Page Not Found...I forgot to include an "s" in "downloads" in the first post.

brawlplus.net/downloads/fighter/ness/FitNess.pac
^ correct example link



Edited 1 time(s). Last edit at 10/21/2009 08:15PM by BionicSonic.
Re: Idea for a file downloader
October 22, 2009 09:27AM
ok, well it works fine now with the s in the urls. but the background.png always fails the hash check. Even when i DL the file with firefox, the hash doesn't match the one in the php.

What are the default locations for geckoOS versions that work with brawl+? I already have SD:/apps/Gecko192/boot.elf, but im guessing that there are others as well.

here's what i have so far [www.mediafire.com]
and once youtube gets done messing around, a video... [www.youtube.com]

now it just needs a little pretty on it and its good.



Edited 1 time(s). Last edit at 10/22/2009 12:09PM by giantpune.
Re: Idea for a file downloader
October 22, 2009 06:18PM
As I said on Smashboards, you have no idea how thankful I am for your program giantpune! We just need an icon and meta data then I can release it on brawlplus.net... (and I know just the person to nag for an icon) That is, of course, if I can get your permission?

One thing that I do wish to see...I don't have "boot.elf" because I don't have Gecko 1.9.2, but is there a way to launch "gecko.elf" in the same directory instead? So you can put whichever Gecko you prefer?

Thanks again!!!
Re: Idea for a file downloader
October 22, 2009 06:51PM
I guess I have one last request...can you release the source for it after you're done perfecting it? I might want to add in PAL support and Snapshot support too for those people :) (I know enough C++ for that thankfully)
Re: Idea for a file downloader
October 22, 2009 06:57PM
right now im slapping a gui in there and some simple user input (like renaming old files with a on screen keyboard). but when im happy with it, you can have the source. it is made from a lot of gpl2 code, so im sticking with that.
Re: Idea for a file downloader
October 22, 2009 09:47PM
Cool, most casual users don't own a Wii USB keyboard, so I'm not sure what the point of it is o_O but thanks!
Re: Idea for a file downloader
October 22, 2009 11:22PM
That's why he's putting in an On Screen Keyboard.
Re: Idea for a file downloader
October 23, 2009 01:58AM
Ah, didn't read that, sorry...
Re: Idea for a file downloader
October 23, 2009 11:00AM
Ok, well I have a 95% functional GUI going now, but i just used some images i had laying around on my PC. is there a place with a bunch of brawl+ images i could grab from and spice this upwith?
Re: Idea for a file downloader
October 23, 2009 07:52PM
I'll ask around for some images, and update this post when I have it. What specifically do you need, like a Brawl+ logo or something more?

edit:






more coming later



Edited 1 time(s). Last edit at 10/23/2009 08:25PM by BionicSonic.
Re: Idea for a file downloader
October 24, 2009 07:29AM
Ok, here's where I am right now... [www.youtube.com]
I just have a couple minor things to mess with and some code cleanup but I think what I have will work for now. Mainly im looking for some rockin music as it just plays the annoying system menu tune now.
Re: Idea for a file downloader
October 24, 2009 09:26AM
If you really need some good music I recommend this: [www.youtube.com] (0:31 and beyond)

That GUI is SICK! It's 100000000x better than what I thought it'd be! Plus the Update and Play buttons are too good.
Re: Idea for a file downloader
October 24, 2009 10:34AM
im not too fond of that techno music. It makes me want to take a handful of beans and whip out the glowsticks. Anyways, try this out and see if everything works for you [www.mediafire.com] . I have disabled the gecko output and I think the button sounds might be only coming from 1 side of the stereo. It was a biatch with all the cables from my Wii to my PC and trying to figure out what audio settings I needed to have in adobe. I think I recorded the button press like 20 times before I finally got one that would play on the Wii without killing the BG music. If everything is working like it should, I'll pack it up and ship it out.
Re: Idea for a file downloader
October 24, 2009 11:27AM
WOW!!! This is totally amizingly good-lookingly and user-friendlily perfect!!! Congratulations to a fantastic job!

My only suggestion is that you make the background console colour a little bit darker as it is now a little bit hard to read the text while updating.

Anyway, as I said; This is amazingly good looking!!!!
Sorry, only registered users may post in this forum.

Click here to login