Skip to content

Commit e3592e5

Browse files
committed
Merge branch 'release/26.1.1' of https://github.com/secondlife/viewer into release/26.1.1
2 parents bbce47f + ebe25a7 commit e3592e5

File tree

7 files changed

+62
-11
lines changed

7 files changed

+62
-11
lines changed

indra/llcommon/workqueue.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ LL::WorkQueueBase::WorkQueueBase(const std::string& name, bool auto_shutdown)
3838
{
3939
// Register for "LLApp" events so we can implicitly close() on viewer shutdown
4040
std::string listener_name = "WorkQueue:" + getKey();
41-
LLEventPumps::instance().obtain("LLApp").listen(
41+
LLEventPumps* pump = LLEventPumps::getInstance();
42+
pump->obtain("LLApp").listen(
4243
listener_name,
4344
[this](const LLSD& stat)
4445
{
@@ -54,14 +55,25 @@ LL::WorkQueueBase::WorkQueueBase(const std::string& name, bool auto_shutdown)
5455

5556
// Store the listener name so we can unregister in the destructor
5657
mListenerName = listener_name;
58+
mPumpHandle = pump->getHandle();
5759
}
5860
}
5961

6062
LL::WorkQueueBase::~WorkQueueBase()
6163
{
62-
if (!mListenerName.empty() && !LLEventPumps::wasDeleted())
64+
if (!mListenerName.empty() && !mPumpHandle.isDead())
6365
{
64-
LLEventPumps::instance().obtain("LLApp").stopListening(mListenerName);
66+
// Due to shutdown order issues, use handle, not a singleton
67+
// and ignore fiber issue.
68+
try
69+
{
70+
LLEventPumps* pump = mPumpHandle.get();
71+
pump->obtain("LLApp").stopListening(mListenerName);
72+
}
73+
catch (const boost::fibers::lock_error&)
74+
{
75+
// Likely mutex is down, ignore
76+
}
6577
}
6678
}
6779

indra/llcommon/workqueue.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "llcoros.h"
1616
#include "llexception.h"
17+
#include "llhandle.h"
1718
#include "llinstancetracker.h"
1819
#include "llinstancetrackersubclass.h"
1920
#include "threadsafeschedule.h"
@@ -22,6 +23,9 @@
2223
#include <functional> // std::function
2324
#include <string>
2425

26+
class LLEventPumps;
27+
28+
2529
namespace LL
2630
{
2731

@@ -202,6 +206,8 @@ namespace LL
202206

203207
// Name used for the LLApp event listener (empty if not registered)
204208
std::string mListenerName;
209+
// Due to shutdown order issues, store by handle
210+
LLHandle<LLEventPumps> mPumpHandle;
205211
};
206212

207213
/*****************************************************************************

indra/newview/llappviewer.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,15 @@ const std::string LOGOUT_MARKER_FILE_NAME("SecondLife.logout_marker");
388388
static std::string gLaunchFileOnQuit;
389389

390390
// Used on Win32 for other apps to identify our window (eg, win_setup)
391+
#if LL_VELOPACK
392+
// Velopack is deliberately different fron NSIS to not prevent nsis uninstall
393+
const char* const VIEWER_WINDOW_CLASSNAME = "Second\u00A0Life"; // no break space
394+
#else
395+
// NSIS relies on this to detect if viewer is up.
396+
// NSIS's method is somewhat unreliable since window
397+
// can close long before cleanup is done
391398
const char* const VIEWER_WINDOW_CLASSNAME = "Second Life";
399+
#endif
392400

393401
//----------------------------------------------------------------------------
394402

indra/newview/llappviewerwin32.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,20 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
435435
if (!velopack_initialize())
436436
{
437437
// Velopack handled the invocation (install/uninstall hook)
438+
439+
// Drop install related settings
440+
gDirUtilp->initAppDirs("SecondLife");
441+
442+
std::string user_settings_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml");
443+
LLControlGroup settings("global");
444+
if (settings.loadFromFile(user_settings_path))
445+
{
446+
if (settings.controlExists("LastInstallVersion"))
447+
{
448+
settings.setString("LastInstallVersion", std::string());
449+
}
450+
settings.saveToFile(user_settings_path, true);
451+
}
438452
return 0;
439453
}
440454
#endif

indra/newview/llstartup.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2619,18 +2619,25 @@ void release_notes_coro(const std::string url)
26192619
void uninstall_nsis_if_required()
26202620
{
26212621
#if LL_VELOPACK && LL_WINDOWS
2622-
// Todo: perhaps use marker files?
2623-
// Debug variable isn't specific to one channel
2624-
// and something channel specific is needed.
26252622
std::string last_install_ver = gSavedSettings.getString("LastInstallVersion");
2626-
LLVersionInfo* ver_inst = LLVersionInfo::getInstance();
2627-
if (ver_inst->getChannelAndVersion() == last_install_ver)
2623+
if (!last_install_ver.empty())
26282624
{
26292625
return;
26302626
}
2627+
LLVersionInfo* ver_inst = LLVersionInfo::getInstance();
26312628
gSavedSettings.setString("LastInstallVersion",
26322629
ver_inst->getChannelAndVersion());
26332630

2631+
if (LLNotifications::instance().getIgnored("PromptRemoveNsisInstallation"))
2632+
{
2633+
// By default 'ignore' returns default button, which is uninstall
2634+
// for PromptRemoveNsisInstallation, but while we want the button
2635+
// to be the default, we don't want a scary UAC without a notice
2636+
// as a default action, so if this notification is ignored,
2637+
// we will treat it as if user is going to cancel the uninstall.
2638+
return;
2639+
}
2640+
26342641
LL_INFOS() << "Looking for previous NSIS installs" << LL_ENDL;
26352642

26362643
wchar_t buffer[MAX_PATH];

indra/newview/llvelopack.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,10 @@ static void register_uninstall_info(const std::wstring& install_dir,
499499
const std::wstring& version)
500500
{
501501
std::wstring app_name_oneword = get_app_name_oneword();
502-
std::wstring key_path = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + app_name_oneword;
502+
// Use a unique key name to avoid conflicts with any existing NSIS-based uninstall info,
503+
// which can cause nly one of the two entries to show up in the Add/Remove Programs list.
504+
// The UI will show DisplayName, so the key name itself is not important to be user-friendly.
505+
std::wstring key_path = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Vlpk" + app_name_oneword;
503506
HKEY hkey;
504507

505508
if (RegCreateKeyExW(HKEY_CURRENT_USER, key_path.c_str(), 0, NULL,
@@ -547,7 +550,7 @@ static void register_uninstall_info(const std::wstring& install_dir,
547550
static void unregister_uninstall_info()
548551
{
549552
std::wstring app_name_oneword = get_app_name_oneword();
550-
std::wstring key_path = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + app_name_oneword;
553+
std::wstring key_path = L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Vlpk" + app_name_oneword;
551554
RegDeleteTreeW(HKEY_CURRENT_USER, key_path.c_str());
552555
}
553556

indra/newview/skins/default/xui/en/notifications.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ No tutorial is currently available.
209209
The uninstaller may display additional prompts requesting permission to access or modify files on your disk.
210210
<tag>confirm</tag>
211211
<usetemplate
212-
name="okcancelbuttons"
212+
ignoretext="Ask to remove legacy installation"
213+
name="okcancelignore"
213214
notext="Cancel"
214215
yestext="Uninstall"/>
215216
</notification>

0 commit comments

Comments
 (0)