mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:58:10 +02:00
windows uninstall
This commit is contained in:
parent
130c727bee
commit
caa99c1d22
5 changed files with 40 additions and 33 deletions
|
@ -120,6 +120,8 @@ Item {
|
||||||
horizontalCenter: instruction.horizontalCenter
|
horizontalCenter: instruction.horizontalCenter
|
||||||
topMargin: 4
|
topMargin: 4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onAccepted: LauncherState.login(username.text, password.text, displayName.text)
|
||||||
}
|
}
|
||||||
|
|
||||||
HFButton {
|
HFButton {
|
||||||
|
|
1
launchers/qt/src/.#main.cpp
Normal file
1
launchers/qt/src/.#main.cpp
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Dante@DESKTOP-9JK5VFR.10856:1570152789
|
|
@ -8,6 +8,7 @@
|
||||||
#include "objbase.h"
|
#include "objbase.h"
|
||||||
#include "objidl.h"
|
#include "objidl.h"
|
||||||
#include "shlguid.h"
|
#include "shlguid.h"
|
||||||
|
#include <atlstr.h>
|
||||||
#include <tlhelp32.h>
|
#include <tlhelp32.h>
|
||||||
#include <strsafe.h>
|
#include <strsafe.h>
|
||||||
|
|
||||||
|
|
|
@ -47,42 +47,47 @@ void LauncherInstaller::install() {
|
||||||
qDebug() << "not successful";
|
qDebug() << "not successful";
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug() << "LauncherInstaller: create uninstall link";
|
deleteShortcuts();
|
||||||
QString uninstallLinkPath = _launcherInstallDir.absolutePath() + "/Uninstall HQ.lnk";
|
createShortcuts();
|
||||||
if (QFile::exists(uninstallLinkPath)) {
|
|
||||||
QFile::remove(uninstallLinkPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QString desktopPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
|
||||||
QString applicationPath = _launcherApplicationsDir.absolutePath();
|
|
||||||
|
|
||||||
QString appStartLinkPath = applicationPath + "/HQ.lnk";
|
|
||||||
QString uninstallAppStartLinkPath = applicationPath + "/Uninstall HQ.lnk";
|
|
||||||
QString desktopAppLinkPath = desktopPath + "/HQ.lnk";
|
|
||||||
|
|
||||||
|
|
||||||
createSymbolicLink((LPCSTR)oldLauncherPath.toStdString().c_str(), (LPCSTR)uninstallLinkPath.toStdString().c_str(),
|
|
||||||
(LPCSTR)("Click to Uninstall HQ"), (LPCSTR)("--uninstall"));
|
|
||||||
|
|
||||||
createSymbolicLink((LPCSTR)oldLauncherPath.toStdString().c_str(), (LPCSTR)uninstallAppStartLinkPath.toStdString().c_str(),
|
|
||||||
(LPCSTR)("Click to Uninstall HQ"), (LPCSTR)("--uninstall"));
|
|
||||||
|
|
||||||
createSymbolicLink((LPCSTR)oldLauncherPath.toStdString().c_str(), (LPCSTR)desktopAppLinkPath.toStdString().c_str(),
|
|
||||||
(LPCSTR)("Click to Setup and Launch HQ"));
|
|
||||||
|
|
||||||
createSymbolicLink((LPCSTR)oldLauncherPath.toStdString().c_str(), (LPCSTR)appStartLinkPath.toStdString().c_str(),
|
|
||||||
(LPCSTR)("Click to Setup and Launch HQ"));
|
|
||||||
|
|
||||||
createApplicationRegistryKeys();
|
createApplicationRegistryKeys();
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "FAILED!!!!!!!";
|
qDebug() << "Failed to install HQ Launcher";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LauncherInstaller::createShortcuts() {
|
||||||
|
QString launcherPath = _launcherInstallDir.absolutePath() + "/HQ Launcher.exe";
|
||||||
|
|
||||||
|
QString uninstallLinkPath = _launcherInstallDir.absolutePath() + "/Uninstall HQ.lnk";
|
||||||
|
QString desktopPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
||||||
|
QString applicationPath = _launcherApplicationsDir.absolutePath();
|
||||||
|
|
||||||
|
QString appStartLinkPath = applicationPath + "/HQ Launcher.lnk";
|
||||||
|
QString uninstallAppStartLinkPath = applicationPath + "/Uninstall HQ.lnk";
|
||||||
|
QString desktopAppLinkPath = desktopPath + "/HQ Launcher.lnk";
|
||||||
|
|
||||||
|
|
||||||
|
createSymbolicLink((LPCSTR)launcherPath.toStdString().c_str(), (LPCSTR)uninstallLinkPath.toStdString().c_str(),
|
||||||
|
(LPCSTR)("Click to Uninstall HQ"), (LPCSTR)("--uninstall"));
|
||||||
|
|
||||||
|
createSymbolicLink((LPCSTR)launcherPath.toStdString().c_str(), (LPCSTR)uninstallAppStartLinkPath.toStdString().c_str(),
|
||||||
|
(LPCSTR)("Click to Uninstall HQ"), (LPCSTR)("--uninstall"));
|
||||||
|
|
||||||
|
createSymbolicLink((LPCSTR)launcherPath.toStdString().c_str(), (LPCSTR)desktopAppLinkPath.toStdString().c_str(),
|
||||||
|
(LPCSTR)("Click to Setup and Launch HQ"));
|
||||||
|
|
||||||
|
createSymbolicLink((LPCSTR)launcherPath.toStdString().c_str(), (LPCSTR)appStartLinkPath.toStdString().c_str(),
|
||||||
|
(LPCSTR)("Click to Setup and Launch HQ"));
|
||||||
|
}
|
||||||
|
|
||||||
void LauncherInstaller::uninstall() {
|
void LauncherInstaller::uninstall() {
|
||||||
qDebug() << "Uninstall Launcher";
|
qDebug() << "Uninstall Launcher";
|
||||||
|
deleteShortcuts();
|
||||||
|
deleteApplicationRegistryKeys();
|
||||||
|
}
|
||||||
|
|
||||||
|
void LauncherInstaller::deleteShortcuts() {
|
||||||
QString desktopPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
QString desktopPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
||||||
QString applicationPath = _launcherApplicationsDir.absolutePath();
|
QString applicationPath = _launcherApplicationsDir.absolutePath();
|
||||||
|
|
||||||
|
@ -91,7 +96,7 @@ void LauncherInstaller::uninstall() {
|
||||||
QFile::remove(uninstallLinkPath);
|
QFile::remove(uninstallLinkPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString appStartLinkPath = applicationPath + "/HQ.lnk";
|
QString appStartLinkPath = applicationPath + "/HQ Launcher.lnk";
|
||||||
if (QFile::exists(appStartLinkPath)) {
|
if (QFile::exists(appStartLinkPath)) {
|
||||||
QFile::remove(appStartLinkPath);
|
QFile::remove(appStartLinkPath);
|
||||||
}
|
}
|
||||||
|
@ -101,12 +106,10 @@ void LauncherInstaller::uninstall() {
|
||||||
QFile::remove(uninstallAppStartLinkPath);
|
QFile::remove(uninstallAppStartLinkPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString desktopAppLinkPath = desktopPath + "/HQ.lnk";
|
QString desktopAppLinkPath = desktopPath + "/HQ Launcher.lnk";
|
||||||
if (QFile::exists(desktopAppLinkPath)) {
|
if (QFile::exists(desktopAppLinkPath)) {
|
||||||
QFile::remove(desktopAppLinkPath);
|
QFile::remove(desktopAppLinkPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteApplicationRegistryKeys();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ int main(int argc, char *argv[]) {
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
LauncherInstaller launcherInstaller(argv[0]);
|
LauncherInstaller launcherInstaller(argv[0]);
|
||||||
if (options->contains("--restart") || launcherInstaller.runningOutsideOfInstallDir()) {
|
if (options->contains("--restart") || launcherInstaller.runningOutsideOfInstallDir()) {
|
||||||
launcherInstaller.install();
|
launcherInstaller.install();
|
||||||
} else if (options->contains("--uninstall")) {
|
} else if (options->contains("--uninstall")) {
|
||||||
launcherInstaller.uninstall();
|
launcherInstaller.uninstall();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue