Merge branch 'qt-launcher' of github.com:danteruiz/hifi into qt-launcher

This commit is contained in:
Ryan Huffman 2019-10-04 14:37:38 -07:00
commit a661d62959
4 changed files with 41 additions and 8 deletions

View file

@ -1,9 +1,8 @@
cmake_minimum_required(VERSION 3.10)
project(HQLauncher)
cmake_minimum_required(VERSION 3.0)
if (APPLE)
set(ENV{MACOSX_DEPLOYMENT_TARGET} 10.9)
set(ENV{MACOSX_DEPLOYMENT_TARGET} 10.10)
endif()
project(HQLauncher)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules")
include("cmake/macros/SetPackagingParameters.cmake")
@ -195,6 +194,8 @@ elseif (APPLE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${APP_NAME}.app/Contents/Resources"
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/resources/images "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${APP_NAME}.app/Contents/Resources/"
COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${APP_NAME}.app/Contents/MacOS/" ln -sf ./HQ\ Launcher updater
# Older versions of Launcher put updater in `/Contents/Resources/updater`.
COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${APP_NAME}.app/Contents/Resources" ln -sf ../MacOS/HQ\ Launcher updater

View file

@ -141,6 +141,8 @@ Item {
leftMargin: root.marginLeft
topMargin: 4
}
onAccepted: LauncherState.signup(email.text, username.text, passwordField.text, displayName.text)
}
HFButton {

View file

@ -42,10 +42,35 @@ void launchClient(const QString& clientPath, const QString& homePath, const QStr
void launchAutoUpdater(const QString& autoUpdaterPath) {
NSTask* task = [[NSTask alloc] init];
task.launchPath = [autoUpdaterPath.toNSString() stringByAppendingString:@"/Contents/Resources/updater"];
task.arguments = @[[[NSBundle mainBundle] bundlePath], autoUpdaterPath.toNSString()];
[task launch];
NSException *exception;
bool launched = false;
// Older versions of Launcher put updater in `/Contents/Resources/updater`.
NSString* newLauncher = autoUpdaterPath.toNSString();
for (NSString *bundlePath in @[@"/Contents/MacOS/updater",
@"/Contents/Resources/updater",
]) {
NSTask* task = [[NSTask alloc] init];
task.launchPath = [newLauncher stringByAppendingString: bundlePath];
task.arguments = @[[[NSBundle mainBundle] bundlePath], newLauncher];
NSLog(@"launching updater: %@ %@", task.launchPath, task.arguments);
@try {
[task launch];
}
@catch (NSException *e) {
NSLog(@"couldn't launch updater: %@, %@", e.name, e.reason);
exception = e;
continue;
}
launched = true;
break;
}
if (!launched) {
@throw exception;
}
exit(0);
}

View file

@ -84,6 +84,11 @@ void LauncherInstaller::createShortcuts() {
void LauncherInstaller::uninstall() {
qDebug() << "Uninstall Launcher";
deleteShortcuts();
QString launcherPath = _launcherInstallDir.absolutePath() + "/HQ Launcher.exe";
if (QFile::exists(launcherPath)) {
QFile::remove(launcherPath);
}
deleteApplicationRegistryKeys();
}