improved update mechanism + make updating to Beta work

This commit is contained in:
Christopher Roy Bratusek 2012-03-20 11:46:50 +01:00
parent a298865ece
commit 7532df3837
3 changed files with 19 additions and 4 deletions

Binary file not shown.

View File

@ -101,7 +101,10 @@ updatePrompt(string rev)
ResumeGui();
char url[100];
sprintf(url, "http://download.tuxfamily.org/hbf/DOL/rev%s/boot.dol", rev.c_str());
if(rev == "Beta")
sprintf(url, "http://download.tuxfamily.org/hbf/DOL/Beta/boot.dol");
else
sprintf(url, "http://download.tuxfamily.org/hbf/DOL/rev%s/boot.dol", rev.c_str());
// copy boot.dol to prev.dol
std::ifstream infile((Settings.device_dat + ":/apps/HomebrewFilter/boot.dol").c_str(), std::ios_base::binary);
@ -112,10 +115,19 @@ updatePrompt(string rev)
struct block file = downloadfile(url);
if (file.data && file.size > 0)
{
CopyHomebrewMemory(file.data, 0, file.size);
// write file
FILE * data = fopen((Settings.device_dat + ":/apps/HomebrewFilter/boot.dol").c_str(), "wb");
if(data)
{
fwrite(file.data, 1, file.size, data);
fclose(data);
}
if(file.data)
free(file.data);
boot_buffer = true;
LoadHomebrew ((Settings.device_dat + ":/apps/HomebrewFilter/boot.dol").c_str());
BootHomebrew ();
}
else
{

View File

@ -1,5 +1,8 @@
//rev37:
- before updating copy the old boot.dol to prev.dol
- improved update-mechanism:
* copy the old boot.dol to prev.dol
* save the downloaded file rather than loading from RAM
* BUGFIX: make downloading a Beta version work
- BUGFIX: installer no longer crashes when IOS253 exists
- ISO253 is no more selectable as IOS to load an app with
- added a new loader-menu (allows to enter special loaders):