From 840cb864a3b41ccff310077eff487c3fa1d6b805 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 5 Jan 2013 09:17:51 -0500 Subject: MAINT-2155: replace embedded mac-updater.app with a Python script. Remove mac-updater subtree from viewer source, along with the update_install bash script that invoked it. Remove all mention of mac-updater in CMakeLists.txt files and in viewer_manifest.py. Change Mac update_install bash script references in viewer_manifest.py and in llupdaterservice.cpp (which invokes it) to new Python update_install.py. Add update_install.py, messageframe.py (which puts up some Tkinter UI) and janitor.py (cloned from vita, it's exactly what we need here). --- indra/viewer_components/updater/llupdaterservice.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/viewer_components/updater/llupdaterservice.cpp') diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index bc73c72ddc..3fa96dd223 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -60,6 +60,8 @@ namespace { #ifdef LL_WINDOWS std::string scriptFile = "update_install.bat"; +#elif LL_DARWIN + std::string scriptFile = "update_install.py"; #else std::string scriptFile = "update_install"; #endif @@ -71,6 +73,8 @@ namespace #ifdef LL_WINDOWS return LL_COPY_INSTALL_SCRIPT_TO_TEMP; #else + // This is important on Mac because update_install.py looks at its own + // script pathname to discover the viewer app bundle to update. return LL_RUN_INSTALL_SCRIPT_IN_PLACE; #endif }; -- cgit v1.2.3 From d7e90f4160aaa81e30206c80047b82833c049482 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 7 Feb 2013 11:56:57 -0500 Subject: derive version number from indra/VIEWER_VERSION.txt --- indra/viewer_components/updater/llupdaterservice.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'indra/viewer_components/updater/llupdaterservice.cpp') diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index bc73c72ddc..d783360f80 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -32,7 +32,6 @@ #include "lltimer.h" #include "llupdatechecker.h" #include "llupdateinstaller.h" -#include "llversionviewer.h" #include #include @@ -44,6 +43,12 @@ #pragma warning (disable : 4355) // 'this' used in initializer list: yes, intentionally #endif +#if ! defined(LL_VIEWER_VERSION_MAJOR) \ + || ! defined(LL_VIEWER_VERSION_MINOR) \ + || ! defined(LL_VIEWER_VERSION_PATCH) \ + || ! defined(LL_VIEWER_VERSION_BUILD) +#error "Version information is undefined" +#endif namespace { @@ -609,10 +614,10 @@ std::string const & ll_get_version(void) { if (version.empty()) { std::ostringstream stream; - stream << LL_VERSION_MAJOR << "." - << LL_VERSION_MINOR << "." - << LL_VERSION_PATCH << "." - << LL_VERSION_BUILD; + stream << LL_VIEWER_VERSION_MAJOR << "." + << LL_VIEWER_VERSION_MINOR << "." + << LL_VIEWER_VERSION_PATCH << "." + << LL_VIEWER_VERSION_BUILD; version = stream.str(); } -- cgit v1.2.3 From cf1019859def2af4414def7991e95a9020b0688f Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 21 Feb 2013 16:47:52 -0500 Subject: add use of v1.1 update request protocol, with fallback to v1.0 --- .../viewer_components/updater/llupdaterservice.cpp | 77 ++++++++++++++-------- 1 file changed, 49 insertions(+), 28 deletions(-) (limited to 'indra/viewer_components/updater/llupdaterservice.cpp') diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index d783360f80..c6c89655d3 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -88,11 +88,14 @@ class LLUpdaterServiceImpl : { static const std::string sListenerName; - std::string mProtocolVersion; - std::string mUrl; - std::string mPath; - std::string mChannel; - std::string mVersion; + std::string mProtocolVersion; + std::string mUrl; + std::string mPath; + std::string mChannel; + std::string mVersion; + std::string mPlatformVersion; + unsigned char mUniqueId[MD5HEX_STR_SIZE]; + bool mWillingToTest; unsigned int mCheckPeriod; bool mIsChecking; @@ -112,11 +115,14 @@ public: LLUpdaterServiceImpl(); virtual ~LLUpdaterServiceImpl(); - void initialize(const std::string& protocol_version, - const std::string& url, - const std::string& path, - const std::string& channel, - const std::string& version); + void initialize(const std::string& url, + const std::string& path, + const std::string& channel, + const std::string& version, + const std::string& platform_version, + const unsigned char uniqueid[MD5HEX_STR_SIZE], + const bool& willing_to_test + ); void setCheckPeriod(unsigned int seconds); void setBandwidthLimit(U64 bytesPerSecond); @@ -174,11 +180,13 @@ LLUpdaterServiceImpl::~LLUpdaterServiceImpl() LLEventPumps::instance().obtain("mainloop").stopListening(sListenerName); } -void LLUpdaterServiceImpl::initialize(const std::string& protocol_version, - const std::string& url, - const std::string& path, - const std::string& channel, - const std::string& version) +void LLUpdaterServiceImpl::initialize(const std::string& url, + const std::string& path, + const std::string& channel, + const std::string& version, + const std::string & platform_version, + const unsigned char uniqueid[MD5HEX_STR_SIZE], + const bool& willing_to_test) { if(mIsChecking || mIsDownloading) { @@ -186,11 +194,21 @@ void LLUpdaterServiceImpl::initialize(const std::string& protocol_version, "while updater is running."); } - mProtocolVersion = protocol_version; mUrl = url; mPath = path; mChannel = channel; mVersion = version; + mPlatformVersion = platform_version; + memcpy(mUniqueId, uniqueid, MD5HEX_STR_SIZE); + mWillingToTest = willing_to_test; + LL_DEBUGS("UpdaterService") + << "\n url: " << mUrl + << "\n path: " << mPath + << "\n channel: " << mChannel + << "\n version: " << mVersion + << "\n uniqueid: " << mUniqueId + << "\n willing: " << ( mWillingToTest ? "testok" : "testno" ) + << LL_ENDL; } void LLUpdaterServiceImpl::setCheckPeriod(unsigned int seconds) @@ -289,7 +307,7 @@ bool LLUpdaterServiceImpl::checkForInstall(bool launchInstaller) // the update. Do not install this update. if(!path.asString().empty()) { - llinfos << "ignoring update dowloaded by different client version" << llendl; + LL_INFOS("UpdaterService") << "ignoring update dowloaded by different client version" << LL_ENDL;; LLFile::remove(path.asString()); LLFile::remove(update_marker_path()); } @@ -317,7 +335,7 @@ bool LLUpdaterServiceImpl::checkForInstall(bool launchInstaller) { mAppExitCallback(); } else if(result != 0) { - llwarns << "failed to run update install script" << LL_ENDL; + LL_WARNS("UpdaterService") << "failed to run update install script" << LL_ENDL; } else { ; // No op. } @@ -352,7 +370,7 @@ bool LLUpdaterServiceImpl::checkForResume() else { // The viewer that started this download is not the same as this viewer; ignore. - llinfos << "ignoring partial download from different viewer version" << llendl; + LL_INFOS("UpdaterService") << "ignoring partial download from different viewer version" << LL_ENDL;; std::string path = download_info["path"].asString(); if(!path.empty()) LLFile::remove(path); LLFile::remove(download_marker_path); @@ -501,8 +519,8 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event) if(stream.fail()) requiredValue = 0; } // TODO: notify the user. - llinfos << "found marker " << ll_install_failed_marker_path() << llendl; - llinfos << "last install attempt failed" << llendl; + LL_INFOS("UpdaterService") << "found marker " << ll_install_failed_marker_path() << LL_ENDL;; + LL_INFOS("UpdaterService") << "last install attempt failed" << LL_ENDL;; LLFile::remove(ll_install_failed_marker_path()); LLSD event; @@ -514,7 +532,7 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event) } else { - mUpdateChecker.checkVersion(mProtocolVersion, mUrl, mPath, mChannel, mVersion); + mUpdateChecker.checkVersion(mUrl, mPath, mChannel, mVersion, mPlatformVersion, mUniqueId, mWillingToTest); setState(LLUpdaterService::CHECKING_FOR_UPDATE); } } @@ -559,13 +577,16 @@ LLUpdaterService::~LLUpdaterService() { } -void LLUpdaterService::initialize(const std::string& protocol_version, - const std::string& url, - const std::string& path, - const std::string& channel, - const std::string& version) +void LLUpdaterService::initialize(const std::string& url, + const std::string& path, + const std::string& channel, + const std::string& version, + const std::string& platform_version, + const unsigned char uniqueid[MD5HEX_STR_SIZE], + const bool& willing_to_test +) { - mImpl->initialize(protocol_version, url, path, channel, version); + mImpl->initialize(url, path, channel, version, platform_version, uniqueid, willing_to_test); } void LLUpdaterService::setCheckPeriod(unsigned int seconds) -- cgit v1.2.3 From 49ed1a4e32013cda716998784338a01b12c663ef Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 27 Feb 2013 17:40:39 -0500 Subject: finish changes to update handling, including notices of channel changes --- .../viewer_components/updater/llupdaterservice.cpp | 107 +++++++++++++-------- 1 file changed, 66 insertions(+), 41 deletions(-) (limited to 'indra/viewer_components/updater/llupdaterservice.cpp') diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index c6c89655d3..324b051b21 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -140,13 +140,9 @@ public: // LLUpdateChecker::Client: virtual void error(std::string const & message); - virtual void optionalUpdate(std::string const & newVersion, - LLURI const & uri, - std::string const & hash); - virtual void requiredUpdate(std::string const & newVersion, - LLURI const & uri, - std::string const & hash); - virtual void upToDate(void); + + // A successful response was received from the viewer version manager + virtual void response(LLSD const & content); // LLUpdateDownloader::Client void downloadComplete(LLSD const & data); @@ -155,6 +151,7 @@ public: bool onMainLoop(LLSD const & event); private: + std::string mNewChannel; std::string mNewVersion; void restartTimer(unsigned int seconds); @@ -334,9 +331,13 @@ bool LLUpdaterServiceImpl::checkForInstall(bool launchInstaller) if((result == 0) && mAppExitCallback) { mAppExitCallback(); - } else if(result != 0) { + } + else if(result != 0) + { LL_WARNS("UpdaterService") << "failed to run update install script" << LL_ENDL; - } else { + } + else + { ; // No op. } } @@ -364,6 +365,7 @@ bool LLUpdaterServiceImpl::checkForResume() { mIsDownloading = true; mNewVersion = download_info["update_version"].asString(); + mNewChannel = download_info["update_channel"].asString(); mUpdateDownloader.resume(); result = true; } @@ -372,7 +374,10 @@ bool LLUpdaterServiceImpl::checkForResume() // The viewer that started this download is not the same as this viewer; ignore. LL_INFOS("UpdaterService") << "ignoring partial download from different viewer version" << LL_ENDL;; std::string path = download_info["path"].asString(); - if(!path.empty()) LLFile::remove(path); + if(!path.empty()) + { + LLFile::remove(path); + } LLFile::remove(download_marker_path); } } @@ -389,36 +394,43 @@ void LLUpdaterServiceImpl::error(std::string const & message) } } -void LLUpdaterServiceImpl::optionalUpdate(std::string const & newVersion, - LLURI const & uri, - std::string const & hash) -{ - stopTimer(); - mNewVersion = newVersion; - mIsDownloading = true; - setState(LLUpdaterService::DOWNLOADING); - mUpdateDownloader.download(uri, hash, newVersion, false); -} - -void LLUpdaterServiceImpl::requiredUpdate(std::string const & newVersion, - LLURI const & uri, - std::string const & hash) -{ - stopTimer(); - mNewVersion = newVersion; - mIsDownloading = true; - setState(LLUpdaterService::DOWNLOADING); - mUpdateDownloader.download(uri, hash, newVersion, true); -} - -void LLUpdaterServiceImpl::upToDate(void) +// A successful response was received from the viewer version manager +void LLUpdaterServiceImpl::response(LLSD const & content) { - if(mIsChecking) + if(!content.asBoolean()) // an empty response means "no update" { - restartTimer(mCheckPeriod); - } + LL_INFOS("UpdaterService") << "up to date" << LL_ENDL; + if(mIsChecking) + { + restartTimer(mCheckPeriod); + } - setState(LLUpdaterService::UP_TO_DATE); + setState(LLUpdaterService::UP_TO_DATE); + } + else + { + // there is an update available... + stopTimer(); + mNewChannel = content["channel"].asString(); + if (mNewChannel.empty()) + { + LL_INFOS("UpdaterService") << "no channel supplied, assuming current channel" << LL_ENDL; + mNewChannel = mChannel; + } + mNewVersion = content["version"].asString(); + mIsDownloading = true; + setState(LLUpdaterService::DOWNLOADING); + BOOL required = content["required"].asBoolean(); + LLURI url(content["url"].asString()); + std::string more_info = content["more_info"].asString(); + LL_DEBUGS("UpdaterService") + << "Starting download of " + << ( required ? "required" : "optional" ) << " update " + << "to channel '" << mNewChannel << "' version " << mNewVersion + << "more info '" << more_info << "'" + << LL_ENDL; + mUpdateDownloader.download(url, content["hash"].asString(), mNewChannel, mNewVersion, more_info, required); + } } void LLUpdaterServiceImpl::downloadComplete(LLSD const & data) @@ -436,9 +448,19 @@ void LLUpdaterServiceImpl::downloadComplete(LLSD const & data) payload["type"] = LLSD(LLUpdaterService::DOWNLOAD_COMPLETE); payload["required"] = data["required"]; payload["version"] = mNewVersion; + payload["channel"] = mNewChannel; + payload["info_url"] = data["info_url"]; event["payload"] = payload; + LL_DEBUGS("UpdaterService") + << "Download complete " + << ( data["required"].asBoolean() ? "required" : "optional" ) + << "channel " << mNewChannel + << "version " << mNewVersion + << "info " << data["info_url"].asString() + << LL_ENDL; + LLEventPumps::instance().obtain("mainlooprepeater").post(event); - + setState(LLUpdaterService::TERMINAL); } @@ -512,15 +534,18 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event) // Check for failed install. if(LLFile::isfile(ll_install_failed_marker_path())) { + LL_DEBUGS("UpdaterService") << "found marker " << ll_install_failed_marker_path() << LL_ENDL;; int requiredValue = 0; { llifstream stream(ll_install_failed_marker_path()); stream >> requiredValue; - if(stream.fail()) requiredValue = 0; + if(stream.fail()) + { + requiredValue = 0; + } } // TODO: notify the user. - LL_INFOS("UpdaterService") << "found marker " << ll_install_failed_marker_path() << LL_ENDL;; - LL_INFOS("UpdaterService") << "last install attempt failed" << LL_ENDL;; + LL_WARNS("UpdaterService") << "last install attempt failed" << LL_ENDL;; LLFile::remove(ll_install_failed_marker_path()); LLSD event; -- cgit v1.2.3 From 4de02b061411a6647b364754f937de3cfd111810 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 6 Mar 2013 17:39:03 -0500 Subject: more cosmetic logging improvements --- indra/viewer_components/updater/llupdaterservice.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/viewer_components/updater/llupdaterservice.cpp') diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index c1e57122ee..cac6f191df 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -429,9 +429,9 @@ void LLUpdaterServiceImpl::response(LLSD const & content) std::string more_info = content["more_info"].asString(); LL_DEBUGS("UpdaterService") << "Starting download of " - << ( required ? "required" : "optional" ) << " update " - << "to channel '" << mNewChannel << "' version " << mNewVersion - << "more info '" << more_info << "'" + << ( required ? "required" : "optional" ) << " update" + << " to channel '" << mNewChannel << "' version " << mNewVersion + << " more info '" << more_info << "'" << LL_ENDL; mUpdateDownloader.download(url, content["hash"].asString(), mNewChannel, mNewVersion, more_info, required); } @@ -458,9 +458,9 @@ void LLUpdaterServiceImpl::downloadComplete(LLSD const & data) LL_DEBUGS("UpdaterService") << "Download complete " << ( data["required"].asBoolean() ? "required" : "optional" ) - << "channel " << mNewChannel - << "version " << mNewVersion - << "info " << data["info_url"].asString() + << " channel " << mNewChannel + << " version " << mNewVersion + << " info " << data["info_url"].asString() << LL_ENDL; LLEventPumps::instance().obtain("mainlooprepeater").post(event); -- cgit v1.2.3 From c17db85e73a91c145d6eebe36b3b05e2289deae0 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 27 Mar 2013 13:20:48 -0400 Subject: add platform and platform version to login request parameters for new version manager query --- indra/viewer_components/updater/llupdaterservice.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/viewer_components/updater/llupdaterservice.cpp') diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index cac6f191df..1bd9fa4fc0 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -97,6 +97,7 @@ class LLUpdaterServiceImpl : std::string mPath; std::string mChannel; std::string mVersion; + std::string mPlatform; std::string mPlatformVersion; unsigned char mUniqueId[MD5HEX_STR_SIZE]; bool mWillingToTest; @@ -123,6 +124,7 @@ public: const std::string& path, 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 @@ -185,7 +187,8 @@ void LLUpdaterServiceImpl::initialize(const std::string& url, const std::string& path, const std::string& channel, const std::string& version, - const std::string & platform_version, + const std::string& platform, + const std::string& platform_version, const unsigned char uniqueid[MD5HEX_STR_SIZE], const bool& willing_to_test) { @@ -199,6 +202,7 @@ void LLUpdaterServiceImpl::initialize(const std::string& url, mPath = path; mChannel = channel; mVersion = version; + mPlatform = platform; mPlatformVersion = platform_version; memcpy(mUniqueId, uniqueid, MD5HEX_STR_SIZE); mWillingToTest = willing_to_test; @@ -561,7 +565,7 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event) } else { - mUpdateChecker.checkVersion(mUrl, mPath, mChannel, mVersion, mPlatformVersion, mUniqueId, mWillingToTest); + mUpdateChecker.checkVersion(mUrl, mPath, mChannel, mVersion, mPlatform, mPlatformVersion, mUniqueId, mWillingToTest); setState(LLUpdaterService::CHECKING_FOR_UPDATE); } } @@ -610,12 +614,13 @@ void LLUpdaterService::initialize(const std::string& url, const std::string& path, 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 ) { - mImpl->initialize(url, path, channel, version, platform_version, uniqueid, willing_to_test); + mImpl->initialize(url, path, channel, version, platform, platform_version, uniqueid, willing_to_test); } void LLUpdaterService::setCheckPeriod(unsigned int seconds) -- cgit v1.2.3 From bf6182daa8b4d7cea79310547f71d7a3155e17b0 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 29 Mar 2013 07:50:08 -0700 Subject: Update Mac and Windows breakpad builds to latest --- indra/viewer_components/updater/llupdaterservice.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/viewer_components/updater/llupdaterservice.cpp (limited to 'indra/viewer_components/updater/llupdaterservice.cpp') diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp old mode 100644 new mode 100755 -- cgit v1.2.3