From 7532df3837907a28775a7b254c71ac4cff77a0ae Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Tue, 20 Mar 2012 11:46:50 +0100 Subject: [PATCH] improved update mechanism + make updating to Beta work --- installer/wad/0001000154484246.tmd | Bin 592 -> 592 bytes source/Prompts/prompt_update.cpp | 18 +++++++++++++++--- updates | 5 ++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/installer/wad/0001000154484246.tmd b/installer/wad/0001000154484246.tmd index 3a7dac539761d0ea212321c5df32c15509fda06a..9809af02dea2dc4d340c1d6db41b7d92c9209388 100644 GIT binary patch delta 30 mcmcb>a)D)o6_Z#7!=zmYTXtP4<2LT!5uH6Rx6f?rHcbGwoYUD^wy=nIxtDdp=9k diff --git a/source/Prompts/prompt_update.cpp b/source/Prompts/prompt_update.cpp index f287f4b..f9c6a5e 100644 --- a/source/Prompts/prompt_update.cpp +++ b/source/Prompts/prompt_update.cpp @@ -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 { diff --git a/updates b/updates index 9e453bc..4fbf63d 100644 --- a/updates +++ b/updates @@ -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):