Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions indra/llcommon/workqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ LL::WorkQueueBase::WorkQueueBase(const std::string& name, bool auto_shutdown)
{
// Register for "LLApp" events so we can implicitly close() on viewer shutdown
std::string listener_name = "WorkQueue:" + getKey();
LLEventPumps::instance().obtain("LLApp").listen(
LLEventPumps* pump = LLEventPumps::getInstance();
pump->obtain("LLApp").listen(
listener_name,
[this](const LLSD& stat)
{
Expand All @@ -54,14 +55,25 @@ LL::WorkQueueBase::WorkQueueBase(const std::string& name, bool auto_shutdown)

// Store the listener name so we can unregister in the destructor
mListenerName = listener_name;
mPumpHandle = pump->getHandle();
}
}

LL::WorkQueueBase::~WorkQueueBase()
{
if (!mListenerName.empty() && !LLEventPumps::wasDeleted())
if (!mListenerName.empty() && !mPumpHandle.isDead())
{
LLEventPumps::instance().obtain("LLApp").stopListening(mListenerName);
// Due to shutdown order issues, use handle, not a singleton
// and ignore fiber issue.
try
{
LLEventPumps* pump = mPumpHandle.get();
pump->obtain("LLApp").stopListening(mListenerName);
}
catch (const boost::fibers::lock_error&)
{
// Likely mutex is down, ignore
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions indra/llcommon/workqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include "llcoros.h"
#include "llexception.h"
#include "llhandle.h"
#include "llinstancetracker.h"
#include "llinstancetrackersubclass.h"
#include "threadsafeschedule.h"
Expand All @@ -22,6 +23,9 @@
#include <functional> // std::function
#include <string>

class LLEventPumps;


namespace LL
{

Expand Down Expand Up @@ -202,6 +206,8 @@ namespace LL

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

/*****************************************************************************
Expand Down
8 changes: 8 additions & 0 deletions indra/newview/llappviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,15 @@ const std::string LOGOUT_MARKER_FILE_NAME("SecondLife.logout_marker");
static std::string gLaunchFileOnQuit;

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

//----------------------------------------------------------------------------

Expand Down
14 changes: 14 additions & 0 deletions indra/newview/llappviewerwin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,20 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
if (!velopack_initialize())
{
// Velopack handled the invocation (install/uninstall hook)

// Drop install related settings
gDirUtilp->initAppDirs("SecondLife");

std::string user_settings_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml");
LLControlGroup settings("global");
if (settings.loadFromFile(user_settings_path))
{
if (settings.controlExists("LastInstallVersion"))
{
settings.setString("LastInstallVersion", std::string());
}
settings.saveToFile(user_settings_path, true);
}
return 0;
}
#endif
Expand Down
17 changes: 12 additions & 5 deletions indra/newview/llstartup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2619,18 +2619,25 @@ void release_notes_coro(const std::string url)
void uninstall_nsis_if_required()
{
#if LL_VELOPACK && LL_WINDOWS
// Todo: perhaps use marker files?
// Debug variable isn't specific to one channel
// and something channel specific is needed.
std::string last_install_ver = gSavedSettings.getString("LastInstallVersion");
LLVersionInfo* ver_inst = LLVersionInfo::getInstance();
if (ver_inst->getChannelAndVersion() == last_install_ver)
if (!last_install_ver.empty())
{
return;
}
LLVersionInfo* ver_inst = LLVersionInfo::getInstance();
gSavedSettings.setString("LastInstallVersion",
ver_inst->getChannelAndVersion());

if (LLNotifications::instance().getIgnored("PromptRemoveNsisInstallation"))
{
// By default 'ignore' returns default button, which is uninstall
// for PromptRemoveNsisInstallation, but while we want the button
// to be the default, we don't want a scary UAC without a notice
// as a default action, so if this notification is ignored,
// we will treat it as if user is going to cancel the uninstall.
return;
}

LL_INFOS() << "Looking for previous NSIS installs" << LL_ENDL;

wchar_t buffer[MAX_PATH];
Expand Down
3 changes: 2 additions & 1 deletion indra/newview/skins/default/xui/en/notifications.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ No tutorial is currently available.
The uninstaller may display additional prompts requesting permission to access or modify files on your disk.
<tag>confirm</tag>
<usetemplate
name="okcancelbuttons"
ignoretext="Ask to remove legacy installation"
name="okcancelignore"
notext="Cancel"
yestext="Uninstall"/>
</notification>
Expand Down
Loading