From a1e9542350cc617412781af88d5b33133d4be8f4 Mon Sep 17 00:00:00 2001 From: Victor Tran Date: Fri, 13 Jul 2018 21:43:04 +1000 Subject: Uninstall from Control Panel works now --- installer/process/installworker.cpp | 14 +++++++------- installer/process/removeworker.cpp | 1 - 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'installer/process') diff --git a/installer/process/installworker.cpp b/installer/process/installworker.cpp index e7708ad..581deb3 100644 --- a/installer/process/installworker.cpp +++ b/installer/process/installworker.cpp @@ -103,8 +103,8 @@ bool InstallWorker::startWork() { dataRoot.insert("appurl", url); //Write uninstall information to registry - QUuid uuid = QUuid::createUuid(); - dataRoot.insert("registryUuid", uuid.toString()); + //QUuid uuid = QUuid::createUuid(); + dataRoot.insert("registryUuid", name); /*HKEY SoftwareEntry; HKEY hive; LPCWSTR keyPath = (LPCWSTR) QString("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + uuid.toString()).utf16(); @@ -128,17 +128,17 @@ bool InstallWorker::startWork() { QSettings* settings; if (isGlobalInstall) { - settings = new QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + uuid.toString(), QSettings::NativeFormat); + settings = new QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + name, QSettings::NativeFormat); } else { - settings = new QSettings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + uuid.toString(), QSettings::NativeFormat); + settings = new QSettings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + name, QSettings::NativeFormat); } settings->setValue("DisplayName", name); settings->setValue("Publisher", vendor); settings->setValue("Contact", vendor); - settings->setValue("ModifyPath", dest.absoluteFilePath("uninstall.exe")); - settings->setValue("UninstallString", dest.absoluteFilePath("uninstall.exe")); - settings->setValue("InstallDate", QDateTime::currentDateTime().toString("yyyymmdd")); + settings->setValue("ModifyPath", "\"" + dest.absoluteFilePath("uninstall.exe").replace("/", "\\") + "\""); + settings->setValue("UninstallString", "\"" + dest.absoluteFilePath("uninstall.exe").replace("/", "\\") + "\""); + settings->setValue("InstallDate", QDateTime::currentDateTime().toString("yyyyMMdd")); settings->setValue("InstallLocation", dest.path()); settings->setValue("DisplayIcon", executableFile.absoluteFilePath() + ",0"); settings->sync(); diff --git a/installer/process/removeworker.cpp b/installer/process/removeworker.cpp index 2bca275..5356f26 100644 --- a/installer/process/removeworker.cpp +++ b/installer/process/removeworker.cpp @@ -75,7 +75,6 @@ bool RemoveWorker::startWork() { dest.removeRecursively(); //Remove registry entry - QSettings* settings; if (metadata.value("global").toBool()) { settings = new QSettings("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall", QSettings::NativeFormat); -- cgit v1.2.3