diff options
Diffstat (limited to 'indra/newview')
20 files changed, 271 insertions, 1276 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 62451e4856..821f46edd2 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -16,6 +16,7 @@ include(GLOD) include(Hunspell) include(JsonCpp) include(LLAppearance) +include(LLBase) include(LLAudio) include(LLCharacter) include(LLCommon) @@ -42,10 +43,12 @@ include(OPENAL) include(OpenGL) include(OpenSSL) include(PNG) +include(Requests) include(TemplateCheck) include(UI) include(UnixInstall) include(ViewerMiscLibs) +include(ViewerManager) include(VisualLeakDetector) include(ZLIB) include(URIPARSER) @@ -81,7 +84,6 @@ include_directories( ${LLWINDOW_INCLUDE_DIRS} ${LLXML_INCLUDE_DIRS} ${LLLOGIN_INCLUDE_DIRS} - ${UPDATER_INCLUDE_DIRS} ${LIBS_PREBUILT_DIR}/include/collada ${LIBS_PREBUILD_DIR}/include/hunspell ${OPENAL_LIB_INCLUDE_DIRS} @@ -1906,7 +1908,6 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${PNG_PRELOAD_ARCHIVES} ${ZLIB_PRELOAD_ARCHIVES} ${URIPARSER_PRELOAD_ARCHIVES} - ${UPDATER_LIBRARIES} ${GOOGLE_PERFTOOLS_LIBRARIES} ${LLAUDIO_LIBRARIES} ${LLCHARACTER_LIBRARIES} @@ -2027,6 +2028,8 @@ endif (LINUX) if (DARWIN) # These all get set with PROPERTIES set(product "Second Life") + # this is the setting for the Python wrapper, see SL-322 and WRAPPER line in Info-SecondLife.plist + set(MACOSX_WRAPPER_EXECUTABLE_NAME "SL_Launcher") set(MACOSX_BUNDLE_INFO_STRING "Second Life Viewer") set(MACOSX_BUNDLE_ICON_FILE "secondlife.icns") set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.secondlife.indra.viewer") diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index 9b8136a827..8aabd6818b 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -5,7 +5,7 @@ <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> - <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string> + <string>${MACOSX_WRAPPER_EXECUTABLE_NAME}</string> <key>CFBundleGetInfoString</key> <string>${MACOSX_BUNDLE_INFO_STRING}</string> <key>CFBundleIconFile</key> diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 71a33a0dc0..1377cd7f21 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -105,6 +105,7 @@ Page instfiles ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Var INSTPROG
Var INSTEXE
+Var VIEWER_EXE
Var INSTSHORTCUT
Var COMMANDLINE # Command line passed to this installer, set in .onInit
Var SHORTCUT_LANG_PARAM # "--set InstallLanguage de", Passes language to viewer
@@ -299,7 +300,7 @@ StrCpy $SHORTCUT_LANG_PARAM "--set InstallLanguage $(LanguageCode)" CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT"
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \
- "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
+ "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "%%SOURCE%%\icons\release\secondlife.ico"
WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Create Account.url" \
@@ -317,15 +318,15 @@ CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \ # Other shortcuts
SetOutPath "$INSTDIR"
CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" \
- "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
+ "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "%%SOURCE%%\icons\release\secondlife.ico"
CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" \
- "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM"
+ "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "%%SOURCE%%\icons\release\secondlife.ico"
CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \
'"$INSTDIR\uninst.exe"' ''
-# Create *.bat file to specify lang params on first run from installer - see MAINT-5259
+# Create *.bat file to specify lang params on first run from installer - see MAINT-5259S
FileOpen $9 "$INSTDIR\autorun.bat" w
-FileWrite $9 'start "$INSTDIR\$INSTEXE" "$INSTDIR\$INSTEXE" $SHORTCUT_LANG_PARAM$\r$\n'
+FileWrite $9 'start "$INSTDIR\$INSTEXE" /d "$INSTDIR" "$INSTDIR\$INSTEXE" $SHORTCUT_LANG_PARAM$\r$\n'
FileClose $9
# Write registry
@@ -362,6 +363,10 @@ WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$ # URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks.
WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$INSTEXE" -url "%1"'
+# Only allow Launcher to be the icon
+WriteRegStr HKEY_CLASSES_ROOT "Applications\$INSTEXE" "IsHostApp" ""
+WriteRegStr HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" "NoStartPage" ""
+
# Write out uninstaller
WriteUninstaller "$INSTDIR\uninst.exe"
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a26ee2204b..0f3a889007 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -93,7 +93,6 @@ #include "llvocache.h" #include "llvopartgroup.h" #include "llweb.h" -#include "llupdaterservice.h" #include "llfloatertexturefetchdebugger.h" #include "llspellcheck.h" #include "llscenemonitor.h" @@ -268,7 +267,6 @@ static LLAppViewerListener sAppViewerListener(LLAppViewer::instance); // viewer.cpp - these are only used in viewer, should be easily moved. #if LL_DARWIN -const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.indra.viewer"; extern void init_apple_menu(const char* product); #endif // LL_DARWIN @@ -294,9 +292,7 @@ S32 gLastExecDuration = -1; // (<0 indicates unknown) # define LL_PLATFORM_KEY "mac" #elif LL_LINUX # define LL_PLATFORM_KEY "lnx" -#elif LL_SOLARIS -# define LL_PLATFORM_KEY "sol" -#else +else # error "Unknown Platform" #endif const char* gPlatform = LL_PLATFORM_KEY; @@ -473,8 +469,6 @@ struct SettingsFiles : public LLInitParam::Block<SettingsFiles> static std::string gWindowTitle; -LLAppViewer::LLUpdaterInfo *LLAppViewer::sUpdaterInfo = NULL ; - //---------------------------------------------------------------------------- // Metrics logging control constants //---------------------------------------------------------------------------- @@ -701,7 +695,6 @@ LLAppViewer::LLAppViewer() mRandomizeFramerate(LLCachedControl<bool>(gSavedSettings,"Randomize Framerate", FALSE)), mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", FALSE)), mFastTimerLogThread(NULL), - mUpdater(new LLUpdaterService()), mSettingsLocationList(NULL), mIsFirstRun(false) { @@ -731,7 +724,6 @@ LLAppViewer::LLAppViewer() // OK to write stuff to logs now, we've now crash reported if necessary // - LLLoginInstance::instance().setUpdaterService(mUpdater.get()); LLLoginInstance::instance().setPlatformInfo(gPlatform, getOSInfo().getOSVersionString()); } @@ -885,14 +877,6 @@ bool LLAppViewer::init() writeSystemInfo(); - // Initialize updater service (now that we have an io pump) - initUpdater(); - if(isQuitting()) - { - // Early out here because updater set the quitting flag. - return true; - } - ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// @@ -2905,229 +2889,6 @@ void LLAppViewer::initStrings() } } -namespace { - // *TODO - decide if there's a better place for these functions. - // do we need a file llupdaterui.cpp or something? -brad - - void apply_update_callback(LLSD const & notification, LLSD const & response) - { - LL_DEBUGS() << "LLUpdate user response: " << response << LL_ENDL; - if(response["OK_okcancelbuttons"].asBoolean()) - { - LL_INFOS() << "LLUpdate restarting viewer" << LL_ENDL; - static const bool install_if_ready = true; - // *HACK - this lets us launch the installer immediately for now - LLUpdaterService().startChecking(install_if_ready); - } - } - - void apply_update_ok_callback(LLSD const & notification, LLSD const & response) - { - LL_INFOS() << "LLUpdate restarting viewer" << LL_ENDL; - static const bool install_if_ready = true; - // *HACK - this lets us launch the installer immediately for now - LLUpdaterService().startChecking(install_if_ready); - } - - void on_update_downloaded(LLSD const & data) - { - std::string notification_name; - void (*apply_callback)(LLSD const &, LLSD const &) = NULL; - - /* Build up the notification name... - * it can be any of these, which are included here for the sake of grep: - * RequiredUpdateDownloadedDialog - * RequiredUpdateDownloadedVerboseDialog - * OtherChannelRequiredUpdateDownloadedDialog - * OtherChannelRequiredUpdateDownloadedVerbose - * DownloadBackgroundTip - * DownloadBackgroundDialog - * OtherChannelDownloadBackgroundTip - * OtherChannelDownloadBackgroundDialog - */ - { - LL_DEBUGS("UpdaterService") << "data = "; - std::ostringstream data_dump; - LLSDSerialize::toNotation(data, data_dump); - LL_CONT << data_dump.str() << LL_ENDL; - } - if(data["channel"].asString() != LLVersionInfo::getChannel()) - { - notification_name.append("OtherChannel"); - } - if(data["required"].asBoolean()) - { - if(LLStartUp::getStartupState() <= STATE_LOGIN_WAIT) - { - // The user never saw the progress bar. - apply_callback = &apply_update_ok_callback; - notification_name += "RequiredUpdateDownloadedVerboseDialog"; - } - else if(LLStartUp::getStartupState() < STATE_WORLD_INIT) - { - // The user is logging in but blocked. - apply_callback = &apply_update_ok_callback; - notification_name += "RequiredUpdateDownloadedDialog"; - } - else - { - // The user is already logged in; treat like an optional update. - apply_callback = &apply_update_callback; - notification_name += "DownloadBackgroundTip"; - } - } - else - { - apply_callback = &apply_update_callback; - if(LLStartUp::getStartupState() < STATE_STARTED) - { - // CHOP-262 we need to use a different notification - // method prior to login. - notification_name += "DownloadBackgroundDialog"; - } - else - { - notification_name += "DownloadBackgroundTip"; - } - } - - LLSD substitutions; - substitutions["VERSION"] = data["version"]; - std::string new_channel = data["channel"].asString(); - substitutions["NEW_CHANNEL"] = new_channel; - std::string info_url = data["info_url"].asString(); - if ( !info_url.empty() ) - { - substitutions["INFO_URL"] = info_url; - } - else - { - LL_WARNS("UpdaterService") << "no info url supplied - defaulting to hard coded release notes pattern" << LL_ENDL; - - // truncate version at the rightmost '.' - std::string version_short(data["version"]); - size_t short_length = version_short.rfind('.'); - if (short_length != std::string::npos) - { - version_short.resize(short_length); - } - - LLUIString relnotes_url("[RELEASE_NOTES_BASE_URL][CHANNEL_URL]/[VERSION_SHORT]"); - relnotes_url.setArg("[VERSION_SHORT]", version_short); - - // *TODO thread the update service's response through to this point - std::string const & channel = LLVersionInfo::getChannel(); - boost::shared_ptr<char> channel_escaped(curl_escape(channel.c_str(), channel.size()), &curl_free); - - relnotes_url.setArg("[CHANNEL_URL]", channel_escaped.get()); - relnotes_url.setArg("[RELEASE_NOTES_BASE_URL]", LLTrans::getString("RELEASE_NOTES_BASE_URL")); - substitutions["INFO_URL"] = relnotes_url.getString(); - } - - LLNotificationsUtil::add(notification_name, substitutions, LLSD(), apply_callback); - } - - void install_error_callback(LLSD const & notification, LLSD const & response) - { - LLAppViewer::instance()->forceQuit(); - } - - bool notify_update(LLSD const & evt) - { - std::string notification_name; - switch (evt["type"].asInteger()) - { - case LLUpdaterService::DOWNLOAD_COMPLETE: - on_update_downloaded(evt); - break; - case LLUpdaterService::INSTALL_ERROR: - if(evt["required"].asBoolean()) { - LLNotificationsUtil::add("FailedRequiredUpdateInstall", LLSD(), LLSD(), &install_error_callback); - } else { - LLNotificationsUtil::add("FailedUpdateInstall"); - } - break; - default: - break; - } - - // let others also handle this event by default - return false; - } - - bool on_bandwidth_throttle(LLUpdaterService * updater, LLSD const & evt) - { - updater->setBandwidthLimit(evt.asInteger() * (1024/8)); - return false; // Let others receive this event. - }; -}; - -void LLAppViewer::initUpdater() -{ - // Initialize the updater service. - // Get Channel - // Get Version - - /***************************************************************** - * Previously, the url was derived from the settings - * UpdaterServiceURL - * UpdaterServicePath - * it is now obtained from the grid manager. The settings above - * are no longer used. - *****************************************************************/ - std::string channel = LLVersionInfo::getChannel(); - std::string version = LLVersionInfo::getVersion(); - - U32 check_period = gSavedSettings.getU32("UpdaterServiceCheckPeriod"); - bool willing_to_test; - LL_DEBUGS("UpdaterService") << "channel " << channel << LL_ENDL; - - if (LLVersionInfo::TEST_VIEWER == LLVersionInfo::getViewerMaturity()) - { - LL_INFOS("UpdaterService") << "Test build: overriding willing_to_test by sending testno" << LL_ENDL; - willing_to_test = false; - } - else - { - willing_to_test = gSavedSettings.getBOOL("UpdaterWillingToTest"); - } - unsigned char unique_id[MD5HEX_STR_SIZE]; - if ( ! llHashedUniqueID(unique_id) ) - { - if ( willing_to_test ) - { - LL_WARNS("UpdaterService") << "Unable to provide a unique id; overriding willing_to_test by sending testno" << LL_ENDL; - } - willing_to_test = false; - } - - mUpdater->setAppExitCallback(boost::bind(&LLAppViewer::forceQuit, this)); - mUpdater->initialize(channel, - version, -// DRTVWR-418 transitional: query using "win64" until VMP is in place -#if LL_WINDOWS && (ADDRESS_SIZE == 64) - "win64", -#else - gPlatform, -#endif - getOSInfo().getOSVersionString(), - unique_id, - willing_to_test - ); - mUpdater->setCheckPeriod(check_period); - mUpdater->setBandwidthLimit((int)gSavedSettings.getF32("UpdaterMaximumBandwidth") * (1024/8)); - gSavedSettings.getControl("UpdaterMaximumBandwidth")->getSignal()-> - connect(boost::bind(&on_bandwidth_throttle, mUpdater.get(), _2)); - if(gSavedSettings.getU32("UpdaterServiceSetting")) - { - bool install_if_ready = true; - mUpdater->startChecking(install_if_ready); - } - - LLEventPump & updater_pump = LLEventPumps::instance().obtain(LLUpdaterService::pumpName()); - updater_pump.listen("notify_update", ¬ify_update); -} - // // This function decides whether the client machine meets the minimum requirements to // run in a maximized window, per the consensus of davep, boa and nyx on 3/30/2011. @@ -5743,142 +5504,6 @@ void LLAppViewer::handleLoginComplete() mSavePerAccountSettings=true; } -void LLAppViewer::launchUpdater() -{ - LLSD query_map = LLSD::emptyMap(); - query_map["os"] = gPlatform; - - // *TODO change userserver to be grid on both viewer and sim, since - // userserver no longer exists. - query_map["userserver"] = LLGridManager::getInstance()->getGridId(); - query_map["channel"] = LLVersionInfo::getChannel(); - // *TODO constantize this guy - // *NOTE: This URL is also used in win_setup/lldownloader.cpp - LLURI update_url = LLURI::buildHTTP("secondlife.com", 80, "update.php", query_map); - - if(LLAppViewer::sUpdaterInfo) - { - delete LLAppViewer::sUpdaterInfo; - } - LLAppViewer::sUpdaterInfo = new LLAppViewer::LLUpdaterInfo() ; - - // if a sim name was passed in via command line parameter (typically through a SLURL) - if ( LLStartUp::getStartSLURL().getType() == LLSLURL::LOCATION ) - { - // record the location to start at next time - gSavedSettings.setString( "NextLoginLocation", LLStartUp::getStartSLURL().getSLURLString()); - }; - -#if LL_WINDOWS - 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; - return; - } - - 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: " << LLAppViewer::sUpdaterInfo->mUpdateExePath - << LL_ENDL; - - - 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; - - return; - } - - LLAppViewer::sUpdaterInfo->mParams << "-url \"" << update_url.asString() << "\""; - - 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()->removeMarkerFiles(); // In case updater fails - - // *NOTE:Mani The updater is spawned as the last thing before the WinMain exit. - // see LLAppViewerWin32.cpp - -#elif LL_DARWIN - 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 += "\" -bundleid \""; - LLAppViewer::sUpdaterInfo->mUpdateExePath += LL_VERSION_BUNDLE_ID; - LLAppViewer::sUpdaterInfo->mUpdateExePath += "\" &"; - - LL_DEBUGS("AppInit") << "Calling updater: " << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; - - // Run the auto-updater. - system(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str()); /* Flawfinder: ignore */ - -#elif (LL_LINUX || LL_SOLARIS) && LL_GTK - // we tell the updater where to find the xml containing string - // translations which it can use for its own UI - std::string xml_strings_file = "strings.xml"; - std::vector<std::string> xui_path_vec = - gDirUtilp->findSkinnedFilenames(LLDir::XUI, xml_strings_file); - std::string xml_search_paths; - const char* delim = ""; - // build comma-delimited list of xml paths to pass to updater - BOOST_FOREACH(std::string this_skin_path, xui_path_vec) - { - // Although we already have the full set of paths with the filename - // appended, the linux-updater.bin command-line switches require us to - // snip the filename OFF and pass it as a separate switch argument. :-P - LL_INFOS() << "Got a XUI path: " << this_skin_path << LL_ENDL; - xml_search_paths.append(delim); - xml_search_paths.append(gDirUtilp->getDirName(this_skin_path)); - delim = ","; - } - // build the overall command-line to run the updater correctly - LLAppViewer::sUpdaterInfo->mUpdateExePath = - gDirUtilp->getExecutableDir() + "/" + "linux-updater.bin" + - " --url \"" + update_url.asString() + "\"" + - " --name \"" + LLAppViewer::instance()->getSecondLifeTitle() + "\"" + - " --dest \"" + gDirUtilp->getAppRODataDir() + "\"" + - " --stringsdir \"" + xml_search_paths + "\"" + - " --stringsfile \"" + xml_strings_file + "\""; - - LL_INFOS("AppInit") << "Calling updater: " - << LLAppViewer::sUpdaterInfo->mUpdateExePath << LL_ENDL; - - // *TODO: we could use the gdk equivalent to ensure the updater - // gets started on the same screen. - GError *error = NULL; - if (!g_spawn_command_line_async(LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), &error)) - { - LL_ERRS() << "Failed to launch updater: " - << error->message - << LL_ENDL; - } - if (error) { - g_error_free(error); - } -#else - OSMessageBox(LLTrans::getString("MBNoAutoUpdate"), LLStringUtil::null, OSMB_OK); -#endif - - // *REMOVE:Mani - Saving for reference... - // LLAppViewer::instance()->forceQuit(); -} - //virtual void LLAppViewer::setMasterSystemAudioMute(bool mute) { diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 16a00c8cee..c4782ed216 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -55,7 +55,6 @@ class LLTextureCache; class LLImageDecodeThread; class LLTextureFetch; class LLWatchdogTimeout; -class LLUpdaterService; class LLViewerJoystick; extern LLTrace::BlockTimerStatHandle FTM_FRAME; @@ -228,7 +227,6 @@ private: bool initThreads(); // Initialize viewer threads, return false on failure. bool initConfiguration(); // Initialize settings from the command line/config file. void initStrings(); // Initialize LLTrans machinery - void initUpdater(); // Initialize the updater service. bool initCache(); // Initialize local client cache. void checkMemory() ; @@ -309,28 +307,12 @@ private: LLAllocator mAlloc; LLFrameTimer mMemCheckTimer; - - boost::scoped_ptr<LLUpdaterService> mUpdater; // llcorehttp library init/shutdown helper LLAppCoreHttp mAppCoreHttp; - bool mIsFirstRun; - //--------------------------------------------- - //*NOTE: Mani - legacy updater stuff - // Still useable? -public: - - //some information for updater - typedef struct - { - std::string mUpdateExePath; - std::ostringstream mParams; - }LLUpdaterInfo ; - static LLUpdaterInfo *sUpdaterInfo ; + bool mIsFirstRun; - void launchUpdater(); - //--------------------------------------------- }; // consts from viewer.h diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index d6039f6d7f..d0093e6951 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -361,17 +361,6 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, delete viewer_app_ptr; viewer_app_ptr = NULL; - //start updater - if(LLAppViewer::sUpdaterInfo) - { - _spawnl(_P_NOWAIT, LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), LLAppViewer::sUpdaterInfo->mUpdateExePath.c_str(), LLAppViewer::sUpdaterInfo->mParams.str().c_str(), NULL); - - delete LLAppViewer::sUpdaterInfo ; - LLAppViewer::sUpdaterInfo = NULL ; - } - - - // (NVAPI) (6) We clean up. This is analogous to doing a free() if (hSession) { diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index c2d0d9f06b..171858e472 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -39,7 +39,6 @@ #include "llslurl.h" #include "llvoiceclient.h" #include "lluictrlfactory.h" -#include "llupdaterservice.h" #include "llviewertexteditor.h" #include "llviewercontrol.h" #include "llviewerstats.h" @@ -63,6 +62,7 @@ #include "llsdutil_math.h" #include "lleventapi.h" #include "llcorehttputil.h" +#include "lldir.h" #if LL_WINDOWS #include "lldxhardware.h" @@ -90,10 +90,7 @@ public: static LLSD getInfo(); void onClickCopyToClipboard(); void onClickUpdateCheck(); - - // checks state of updater service and starts a check outside of schedule. - // subscribes callback for closest state update - static void setUpdateListener(); + static void setUpdateListener(); private: void setSupportText(const std::string& server_release_notes_url); @@ -103,9 +100,9 @@ private: // callback method for manual checks static bool callbackCheckUpdate(LLSD const & event); - - // listener name for update checks - static const std::string sCheckUpdateListenerName; + + // listener name for update checks + static const std::string sCheckUpdateListenerName; static void startFetchServerReleaseNotes(); static void fetchServerReleaseNotesCoro(const std::string& cap_url); @@ -139,9 +136,9 @@ BOOL LLFloaterAbout::postBuild() getChild<LLUICtrl>("copy_btn")->setCommitCallback( boost::bind(&LLFloaterAbout::onClickCopyToClipboard, this)); - - getChild<LLUICtrl>("update_btn")->setCommitCallback( - boost::bind(&LLFloaterAbout::onClickUpdateCheck, this)); + + getChild<LLUICtrl>("update_btn")->setCommitCallback( + boost::bind(&LLFloaterAbout::onClickUpdateCheck, this)); static const LLUIColor about_color = LLUIColorTable::instance().getColor("TextFgReadOnlyColor"); @@ -319,7 +316,7 @@ void LLFloaterAbout::onClickCopyToClipboard() void LLFloaterAbout::onClickUpdateCheck() { - setUpdateListener(); + setUpdateListener(); } void LLFloaterAbout::setSupportText(const std::string& server_release_notes_url) @@ -342,66 +339,92 @@ void LLFloaterAbout::setSupportText(const std::string& server_release_notes_url) FALSE, LLStyle::Params() .color(about_color)); } -///---------------------------------------------------------------------------- -/// Floater About Update-check related functions -///---------------------------------------------------------------------------- - -const std::string LLFloaterAbout::sCheckUpdateListenerName = "LLUpdateNotificationListener"; - -void LLFloaterAbout::showCheckUpdateNotification(S32 state) -{ - switch (state) - { - case LLUpdaterService::UP_TO_DATE: - LLNotificationsUtil::add("UpdateViewerUpToDate"); - break; - case LLUpdaterService::DOWNLOADING: - case LLUpdaterService::INSTALLING: - LLNotificationsUtil::add("UpdateDownloadInProgress"); - break; - case LLUpdaterService::TERMINAL: - // download complete, user triggered check after download pop-up appeared - LLNotificationsUtil::add("UpdateDownloadComplete"); - break; - default: - LLNotificationsUtil::add("UpdateCheckError"); - break; - } -} - -bool LLFloaterAbout::callbackCheckUpdate(LLSD const & event) -{ - if (!event.has("payload")) - { - return false; - } - - LLSD payload = event["payload"]; - if (payload.has("type") && payload["type"].asInteger() == LLUpdaterService::STATE_CHANGE) - { - LLEventPumps::instance().obtain("mainlooprepeater").stopListening(sCheckUpdateListenerName); - showCheckUpdateNotification(payload["state"].asInteger()); - } - return false; -} - +//This is bound as a callback in postBuild() void LLFloaterAbout::setUpdateListener() { - LLUpdaterService update_service; - S32 service_state = update_service.getState(); - // Note: Do not set state listener before forceCheck() since it set's new state - if (update_service.forceCheck() || service_state == LLUpdaterService::CHECKING_FOR_UPDATE) - { - LLEventPump& mainloop(LLEventPumps::instance().obtain("mainlooprepeater")); - if (mainloop.getListener(sCheckUpdateListenerName) == LLBoundListener()) // dummy listener - { - mainloop.listen(sCheckUpdateListenerName, boost::bind(&callbackCheckUpdate, _1)); - } - } - else - { - showCheckUpdateNotification(service_state); - } + typedef std::vector<std::string> vec; + + //There are four possibilities: + //no downloads directory or version directory in "getOSUserAppDir()/downloads" + // => no update + //version directory exists and .done file is not present + // => download in progress + //version directory exists and .done file exists + // => update ready for install + //version directory, .done file and either .skip or .next file exists + // => update deferred + BOOL downloads = false; + std::string downloadDir = ""; + BOOL done = false; + BOOL next = false; + BOOL skip = false; + + LLSD info(LLFloaterAbout::getInfo()); + std::string version = info["VIEWER_VERSION_STR"].asString(); + std::string appDir = gDirUtilp->getOSUserAppDir(); + + //drop down two directory levels so we aren't searching for markers among the log files and crash dumps + //or among other possible viewer upgrade directories if the resident is running multiple viewer versions + //we should end up with a path like ../downloads/1.2.3.456789 + vec file_vec = gDirUtilp->getFilesInDir(appDir); + + for(vec::const_iterator iter=file_vec.begin(); iter!=file_vec.end(); ++iter) + { + if ( (iter->rfind("downloads") ) ) + { + vec dir_vec = gDirUtilp->getFilesInDir(*iter); + for(vec::const_iterator dir_iter=dir_vec.begin(); dir_iter!=dir_vec.end(); ++dir_iter) + { + if ( (dir_iter->rfind(version))) + { + downloads = true; + downloadDir = *dir_iter; + } + } + } + } + + if ( downloads ) + { + for(vec::const_iterator iter=file_vec.begin(); iter!=file_vec.end(); ++iter) + { + if ( (iter->rfind(version))) + { + if ( (iter->rfind(".done") ) ) + { + done = true; + } + else if ( (iter->rfind(".next") ) ) + { + next = true; + } + else if ( (iter->rfind(".skip") ) ) + { + skip = true; + } + } + } + } + + if ( !downloads ) + { + LLNotificationsUtil::add("UpdateViewerUpToDate"); + } + else + { + if ( !done ) + { + LLNotificationsUtil::add("UpdateDownloadInProgress"); + } + else if ( (!next) && (!skip) ) + { + LLNotificationsUtil::add("UpdateDownloadComplete"); + } + else //done and there is a next or skip + { + LLNotificationsUtil::add("UpdateDeferred"); + } + } } ///---------------------------------------------------------------------------- @@ -411,11 +434,10 @@ void LLFloaterAboutUtil::registerFloater() { LLFloaterReg::add("sl_about", "floater_about.xml", &LLFloaterReg::build<LLFloaterAbout>); - } void LLFloaterAboutUtil::checkUpdatesAndNotify() { - LLFloaterAbout::setUpdateListener(); + LLFloaterAbout::setUpdateListener(); } diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index a49a9ca840..229703bb39 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -50,13 +50,12 @@ #include "llwindow.h" #include "llviewerwindow.h" #include "llprogressview.h" -#if LL_LINUX || LL_SOLARIS +#if LL_LINUX #include "lltrans.h" #endif #include "llsecapi.h" #include "llstartup.h" #include "llmachineid.h" -#include "llupdaterservice.h" #include "llevents.h" #include "llappviewer.h" @@ -68,406 +67,11 @@ public: virtual ~Disposable() {} }; -namespace { - class MandatoryUpdateMachine: - public LLLoginInstance::Disposable - { - public: - MandatoryUpdateMachine(LLLoginInstance & loginInstance, LLUpdaterService & updaterService); - - void start(void); - - LLNotificationsInterface& getNotificationsInterface() const - { - return mLoginInstance.getNotificationsInterface(); - } - - private: - class State; - class CheckingForUpdate; - class Error; - class ReadyToInstall; - class StartingUpdaterService; - class WaitingForDownload; - - boost::scoped_ptr<State> mState; - LLLoginInstance & mLoginInstance; - LLUpdaterService & mUpdaterService; - - void setCurrentState(State * newState); - }; - - - class MandatoryUpdateMachine::State { - public: - virtual ~State() {} - virtual void enter(void) {} - virtual void exit(void) {} - }; - - - class MandatoryUpdateMachine::CheckingForUpdate: - public MandatoryUpdateMachine::State - { - public: - CheckingForUpdate(MandatoryUpdateMachine & machine); - - virtual void enter(void); - virtual void exit(void); - - private: - LLTempBoundListener mConnection; - MandatoryUpdateMachine & mMachine; - LLProgressView * mProgressView; - - bool onEvent(LLSD const & event); - }; - - - class MandatoryUpdateMachine::Error: - public MandatoryUpdateMachine::State - { - public: - Error(MandatoryUpdateMachine & machine); - - virtual void enter(void); - virtual void exit(void); - void onButtonClicked(const LLSD &, const LLSD &); - - private: - MandatoryUpdateMachine & mMachine; - }; - - - class MandatoryUpdateMachine::ReadyToInstall: - public MandatoryUpdateMachine::State - { - public: - ReadyToInstall(MandatoryUpdateMachine & machine); - - virtual void enter(void); - virtual void exit(void); - - private: - //MandatoryUpdateMachine & mMachine; - }; - - - class MandatoryUpdateMachine::StartingUpdaterService: - public MandatoryUpdateMachine::State - { - public: - StartingUpdaterService(MandatoryUpdateMachine & machine); - - virtual void enter(void); - virtual void exit(void); - void onButtonClicked(const LLSD & uiform, const LLSD & result); - private: - MandatoryUpdateMachine & mMachine; - }; - - - class MandatoryUpdateMachine::WaitingForDownload: - public MandatoryUpdateMachine::State - { - public: - WaitingForDownload(MandatoryUpdateMachine & machine); - - virtual void enter(void); - virtual void exit(void); - - private: - LLTempBoundListener mConnection; - MandatoryUpdateMachine & mMachine; - LLProgressView * mProgressView; - - bool onEvent(LLSD const & event); - }; -} - static const char * const TOS_REPLY_PUMP = "lllogininstance_tos_callback"; static const char * const TOS_LISTENER_NAME = "lllogininstance_tos"; std::string construct_start_string(); - - -// MandatoryUpdateMachine -//----------------------------------------------------------------------------- - - -MandatoryUpdateMachine::MandatoryUpdateMachine(LLLoginInstance & loginInstance, LLUpdaterService & updaterService): - mLoginInstance(loginInstance), - mUpdaterService(updaterService) -{ - ; // No op. -} - - -void MandatoryUpdateMachine::start(void) -{ - LL_INFOS() << "starting mandatory update machine" << LL_ENDL; - - if(mUpdaterService.isChecking()) { - switch(mUpdaterService.getState()) { - case LLUpdaterService::UP_TO_DATE: - mUpdaterService.stopChecking(); - mUpdaterService.startChecking(); - // Fall through. - case LLUpdaterService::INITIAL: - case LLUpdaterService::CHECKING_FOR_UPDATE: - setCurrentState(new CheckingForUpdate(*this)); - break; - case LLUpdaterService::TEMPORARY_ERROR: - setCurrentState(new Error(*this)); - break; - case LLUpdaterService::DOWNLOADING: - setCurrentState(new WaitingForDownload(*this)); - break; - case LLUpdaterService::TERMINAL: - if(LLUpdaterService::updateReadyToInstall()) { - setCurrentState(new ReadyToInstall(*this)); - } else { - setCurrentState(new Error(*this)); - } - break; - case LLUpdaterService::FAILURE: - setCurrentState(new Error(*this)); - break; - default: - llassert(!"unpossible case"); - break; - } - } else { - setCurrentState(new StartingUpdaterService(*this)); - } -} - - -void MandatoryUpdateMachine::setCurrentState(State * newStatePointer) -{ - { - boost::scoped_ptr<State> newState(newStatePointer); - if(mState != 0) mState->exit(); - mState.swap(newState); - - // Old state will be deleted on exit from this block before the new state - // is entered. - } - if(mState != 0) mState->enter(); -} - - - -// MandatoryUpdateMachine::CheckingForUpdate -//----------------------------------------------------------------------------- - - -MandatoryUpdateMachine::CheckingForUpdate::CheckingForUpdate(MandatoryUpdateMachine & machine): - mMachine(machine) -{ - ; // No op. -} - - -void MandatoryUpdateMachine::CheckingForUpdate::enter(void) -{ - LL_INFOS() << "entering checking for update" << LL_ENDL; - - mProgressView = gViewerWindow->getProgressView(); - mProgressView->setMessage("Looking for update..."); - mProgressView->setText("There is a required update for your Second Life installation."); - mProgressView->setPercent(0); - mProgressView->setVisible(true); - mConnection = LLEventPumps::instance().obtain(LLUpdaterService::pumpName()). - listen("MandatoryUpdateMachine::CheckingForUpdate", boost::bind(&MandatoryUpdateMachine::CheckingForUpdate::onEvent, this, _1)); -} - - -void MandatoryUpdateMachine::CheckingForUpdate::exit(void) -{ -} - - -bool MandatoryUpdateMachine::CheckingForUpdate::onEvent(LLSD const & event) -{ - if(event["type"].asInteger() == LLUpdaterService::STATE_CHANGE) { - switch(event["state"].asInteger()) { - case LLUpdaterService::DOWNLOADING: - mMachine.setCurrentState(new WaitingForDownload(mMachine)); - break; - case LLUpdaterService::TEMPORARY_ERROR: - case LLUpdaterService::UP_TO_DATE: - case LLUpdaterService::TERMINAL: - case LLUpdaterService::FAILURE: - mProgressView->setVisible(false); - mMachine.setCurrentState(new Error(mMachine)); - break; - case LLUpdaterService::INSTALLING: - llassert(!"can't possibly be installing"); - break; - default: - break; - } - } else { - ; // Ignore. - } - - return false; -} - - - -// MandatoryUpdateMachine::Error -//----------------------------------------------------------------------------- - - -MandatoryUpdateMachine::Error::Error(MandatoryUpdateMachine & machine): - mMachine(machine) -{ - ; // No op. -} - - -void MandatoryUpdateMachine::Error::enter(void) -{ - LL_INFOS() << "entering error" << LL_ENDL; - mMachine.getNotificationsInterface().add("FailedRequiredUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2)); -} - - -void MandatoryUpdateMachine::Error::exit(void) -{ - LLAppViewer::instance()->forceQuit(); -} - - -void MandatoryUpdateMachine::Error::onButtonClicked(const LLSD &, const LLSD &) -{ - mMachine.setCurrentState(0); -} - - - -// MandatoryUpdateMachine::ReadyToInstall -//----------------------------------------------------------------------------- - - -MandatoryUpdateMachine::ReadyToInstall::ReadyToInstall(MandatoryUpdateMachine & machine) //: - //mMachine(machine) -{ - ; // No op. -} - - -void MandatoryUpdateMachine::ReadyToInstall::enter(void) -{ - LL_INFOS() << "entering ready to install" << LL_ENDL; - // Open update ready dialog. -} - - -void MandatoryUpdateMachine::ReadyToInstall::exit(void) -{ - // Restart viewer. -} - - - -// MandatoryUpdateMachine::StartingUpdaterService -//----------------------------------------------------------------------------- - - -MandatoryUpdateMachine::StartingUpdaterService::StartingUpdaterService(MandatoryUpdateMachine & machine): - mMachine(machine) -{ - ; // No op. -} - - -void MandatoryUpdateMachine::StartingUpdaterService::enter(void) -{ - LL_INFOS() << "entering start update service" << LL_ENDL; - mMachine.getNotificationsInterface().add("UpdaterServiceNotRunning", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked, this, _1, _2)); -} - - -void MandatoryUpdateMachine::StartingUpdaterService::exit(void) -{ - ; // No op. -} - - -void MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked(const LLSD & uiform, const LLSD & result) -{ - if(result["OK_okcancelbuttons"].asBoolean()) { - mMachine.mUpdaterService.startChecking(false); - mMachine.setCurrentState(new CheckingForUpdate(mMachine)); - } else { - LLAppViewer::instance()->forceQuit(); - } -} - - - -// MandatoryUpdateMachine::WaitingForDownload -//----------------------------------------------------------------------------- - - -MandatoryUpdateMachine::WaitingForDownload::WaitingForDownload(MandatoryUpdateMachine & machine): - mMachine(machine), - mProgressView(0) -{ - ; // No op. -} - - -void MandatoryUpdateMachine::WaitingForDownload::enter(void) -{ - LL_INFOS() << "entering waiting for download" << LL_ENDL; - mProgressView = gViewerWindow->getProgressView(); - mProgressView->setMessage("Downloading update..."); - std::ostringstream stream; - stream << "There is a required update for your Second Life installation." << std::endl << - "Version " << mMachine.mUpdaterService.updatedVersion(); - mProgressView->setText(stream.str()); - mProgressView->setPercent(0); - mProgressView->setVisible(true); - mConnection = LLEventPumps::instance().obtain(LLUpdaterService::pumpName()). - listen("MandatoryUpdateMachine::CheckingForUpdate", boost::bind(&MandatoryUpdateMachine::WaitingForDownload::onEvent, this, _1)); -} - - -void MandatoryUpdateMachine::WaitingForDownload::exit(void) -{ - mProgressView->setVisible(false); -} - - -bool MandatoryUpdateMachine::WaitingForDownload::onEvent(LLSD const & event) -{ - switch(event["type"].asInteger()) { - case LLUpdaterService::DOWNLOAD_COMPLETE: - mMachine.setCurrentState(new ReadyToInstall(mMachine)); - break; - case LLUpdaterService::DOWNLOAD_ERROR: - mMachine.setCurrentState(new Error(mMachine)); - break; - case LLUpdaterService::PROGRESS: { - double downloadSize = event["download_size"].asReal(); - double bytesDownloaded = event["bytes_downloaded"].asReal(); - mProgressView->setPercent(100. * bytesDownloaded / downloadSize); - break; - } - default: - break; - } - - return false; -} - - - // LLLoginInstance //----------------------------------------------------------------------------- @@ -476,11 +80,9 @@ LLLoginInstance::LLLoginInstance() : mLoginModule(new LLLogin()), mNotifications(NULL), mLoginState("offline"), - mSkipOptionalUpdate(false), mAttemptComplete(false), mTransferRate(0.0f), - mDispatcher("LLLoginInstance", "change"), - mUpdaterService(0) + mDispatcher("LLLoginInstance", "change") { mLoginModule->getEventPump().listen("lllogininstance", boost::bind(&LLLoginInstance::handleLoginEvent, this, _1)); @@ -590,13 +192,14 @@ void LLLoginInstance::constructAuthParams(LLPointer<LLCredential> user_credentia // (re)initialize the request params with creds. LLSD request_params = user_credential->getLoginParams(); - unsigned char hashed_unique_id_string[MD5HEX_STR_SIZE]; - if ( ! llHashedUniqueID(hashed_unique_id_string) ) - { + unsigned char hashed_unique_id_string[MD5HEX_STR_SIZE]; + if ( ! llHashedUniqueID(hashed_unique_id_string) ) + { + LL_WARNS() << "Not providing a unique id in request params" << LL_ENDL; + } request_params["start"] = construct_start_string(); - request_params["skipoptional"] = mSkipOptionalUpdate; request_params["agree_to_tos"] = false; // Always false here. Set true in request_params["read_critical"] = false; // handleTOSResponse request_params["last_exec_event"] = mLastExecEvent; @@ -699,19 +302,6 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event) boost::bind(&LLLoginInstance::handleTOSResponse, this, _1, "read_critical")); } - else if(reason_response == "update" || gSavedSettings.getBOOL("ForceMandatoryUpdate")) - { - LL_INFOS() << "LLLoginInstance::handleLoginFailure update" << LL_ENDL; - - gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); - updateApp(true, message_response); - } - else if(reason_response == "optional") - { - LL_INFOS() << "LLLoginInstance::handleLoginFailure optional" << LL_ENDL; - - updateApp(false, message_response); - } else { LL_INFOS() << "LLLoginInstance::handleLoginFailure attemptComplete" << LL_ENDL; @@ -723,22 +313,7 @@ void LLLoginInstance::handleLoginSuccess(const LLSD& event) { LL_INFOS() << "LLLoginInstance::handleLoginSuccess" << LL_ENDL; - if(gSavedSettings.getBOOL("ForceMandatoryUpdate")) - { - LLSD response = event["data"]; - std::string message_response = response["message"].asString(); - - // Testing update... - gSavedSettings.setBOOL("ForceMandatoryUpdate", FALSE); - - // Don't confuse startup by leaving login "online". - mLoginModule->disconnect(); - updateApp(true, message_response); - } - else - { - attemptComplete(); - } + attemptComplete(); } void LLLoginInstance::handleDisconnect(const LLSD& event) @@ -788,135 +363,6 @@ bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key) return true; } - -void LLLoginInstance::updateApp(bool mandatory, const std::string& auth_msg) -{ - if(mandatory) - { - gViewerWindow->setShowProgress(false); - MandatoryUpdateMachine * machine = new MandatoryUpdateMachine(*this, *mUpdaterService); - mUpdateStateMachine.reset(machine); - machine->start(); - return; - } - - // store off config state, as we might quit soon - gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); - LLUIColorTable::instance().saveUserSettings(); - - std::ostringstream message; - std::string msg; - if (!auth_msg.empty()) - { - msg = "(" + auth_msg + ") \n"; - } - - LLSD args; - args["MESSAGE"] = msg; - - LLSD payload; - payload["mandatory"] = mandatory; - - /* - * We're constructing one of the following 9 strings here: - * "DownloadWindowsMandatory" - * "DownloadWindowsReleaseForDownload" - * "DownloadWindows" - * "DownloadMacMandatory" - * "DownloadMacReleaseForDownload" - * "DownloadMac" - * "DownloadLinuxMandatory" - * "DownloadLinuxReleaseForDownload" - * "DownloadLinux" - * - * I've called them out explicitly in this comment so that they can be grepped for. - */ - std::string notification_name = "Download"; - -#if LL_WINDOWS - notification_name += "Windows"; -#elif LL_DARWIN - notification_name += "Mac"; -#else - notification_name += "Linux"; -#endif - - if (mandatory) - { - notification_name += "Mandatory"; - } - else - { -#if LL_RELEASE_FOR_DOWNLOAD - notification_name += "ReleaseForDownload"; -#endif - } - - if(mNotifications) - { - mNotifications->add(notification_name, args, payload, - boost::bind(&LLLoginInstance::updateDialogCallback, this, _1, _2)); - - gViewerWindow->setShowProgress(false); - } -} - -bool LLLoginInstance::updateDialogCallback(const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotification::getSelectedOption(notification, response); - std::string update_exe_path; - bool mandatory = notification["payload"]["mandatory"].asBoolean(); - -#if !LL_RELEASE_FOR_DOWNLOAD - if (option == 2) - { - // This condition attempts to skip the - // update if using a dev build. - // The relog probably won't work if the - // update is mandatory. :) - - // *REMOVE:Mani - Saving for reference... - //LLStartUp::setStartupState( STATE_LOGIN_AUTH_INIT ); - mSkipOptionalUpdate = true; - reconnect(); - return false; - } -#endif - - if (option == 1) - { - // ...user doesn't want to do it - if (mandatory) - { - // Mandatory update, user chose to not to update... - // The login attemp is complete, startup should - // quit when detecting this. - attemptComplete(); - - // *REMOVE:Mani - Saving for reference... - //LLAppViewer::instance()->forceQuit(); - // // Bump them back to the login screen. - // //reset_login(); - } - else - { - // Optional update, user chose to skip - mSkipOptionalUpdate = true; - reconnect(); - } - return false; - } - - if(mUpdaterLauncher) - { - mUpdaterLauncher(); - } - - attemptComplete(); - - return false; -} - std::string construct_start_string() { std::string start; diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 282ddc1cea..67d0f01ba6 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -34,7 +34,6 @@ class LLLogin; class LLEventStream; class LLNotificationsInterface; -class LLUpdaterService; // This class hosts the login module and is used to // negotiate user authentication attempts. @@ -60,10 +59,6 @@ public: // Only valid when authSuccess == true. const F64 getLastTransferRateBPS() { return mTransferRate; } - - // Whether to tell login to skip optional update request. - // False by default. - void setSkipOptionalUpdate(bool state) { mSkipOptionalUpdate = state; } void setSerialNumber(const std::string& sn) { mSerialNumber = sn; } void setLastExecEvent(int lee) { mLastExecEvent = lee; } void setLastExecDuration(S32 duration) { mLastExecDuration = duration; } @@ -72,10 +67,6 @@ public: void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; } LLNotificationsInterface& getNotificationsInterface() const { return *mNotifications; } - typedef boost::function<void()> UpdaterLauncherCallback; - void setUpdaterLauncher(const UpdaterLauncherCallback& ulc) { mUpdaterLauncher = ulc; } - - void setUpdaterService(LLUpdaterService * updaterService) { mUpdaterService = updaterService; } private: void constructAuthParams(LLPointer<LLCredential> user_credentials); void updateApp(bool mandatory, const std::string& message); @@ -97,7 +88,6 @@ private: std::string mLoginState; LLSD mRequestData; LLSD mResponseData; - bool mSkipOptionalUpdate; bool mAttemptComplete; F64 mTransferRate; std::string mSerialNumber; @@ -105,10 +95,7 @@ private: S32 mLastExecDuration; std::string mPlatform; std::string mPlatformVersion; - UpdaterLauncherCallback mUpdaterLauncher; LLEventDispatcher mDispatcher; - LLUpdaterService * mUpdaterService; - boost::scoped_ptr<Disposable> mUpdateStateMachine; }; #endif diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0a85344025..c3a3af091c 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1029,7 +1029,6 @@ bool idle_startup() login->setSerialNumber(LLAppViewer::instance()->getSerialNumber()); login->setLastExecEvent(gLastExecEvent); login->setLastExecDuration(gLastExecDuration); - login->setUpdaterLauncher(boost::bind(&LLAppViewer::launchUpdater, LLAppViewer::instance())); // This call to LLLoginInstance::connect() starts the // authentication process. diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 7c1921b143..d9d66ef254 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -75,7 +75,6 @@ #include "llspellcheck.h" #include "llslurl.h" #include "llstartup.h" -#include "llupdaterservice.h" // Third party library includes #include <boost/algorithm/string.hpp> @@ -583,19 +582,6 @@ bool toggle_show_object_render_cost(const LLSD& newvalue) return true; } -void toggle_updater_service_active(const LLSD& new_value) -{ - if(new_value.asInteger()) - { - LLUpdaterService update_service; - if(!update_service.isChecking()) update_service.startChecking(); - } - else - { - LLUpdaterService().stopChecking(); - } -} - //////////////////////////////////////////////////////////////////////////// void settings_setup_listeners() @@ -743,7 +729,6 @@ void settings_setup_listeners() gSavedSettings.getControl("ShowNavbarNavigationPanel")->getSignal()->connect(boost::bind(&toggle_show_navigation_panel, _2)); gSavedSettings.getControl("ShowMiniLocationPanel")->getSignal()->connect(boost::bind(&toggle_show_mini_location_panel, _2)); gSavedSettings.getControl("ShowObjectRenderingCost")->getSignal()->connect(boost::bind(&toggle_show_object_render_cost, _2)); - gSavedSettings.getControl("UpdaterServiceSetting")->getSignal()->connect(boost::bind(&toggle_updater_service_active, _2)); gSavedSettings.getControl("ForceShowGrid")->getSignal()->connect(boost::bind(&handleForceShowGrid, _2)); gSavedSettings.getControl("RenderTransparentWater")->getSignal()->connect(boost::bind(&handleRenderTransparentWaterChanged, _2)); gSavedSettings.getControl("SpellCheck")->getSignal()->connect(boost::bind(&handleSpellCheckChanged)); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index bae619c66d..f346f48ef5 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2124,22 +2124,6 @@ class LLAdvancedCheckShowObjectUpdates : public view_listener_t -/////////////////////// -// CHECK FOR UPDATES // -/////////////////////// - - - -class LLAdvancedCheckViewerUpdates : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLFloaterAboutUtil::checkUpdatesAndNotify(); - return true; - } -}; - - //////////////////// // COMPRESS IMAGE // //////////////////// @@ -9025,7 +9009,6 @@ void initialize_menus() // Advanced (toplevel) view_listener_t::addMenu(new LLAdvancedToggleShowObjectUpdates(), "Advanced.ToggleShowObjectUpdates"); view_listener_t::addMenu(new LLAdvancedCheckShowObjectUpdates(), "Advanced.CheckShowObjectUpdates"); - view_listener_t::addMenu(new LLAdvancedCheckViewerUpdates(), "Advanced.CheckViewerUpdates"); view_listener_t::addMenu(new LLAdvancedCompressImage(), "Advanced.CompressImage"); view_listener_t::addMenu(new LLAdvancedShowDebugSettings(), "Advanced.ShowDebugSettings"); view_listener_t::addMenu(new LLAdvancedEnableViewAdminOptions(), "Advanced.EnableViewAdminOptions"); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 3fcd91f89b..3042041a13 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4036,10 +4036,9 @@ An update was downloaded. It will be installed during restart. <notification icon="alertmodal.tga" - name="UpdateCheckError" + name="UpdateDeferred" type="alertmodal"> -An error occurred while checking for update. -Please try again later. +An update was downloaded that you previously chose to skip or defer to the next start up. <tag>confirm</tag> <usetemplate name="okbutton" diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index b603157ca7..3b7ec48d61 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -31,6 +31,9 @@ #include "../llviewernetwork.h" #include "../lllogininstance.h" + // Needed for Auth Test + #include "../llhasheduniqueid.h" + // STL headers // std headers // external library headers @@ -188,35 +191,6 @@ void LLUIColorTable::saveUserSettings(void)const {} const std::string &LLVersionInfo::getVersion() { return VIEWERLOGIN_VERSION; } const std::string &LLVersionInfo::getChannel() { return VIEWERLOGIN_CHANNEL; } -//----------------------------------------------------------------------------- -#include "../llappviewer.h" -void LLAppViewer::forceQuit(void) {} -LLAppViewer * LLAppViewer::sInstance = 0; - -//----------------------------------------------------------------------------- -#include "llupdaterservice.h" - -std::string const & LLUpdaterService::pumpName(void) -{ - static std::string wakka = "wakka wakka wakka"; - return wakka; -} -bool LLUpdaterService::updateReadyToInstall(void) { return false; } -void LLUpdaterService::initialize(const std::string& channel, - const std::string& version, - const std::string& platform, - const std::string& platform_version, - const unsigned char uniqueid[MD5HEX_STR_SIZE], - const bool& willing_to_test - ) {} - -void LLUpdaterService::setCheckPeriod(unsigned int seconds) {} -void LLUpdaterService::startChecking(bool install_if_ready) {} -void LLUpdaterService::stopChecking() {} -bool LLUpdaterService::isChecking() { return false; } -LLUpdaterService::eUpdaterState LLUpdaterService::getState() { return INITIAL; } -std::string LLUpdaterService::updatedVersion() { return ""; } - bool llHashedUniqueID(unsigned char* id) { memcpy( id, "66666666666666666666666666666666", MD5HEX_STR_SIZE ); @@ -224,6 +198,11 @@ bool llHashedUniqueID(unsigned char* id) } //----------------------------------------------------------------------------- +#include "../llappviewer.h" +void LLAppViewer::forceQuit(void) {} +LLAppViewer * LLAppViewer::sInstance = 0; + +//----------------------------------------------------------------------------- #include "llnotifications.h" #include "llfloaterreg.h" static std::string gTOSType; @@ -339,7 +318,6 @@ namespace tut gSavedSettings.declareBOOL("NoInventoryLibrary", FALSE, "", LLControlVariable::PERSIST_NO); gSavedSettings.declareBOOL("ConnectAsGod", FALSE, "", LLControlVariable::PERSIST_NO); gSavedSettings.declareBOOL("UseDebugMenus", FALSE, "", LLControlVariable::PERSIST_NO); - gSavedSettings.declareBOOL("ForceMandatoryUpdate", FALSE, "", LLControlVariable::PERSIST_NO); gSavedSettings.declareString("ClientSettingsFile", "test_settings.xml", "", LLControlVariable::PERSIST_NO); gSavedSettings.declareString("NextLoginLocation", "", "", LLControlVariable::PERSIST_NO); gSavedSettings.declareBOOL("LoginLastLocation", FALSE, "", LLControlVariable::PERSIST_NO); @@ -477,110 +455,4 @@ namespace tut logininstance->connect(test_uri, agentCredential); ensure_equals("Default for agree to tos", gLoginCreds["params"]["read_critical"].asBoolean(), false); } - - template<> template<> - void lllogininstance_object::test<3>() - { - set_test_name("Test Mandatory Update User Accepts"); - - // Part 1 - Mandatory Update, with User accepts response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "update"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - - notifications.sendYesResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<4>() - { - set_test_name("Test Mandatory Update User Decline"); - - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "update"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendNoResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<6>() - { - set_test_name("Test Optional Update User Accept"); - - // Part 3 - Mandatory Update, with bogus response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "optional"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendYesResponse(); - - ensure("Disconnected", !(logininstance->authSuccess())); - } - - template<> template<> - void lllogininstance_object::test<7>() - { - set_test_name("Test Optional Update User Denies"); - - // Part 3 - Mandatory Update, with bogus response. - // Test connect with update needed. - logininstance->connect(agentCredential); - - ensure_equals("Default connect uri", gLoginURI, VIEWERLOGIN_URI); - - // Update needed failure response. - LLSD response; - response["state"] = "offline"; - response["change"] = "fail.login"; - response["progress"] = 0.0; - response["transfer_rate"] = 7; - response["data"]["reason"] = "optional"; - gTestPump.post(response); - - ensure_equals("Notification added", notifications.addedCount(), 1); - notifications.sendNoResponse(); - - // User skips, should be reconnecting. - ensure_equals("reconnect uri", gLoginURI, VIEWERLOGIN_URI); - ensure_equals("skipping optional update", gLoginCreds["params"]["skipoptional"].asBoolean(), true); - } } diff --git a/indra/newview/tests/llversioninfo_test.cpp b/indra/newview/tests/llversioninfo_test.cpp index f1f69f33f1..2f7a4e9601 100644 --- a/indra/newview/tests/llversioninfo_test.cpp +++ b/indra/newview/tests/llversioninfo_test.cpp @@ -29,6 +29,8 @@ #include "../llversioninfo.h" + #include <iostream> + // LL_VIEWER_CHANNEL is a macro defined on the compiler command line. The // macro expands to the string name of the channel, but without quotes. We // need to turn it into a quoted string. This macro trick does that. @@ -81,7 +83,9 @@ namespace tut template<> template<> void versioninfo_object_t::test<1>() - { + { + std::cout << "What we parsed from CMake: " << LL_VIEWER_VERSION_BUILD << std::endl; + std::cout << "What we get from llversioninfo: " << LLVersionInfo::getBuild() << std::endl; ensure_equals("Major version", LLVersionInfo::getMajor(), LL_VIEWER_VERSION_MAJOR); diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 142951da25..e806a4fdad 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -27,6 +27,7 @@ Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA $/LicenseInfo$ """ import sys +import os import os.path import shutil import errno @@ -120,6 +121,24 @@ class ViewerManifest(LLManifest): settings_install['CmdLineGridChoice']['Value'] = self.grid() print "Set CmdLineGridChoice in settings_install.xml to '%s'" % self.grid() + #do not need to test for existence. If no platform is passed, llmanifest computes a default in get_default_platform + #the choice of value names (lnx, mac, win32, win) is dictated by the VMM API + summary_json_platform = "" + if 'linux' in self.args['platform']: + summary_json_platform = 'lnx' + elif 'darwin' in self.args['platform']: + summary_json_platform = 'mac' + elif 'windows' in self.args['platform']: + #default case + summary_json_platform = 'win' + if 'arch' in self.args and self.args['arch']: + if 'i686' in self.args['arch']: + summary_json_platform = 'win32' + #we really shouldn't be here, something is very wrong at this point + else: + summary_json_platform = 'None' + + # put_in_file(src=) need not be an actual pathname; it # only needs to be non-empty self.put_in_file(llsd.format_pretty_xml(settings_install), @@ -183,7 +202,13 @@ class ViewerManifest(LLManifest): self.path("gpu_table.txt") #summary.json. Standard with exception handling is fine. If we can't open a new file for writing, we have worse problems - summary_dict = {"Type":"viewer","Version":'.'.join(self.args['version']),"Channel":self.channel_with_pkg_suffix()} + #platform is computed above with other arg parsing + summary_dict = {"Type":"viewer","Version":'.'.join(self.args['version']), + "Channel":self.channel_with_pkg_suffix(), + "Platform":summary_json_platform} + #MAINT-7294: Windows exe names depend on channel name, so write that in also + if summary_json_platform.startswith('win'): + summary_dict.update({'Executable':self.final_exe()}) with open(os.path.join(os.pardir,'summary.json'), 'w') as summary_handle: json.dump(summary_dict,summary_handle) @@ -222,7 +247,7 @@ class ViewerManifest(LLManifest): return channel_type def channel_variant_app_suffix(self): - # get any part of the compiled channel name after the CHANNEL_VENDOR_BASE + # get any part of the channel name after the CHANNEL_VENDOR_BASE suffix=self.channel_variant() # by ancient convention, we don't use Release in the app name if self.channel_type() == 'release': @@ -341,17 +366,42 @@ class WindowsManifest(ViewerManifest): pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") debpkgdir = os.path.join(pkgdir, "lib", "debug") + vmpdir = os.path.join(pkgdir, "VMP") + llbasedir = os.path.join(pkgdir, "llbase") if self.is_packaging_viewer(): # Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe. self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe()) + # include the compiled launcher scripts so that it gets included in the file_list + self.path(src='%s/apply_update.exe' % vmpdir, dst="apply_update.exe") + self.path(src='%s/download_update.exe' % vmpdir, dst="download_update.exe") + self.path(src='%s/SL_Launcher.exe' % vmpdir, dst="SL_Launcher.exe") + self.path(src='%s/update_manager.exe' % vmpdir, dst="update_manager.exe") + + #IUM is not normally executed directly, just imported. No exe needed. + self.path2basename(vmpdir,"InstallerUserMessage.py") + + #VMP Tkinter icons + if self.prefix("vmp_icons"): + self.path("*.png") + self.path("*.gif") + self.end_prefix("vmp_icons") + + #before, we only needed llbase at build time. With VMP, we need it at run time. + llbase_path = os.path.join(self.get_dst_prefix(),'llbase') + if not os.path.exists(llbase_path): + os.makedirs(llbase_path) + if self.prefix(dst="llbase"): + self.path2basename(llbasedir,"*.py") + self.path2basename(llbasedir,"_cllsd.so") + self.end_prefix() + # Plugin host application self.path2basename(os.path.join(os.pardir, 'llplugin', 'slplugin', self.args['configuration']), "slplugin.exe") - self.path2basename("../viewer_components/updater/scripts/windows", "update_install.bat") # Get shared libs from the shared libs staging directory if self.prefix(src=os.path.join(os.pardir, 'sharedlibs', self.args['configuration']), dst=""): @@ -389,11 +439,15 @@ class WindowsManifest(ViewerManifest): # These need to be installed as a SxS assembly, currently a 'private' assembly. # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx if self.args['configuration'].lower() == 'debug': - self.path("msvcr120d.dll") - self.path("msvcp120d.dll") + self.path("msvcr120d.dll") + self.path("msvcp120d.dll") + self.path("msvcr100d.dll") + self.path("msvcp100d.dll") else: - self.path("msvcr120.dll") - self.path("msvcp120.dll") + self.path("msvcr120.dll") + self.path("msvcp120.dll") + self.path("msvcr100.dll") + self.path("msvcp100.dll") # Vivox runtimes self.path("SLVoice.exe") @@ -616,10 +670,11 @@ class WindowsManifest(ViewerManifest): substitution_strings['installer_file'] = installer_file version_vars = """ - !define INSTEXE "%(final_exe)s" + !define INSTEXE "SL_Launcher.exe" !define VERSION "%(version_short)s" !define VERSION_LONG "%(version)s" !define VERSION_DASHES "%(version_dashes)s" + !define VIEWER_EXE "%(final_exe)s" """ % substitution_strings if self.channel_type() == 'release': @@ -654,6 +709,29 @@ class WindowsManifest(ViewerManifest): "%%ENGAGEREGISTRY%%":engage_registry, "%%DELETE_FILES%%":self.nsi_file_commands(False)}) + # If we're on a build machine, sign the code using our Authenticode certificate. JC + # note that the enclosing setup exe is signed later, after the makensis makes it. + sign_py = os.path.expandvars("${SIGN}") + if not sign_py or sign_py == "${SIGN}": + sign_py = 'C:\\buildscripts\\code-signing\\sign.py' + else: + sign_py = sign_py.replace('\\', '\\\\\\\\') + python = os.path.expandvars("${PYTHON}") + if not python or python == "${PYTHON}": + python = 'python' + if os.path.exists(sign_py): + #Unlike the viewer binary, the VMP filenames are invariant with respect to version, os, etc. + print "about to run signing of: ", self.dst_path_of("apply_update.exe").replace('\\', '\\\\\\\\') + self.run_command("%s %s %s" % (python, sign_py, self.dst_path_of("apply_update.exe").replace('\\', '\\\\\\\\'))) + print "about to run signing of: ", self.dst_path_of("download_update.exe").replace('\\', '\\\\\\\\') + self.run_command("%s %s %s" % (python, sign_py, self.dst_path_of("download_update.exe").replace('\\', '\\\\\\\\'))) + print "about to run signing of: ", self.dst_path_of("SL_Launcher.exe").replace('\\', '\\\\\\\\') + self.run_command("%s %s %s" % (python, sign_py, self.dst_path_of("SL_Launcher.exe").replace('\\', '\\\\\\\\'))) + print "about to run signing of: ", self.dst_path_of("update_manager.exe").replace('\\', '\\\\\\\\') + self.run_command("%s %s %s" % (python, sign_py, self.dst_path_of("update_manager.exe").replace('\\', '\\\\\\\\'))) + else: + print "Skipping code signing of vmp executables,", sign_py, "does not exist" + # We use the Unicode version of NSIS, available from # http://www.scratchpaper.com/ # Check two paths, one for Program Files, and one for Program Files (x86). @@ -677,20 +755,12 @@ class WindowsManifest(ViewerManifest): else: print >> sys.stderr, "Maximum nsis attempts exceeded; giving up" raise - # self.remove(self.dst_path_of(tempfile)) - # If we're on a build machine, sign the code using our Authenticode certificate. JC - sign_py = os.path.expandvars("${SIGN}") - if not sign_py or sign_py == "${SIGN}": - sign_py = 'C:\\buildscripts\\code-signing\\sign.py' - else: - sign_py = sign_py.replace('\\', '\\\\\\\\') - python = os.path.expandvars("${PYTHON}") - if not python or python == "${PYTHON}": - python = 'python' + if os.path.exists(sign_py): + print "about to run signing of: ", self.dst_path_of(installer_file).replace('\\', '\\\\\\\\') self.run_command("%s %s %s" % (python, sign_py, self.dst_path_of(installer_file).replace('\\', '\\\\\\\\'))) else: - print "Skipping code signing,", sign_py, "does not exist" + print "Skipping code signing of setup executable,", sign_py, "does not exist" self.created_path(self.dst_path_of(installer_file)) self.package_file = installer_file @@ -717,17 +787,38 @@ class DarwinManifest(ViewerManifest): pkgdir = os.path.join(self.args['build'], os.pardir, 'packages') relpkgdir = os.path.join(pkgdir, "lib", "release") debpkgdir = os.path.join(pkgdir, "lib", "debug") + vmpdir = os.path.join(pkgdir, "VMP") + llbasedir = os.path.join(pkgdir, "llbase") + requestsdir = os.path.join(pkgdir, "requests") if self.prefix(src="", dst="Contents"): # everything goes in Contents self.path("Info.plist", dst="Info.plist") # copy additional libs in <bundle>/Contents/MacOS/ self.path(os.path.join(relpkgdir, "libndofdev.dylib"), dst="Resources/libndofdev.dylib") - self.path(os.path.join(relpkgdir, "libhunspell-1.3.0.dylib"), dst="Resources/libhunspell-1.3.0.dylib") - - if self.prefix(dst="MacOS"): - self.path2basename("../viewer_components/updater/scripts/darwin", "*.py") - self.end_prefix() + self.path(os.path.join(relpkgdir, "libhunspell-1.3.0.dylib"), dst="Resources/libhunspell-1.3.0.dylib") + + if self.prefix(dst="MacOS"): + #this copies over the python wrapper script, associated utilities and required libraries, see SL-321, SL-322, SL-323 + self.path2basename(vmpdir,"SL_Launcher") + self.path2basename(vmpdir,"*.py") + llbase_path = os.path.join(self.get_dst_prefix(),'llbase') + if not os.path.exists(llbase_path): + os.makedirs(llbase_path) + #before, we only needed llbase at build time. With VMP, we need it at run time. + if self.prefix(dst="llbase"): + self.path2basename(llbasedir,"*.py") + self.path2basename(llbasedir,"_cllsd.so") + self.end_prefix() + #requests module needed by llbase/llrest.py + #this is only needed on POSIX, because in Windows we compile it into the EXE + requests_path = os.path.join(self.get_dst_prefix(),'requests') + if not os.path.exists(requests_path): + os.makedirs(requests_path) + if self.prefix(dst="requests"): + self.path2basename(requestsdir,"*") + self.end_prefix() + self.end_prefix() # most everything goes in the Resources directory if self.prefix(src="", dst="Resources"): @@ -746,6 +837,12 @@ class DarwinManifest(ViewerManifest): self.path("secondlife.icns") self.end_prefix(icon_path) + #VMP Tkinter icons + if self.prefix("vmp_icons"): + self.path("*.png") + self.path("*.gif") + self.end_prefix("vmp_icons") + self.path("SecondLife.nib") # Translations @@ -815,7 +912,7 @@ class DarwinManifest(ViewerManifest): 'ca-bundle.crt', 'SLVoice', ): - self.path2basename(relpkgdir, libfile) + self.path2basename(relpkgdir, libfile) # dylibs that vary based on configuration if self.args['configuration'].lower() == 'debug': @@ -852,8 +949,8 @@ class DarwinManifest(ViewerManifest): # Dullahan helper apps go inside SLPlugin.app if self.prefix(src="", dst="SLPlugin.app/Contents/Frameworks"): - for helperappfile in ('DullahanHelper.app'): - self.path2basename(relpkgdir, helperappfile) + helperappfile = 'DullahanHelper.app' + self.path2basename(relpkgdir, helperappfile) pluginframeworkpath = self.dst_path_of('Chromium Embedded Framework.framework'); # Putting a Frameworks directory under Contents/MacOS @@ -962,12 +1059,6 @@ class DarwinManifest(ViewerManifest): self.run_command('strip -S %(viewer_binary)r' % { 'viewer_binary' : self.dst_path_of('Contents/MacOS/Second Life')}) - def copy_finish(self): - # Force executable permissions to be set for scripts - # see CHOP-223 and http://mercurial.selenic.com/bts/issue1802 - for script in 'Contents/MacOS/update_install.py',: - self.run_command("chmod +x %r" % os.path.join(self.get_dst_prefix(), script)) - def package_finish(self): global CHANNEL_VENDOR_BASE # MBW -- If the mounted volume name changes, it breaks the .DS_Store's background image and icon positioning. @@ -1152,8 +1243,16 @@ class LinuxManifest(ViewerManifest): if self.prefix(src="", dst="bin"): self.path("secondlife-bin","do-not-directly-run-secondlife-bin") self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin") - self.path2basename("../llplugin/slplugin", "SLPlugin") - self.path2basename("../viewer_components/updater/scripts/linux", "update_install") + self.path2basename("../llplugin/slplugin", "SLPlugin") + #this copies over the python wrapper script, associated utilities and required libraries, see SL-321, SL-322 and SL-323 + self.path2basename("../viewer_components/manager","SL_Launcher") + self.path2basename("../viewer_components/manager","*.py") + llbase_path = os.path.join(self.get_dst_prefix(),'llbase') + if not os.path.exists(llbase_path): + os.makedirs(llbase_path) + if self.prefix(dst="llbase"): + self.path2basename("../packages/llbase","*.py") + self.path2basename("../packages/llbase","_cllsd.so") self.end_prefix("bin") if self.prefix("res-sdl"): @@ -1192,12 +1291,6 @@ class LinuxManifest(ViewerManifest): self.path("featuretable_linux.txt") - def copy_finish(self): - # Force executable permissions to be set for scripts - # see CHOP-223 and http://mercurial.selenic.com/bts/issue1802 - for script in 'secondlife', 'bin/update_install': - self.run_command("chmod +x %r" % os.path.join(self.get_dst_prefix(), script)) - def package_finish(self): installer_name = self.installer_base_name() @@ -1239,7 +1332,8 @@ class LinuxManifest(ViewerManifest): def strip_binaries(self): if self.args['buildtype'].lower() == 'release' and self.is_packaging_viewer(): print "* Going strip-crazy on the packaged binaries, since this is a RELEASE build" - self.run_command(r"find %(d)r/bin %(d)r/lib -type f \! -name update_install \! -name *.dat | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) # makes some small assumptions about our packaged dir structure + # makes some small assumptions about our packaged dir structure + self.run_command(r"find %(d)r/bin %(d)r/lib -type f \! -name \*.py \! -name SL_Launcher \! -name update_install | xargs --no-run-if-empty strip -S" % {'d': self.get_dst_prefix()} ) class Linux_i686_Manifest(LinuxManifest): def construct(self): diff --git a/indra/newview/vmp_icons/SL_Logo.gif b/indra/newview/vmp_icons/SL_Logo.gif Binary files differnew file mode 100644 index 0000000000..c24d6b08cb --- /dev/null +++ b/indra/newview/vmp_icons/SL_Logo.gif diff --git a/indra/newview/vmp_icons/SL_Logo.png b/indra/newview/vmp_icons/SL_Logo.png Binary files differnew file mode 100644 index 0000000000..5e376c72f9 --- /dev/null +++ b/indra/newview/vmp_icons/SL_Logo.png diff --git a/indra/newview/vmp_icons/head-sl-logo.gif b/indra/newview/vmp_icons/head-sl-logo.gif Binary files differnew file mode 100644 index 0000000000..d635348dcc --- /dev/null +++ b/indra/newview/vmp_icons/head-sl-logo.gif diff --git a/indra/newview/vmp_icons/head-sl-logo.png b/indra/newview/vmp_icons/head-sl-logo.png Binary files differnew file mode 100644 index 0000000000..5c214e96d1 --- /dev/null +++ b/indra/newview/vmp_icons/head-sl-logo.png |