diff options
| -rw-r--r-- | installer/installer.pro | 3 | ||||
| -rw-r--r-- | installer/maintainwindow.cpp | 1 | ||||
| -rw-r--r-- | installer/maintainwindow.ui | 8 | ||||
| -rw-r--r-- | installer/mainwindow.cpp | 4 | ||||
| -rw-r--r-- | installer/process/installworker.cpp | 14 | ||||
| -rw-r--r-- | installer/process/removeworker.cpp | 1 | ||||
| -rw-r--r-- | installer/resources.qrc | 1 | ||||
| -rw-r--r-- | installer/translations/pt_BR.qm | bin | 0 -> 111 bytes |
8 files changed, 21 insertions, 11 deletions
diff --git a/installer/installer.pro b/installer/installer.pro index 1c2fd5f..396b087 100644 --- a/installer/installer.pro +++ b/installer/installer.pro @@ -188,7 +188,8 @@ FORMS += \ maintainwindow.ui TRANSLATIONS += \ - translations/vi_VN.ts + translations/vi_VN.ts \ + translations/pt_BR.ts win32 { #CONFIG += embed_manifest_exe diff --git a/installer/maintainwindow.cpp b/installer/maintainwindow.cpp index 447d3f5..8f8eb5b 100644 --- a/installer/maintainwindow.cpp +++ b/installer/maintainwindow.cpp @@ -32,6 +32,7 @@ MaintainWindow::MaintainWindow(QWidget *parent) : metadataFile.open(QFile::ReadOnly); metadata = QJsonDocument::fromJson(metadataFile.readAll()).object(); + this->setWindowTitle(tr("Modify %1").arg(metadata.value("name").toString())); ui->areYouSureText->setText(tr("Are you sure you want to uninstall %1?").arg(metadata.value("name").toString())); } diff --git a/installer/maintainwindow.ui b/installer/maintainwindow.ui index 35349ea..7bb57fa 100644 --- a/installer/maintainwindow.ui +++ b/installer/maintainwindow.ui @@ -13,6 +13,10 @@ <property name="windowTitle"> <string notr="true">Modify Application Name</string> </property> + <property name="windowIcon"> + <iconset resource="resources.qrc"> + <normaloff>:/icon.svg</normaloff>:/icon.svg</iconset> + </property> <widget class="QWidget" name="centralwidget"> <layout class="QVBoxLayout" name="verticalLayout"> <property name="leftMargin"> @@ -445,6 +449,8 @@ <container>1</container> </customwidget> </customwidgets> - <resources/> + <resources> + <include location="resources.qrc"/> + </resources> <connections/> </ui> diff --git a/installer/mainwindow.cpp b/installer/mainwindow.cpp index b02c45f..1e9b207 100644 --- a/installer/mainwindow.cpp +++ b/installer/mainwindow.cpp @@ -206,7 +206,9 @@ void MainWindow::on_installButton_clicked() QStringList psArgs; psArgs.append("-FilePath \"" + QApplication::applicationFilePath() + "\""); psArgs.append("-ArgumentList (" + args.join(",") + ")"); - psArgs.append("-Verb runAs"); + if (ui->installEveryone->isChecked()) { + psArgs.append("-Verb runAs"); + } psArgs.append("-PassThru"); psArgs.append("-Wait"); 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); diff --git a/installer/resources.qrc b/installer/resources.qrc index 661ed75..f7f5198 100644 --- a/installer/resources.qrc +++ b/installer/resources.qrc @@ -4,5 +4,6 @@ <file>icon-bp.svg</file> <file>background.svg</file> <file>translations/vi_VN.qm</file> + <file>translations/pt_BR.qm</file> </qresource> </RCC> diff --git a/installer/translations/pt_BR.qm b/installer/translations/pt_BR.qm Binary files differnew file mode 100644 index 0000000..c2e08c5 --- /dev/null +++ b/installer/translations/pt_BR.qm |
