diff options
Diffstat (limited to 'indra/newview/llstartup.cpp')
-rw-r--r-- | indra/newview/llstartup.cpp | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3de0cf80ce..9a6454be33 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2516,7 +2516,7 @@ bool idle_startup() gDebugView->mFastTimerView->setVisible(TRUE); #endif - LLAppViewer::instance()->initMainloopTimeout("Mainloop Init"); + LLAppViewer::instance()->handleLoginComplete(); return TRUE; } @@ -2832,7 +2832,6 @@ void update_app(BOOL mandatory, const std::string& auth_msg) void update_dialog_callback(S32 option, void *userdata) { - std::string update_exe_path; bool mandatory = userdata != NULL; #if !LL_RELEASE_FOR_DOWNLOAD @@ -2875,29 +2874,41 @@ void update_dialog_callback(S32 option, void *userdata) // *TODO constantize this guy LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); + if(LLAppViewer::sUpdaterInfo) + { + delete LLAppViewer::sUpdaterInfo ; + } + LLAppViewer::sUpdaterInfo = new LLAppViewer::LLUpdaterInfo() ; + #if LL_WINDOWS - update_exe_path = gDirUtilp->getTempFilename(); - if (update_exe_path.empty()) + LLAppViewer::sUpdaterInfo->mUpdateExePath = gDirUtilp->getTempFilename(); + if (LLAppViewer::sUpdaterInfo->mUpdateExePath.empty()) { + delete LLAppViewer::sUpdaterInfo ; + LLAppViewer::sUpdaterInfo = NULL ; + // We're hosed, bail LL_WARNS("AppInit") << "LLDir::getTempFilename() failed" << LL_ENDL; LLAppViewer::instance()->forceQuit(); return; } - update_exe_path += ".exe"; + LLAppViewer::sUpdaterInfo->mUpdateExePath += ".exe"; std::string updater_source = gDirUtilp->getAppRODataDir(); updater_source += gDirUtilp->getDirDelimiter(); updater_source += "updater.exe"; LL_DEBUGS("AppInit") << "Calling CopyFile source: " << updater_source - << " dest: " << update_exe_path + << " dest: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; - if (!CopyFileA(updater_source.c_str(), update_exe_path.c_str(), FALSE)) + if (!CopyFileA(updater_source.c_str(), LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), FALSE)) { + delete LLAppViewer::sUpdaterInfo ; + LLAppViewer::sUpdaterInfo = NULL ; + LL_WARNS("AppInit") << "Unable to copy the updater!" << LL_ENDL; LLAppViewer::instance()->forceQuit(); return; @@ -2910,18 +2921,13 @@ void update_dialog_callback(S32 option, void *userdata) gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); }; - std::ostringstream params; - params << "-url \"" << update_url.asString() << "\""; + LLAppViewer::sUpdaterInfo->mParams << "-url \"" << update_url.asString() << "\""; - LL_DEBUGS("AppInit") << "Calling updater: " << update_exe_path << " " << params.str() << LL_ENDL; + LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << " " << LLAppViewer::sUpdaterInfo->mParams.str() << LL_ENDL; //Explicitly remove the marker file, otherwise we pass the lock onto the child process and things get weird. LLAppViewer::instance()->removeMarkerFile(); // In case updater fails - // Use spawn() to run asynchronously - int retval = _spawnl(_P_NOWAIT, update_exe_path.c_str(), update_exe_path.c_str(), params.str().c_str(), NULL); - LL_DEBUGS("AppInit") << "Spawn returned " << retval << LL_ENDL; - #elif LL_DARWIN // if a sim name was passed in via command line parameter (typically through a SLURL) if ( LLURLSimString::sInstance.mSimString.length() ) @@ -2930,19 +2936,19 @@ void update_dialog_callback(S32 option, void *userdata) gSavedSettings.setString( "NextLoginLocation", LLURLSimString::sInstance.mSimString ); }; - update_exe_path = "'"; - update_exe_path += gDirUtilp->getAppRODataDir(); - update_exe_path += "/mac-updater.app/Contents/MacOS/mac-updater' -url \""; - update_exe_path += update_url.asString(); - update_exe_path += "\" -name \""; - update_exe_path += LLAppViewer::instance()->getSecondLifeTitle(); - update_exe_path += "\" &"; - - LL_DEBUGS("AppInit") << "Calling updater: " << update_exe_path << LL_ENDL; - + LLAppViewer::sUpdaterInfo->mUpdateExePath = "'"; + LLAppViewer::sUpdaterInfo->mUpdateExePath += gDirUtilp->getAppRODataDir(); + LLAppViewer::sUpdaterInfo->mUpdateExePath += "/mac-updater.app/Contents/MacOS/mac-updater' -url \""; + LLAppViewer::sUpdaterInfo->mUpdateExePath += update_url.asString(); + LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" -name \""; + LLAppViewer::sUpdaterInfo->mUpdateExePath += LLAppViewer::instance()->getSecondLifeTitle(); + LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" &"; + + LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; + // Run the auto-updater. - system(update_exe_path.c_str()); /* Flawfinder: ignore */ - + system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ + #elif LL_LINUX OSMessageBox("Automatic updating is not yet implemented for Linux.\n" "Please download the latest version from www.secondlife.com.", |