diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 1ba9141f..07f81670 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -258,6 +258,7 @@ void CMenu::init(void) _load_installed_cioses(); + snprintf(m_app_update_drive, sizeof(m_app_update_drive), "%s:/", drive); m_dataDir = sfmt("%s:/%s", drive, APPDATA_DIR); gprintf("Data Directory: %s\n", m_dataDir.c_str()); diff --git a/source/menu/menu.hpp b/source/menu/menu.hpp index 74398622..d9a34608 100644 --- a/source/menu/menu.hpp +++ b/source/menu/menu.hpp @@ -103,6 +103,7 @@ private: std::string m_listCacheDir; std::string m_DMLgameDir; /* Updates */ + char m_app_update_drive[6]; const char* m_app_update_url; const char* m_data_update_url; std::string m_dol; diff --git a/source/menu/menu_download.cpp b/source/menu/menu_download.cpp index daa85804..cd3f359a 100644 --- a/source/menu/menu_download.cpp +++ b/source/menu/menu_download.cpp @@ -27,7 +27,7 @@ #define TAG_LOC "{loc}" #define TITLES_URL "http://www.gametdb.com/titles.txt?LANG=%s" #define GAMETDB_URL "http://www.gametdb.com/wiitdb.zip?LANG=%s&FALLBACK=TRUE&WIIWARE=TRUE&GAMECUBE=TRUE" -#define UPDATE_URL_VERSION "http://update.wiiflow.org/txt/versions.txt" +#define UPDATE_URL_VERSION "http://dl.dropbox.com/u/25620767/WiiflowMod/versions.txt" using namespace std; @@ -1820,7 +1820,7 @@ s8 CMenu::_versionDownloader() // code to download new version m_thrdStep = 0.2f; m_thrdStepLen = 0.9f - 0.2f; gprintf("App Update URL: %s\n", m_app_update_url); - gprintf("Data Update URL: %s\n", m_app_update_url); + gprintf("Data Update URL: %s\n", m_data_update_url); download = downloadfile(buffer.get(), bufferSize, m_app_update_url, CMenu::_downloadProgress, this); if (download.data == 0 || download.size < m_app_update_size) @@ -1854,7 +1854,7 @@ s8 CMenu::_versionDownloader() // code to download new version LWP_MutexUnlock(m_mutex); ZipFile zFile(m_app_update_zip.c_str()); - bool result = zFile.ExtractAll(m_appDir.c_str()); + bool result = zFile.ExtractAll(m_app_update_drive); remove(m_app_update_zip.c_str()); if (!result) goto fail; diff --git a/source/menu/menu_system.cpp b/source/menu/menu_system.cpp index 463a08d6..e205d49e 100644 --- a/source/menu/menu_system.cpp +++ b/source/menu/menu_system.cpp @@ -78,13 +78,14 @@ void CMenu::_system() m_btnMgr.setProgress(m_downloadPBar, 0.f); m_thrdStop = false; m_thrdWorking = true; - gprintf("\nVersion to DL: %i\n", newIOS); + gprintf("\nVersion to DL: %i\n", newVer); - m_app_update_size = m_version.getInt("GENERAL", "app_zip_size", 0); + if(m_version.getInt("GENERAL", "version", 0) == newVer) + m_app_update_size = m_version.getInt("GENERAL", "app_zip_size", 0); m_data_update_size = m_version.getInt("GENERAL", "data_zip_size", 0); - m_app_update_url = fmt("%s/r%i/%i.zip", m_version.getString("GENERAL", "update_url", "http://update.wiiflow.org").c_str(), newVer, newIOS); - m_data_update_url = fmt("%s/r%i/data.zip", m_version.getString("GENERAL", "update_url", "http://update.wiiflow.org").c_str(), newVer); + m_app_update_url = fmt("%s/Wiiflow_Mod_svn_r%i.zip", m_version.getString("GENERAL", "update_url", "http://open-wiiflow-mod.googlecode.com/files").c_str(), newVer); + m_data_update_url = fmt("%s/r%i/data.zip", m_version.getString("GENERAL", "update_url", "http://open-wiiflow-mod.googlecode.com/files").c_str(), newVer); m_showtimer = 120; LWP_CreateThread(&thread, (void *(*)(void *))CMenu::_versionDownloaderInit, (void *)this, 0, 8192, 40); @@ -111,6 +112,7 @@ void CMenu::_system() { m_btnMgr.setText(m_systemLblVerSelectVal, wstringEx(sfmt("%i", CMenu::_version[i]))); newVer = CMenu::_version[i]; + m_app_update_size = m_version.getInt(sfmt("VERSION%i", i - 1u), "app_zip_size", 0); if (i > 1 && i != num_versions) m_btnMgr.setText(m_systemLblInfo, m_version.getWString(sfmt("VERSION%i", i - 1u), "changes")); else @@ -130,6 +132,7 @@ void CMenu::_system() { m_btnMgr.setText(m_systemLblVerSelectVal, wstringEx(sfmt("%i", CMenu::_version[i]))); newVer = CMenu::_version[i]; + m_app_update_size = m_version.getInt(sfmt("VERSION%i", i - 1u), "app_zip_size", 0); if (i > 1 && i != num_versions) m_btnMgr.setText(m_systemLblInfo, m_version.getWString(sfmt("VERSION%i", i - 1u), "changes")); else @@ -249,7 +252,7 @@ void CMenu::_textSystem(void) { m_btnMgr.setText(m_systemLblTitle, _t("sys1", L"Update WiiFlow")); m_btnMgr.setText(m_systemLblVersionTxt, _t("sys2", L"WiiFlow Version:")); - m_btnMgr.setText(m_systemLblVersion, wfmt(L"(%s-r%s)", APP_VERSION, SVN_REV).c_str()); + m_btnMgr.setText(m_systemLblVersion, wfmt(L"r%s", SVN_REV).c_str()); m_btnMgr.setText(m_systemBtnBack, _t("sys3", L"Cancel")); m_btnMgr.setText(m_systemBtnDownload, _t("sys4", L"Upgrade")); i = min((u32)version_num, ARRAY_SIZE(CMenu::_version) -1u);