changeset 920:e48ad80c3aca

Merged.
author Emanuel Schuetze <emanuel@intevation.de>
date Thu, 21 Aug 2014 13:58:59 +0200
parents e15637472a99 (current diff) e5fd2d0cf42f (diff)
children 419cf0560d45
files
diffstat 5 files changed, 43 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Thu Aug 21 13:58:33 2014 +0200
+++ b/CMakeLists.txt	Thu Aug 21 13:58:59 2014 +0200
@@ -10,7 +10,7 @@
 
 option(DO_RELEASE_BUILD "Build for a public release." OFF)
 option(ENABLE_PROFILING "Set to enable profiling." OFF)
-option(USE_CURL "Use libcurl to download updates and certificate lists." ON)
+option(USE_CURL "Use libcurl to download updates and certificate lists." UNIX)
 
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
 
--- a/packaging/linux-installer.inc.in	Thu Aug 21 13:58:33 2014 +0200
+++ b/packaging/linux-installer.inc.in	Thu Aug 21 13:58:59 2014 +0200
@@ -304,6 +304,7 @@
 
   getxt "Removing TrustBridge from autostart\n"
   rm_files "${autostart_path}/trustbridge.desktop"
+  update-desktop-database 2>&1 || true
 
   getxt "Removing TrustBridge from start menu\n"
   rm_files "${startmenu_path}/trustbridge.desktop"
--- a/packaging/trustbridge.nsi	Thu Aug 21 13:58:33 2014 +0200
+++ b/packaging/trustbridge.nsi	Thu Aug 21 13:58:59 2014 +0200
@@ -80,7 +80,7 @@
 !define MUI_FINISHPAGE_NOAUTOCLOSE
 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
 
-!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
+!define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
 !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${productname_short}"
 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
 
@@ -143,10 +143,25 @@
   !endif
 
   ${IfNot} ${AtLeastWinVista}
-    MessageBox MB_OK "Windows XP und ältere Windows Versionen werden von dieser Anwendung nicht unterstützt."
+    MessageBox MB_ICONSTOP "Windows XP und ältere Windows Versionen werden von dieser Anwendung nicht unterstützt."
     Quit
   ${Endif}
 
+  UserInfo::GetAccountType
+  pop $0
+  ${If} $0 != "admin"
+    MessageBox MB_ICONINFORMATION|MB_YESNO "\
+Sie sind im Begriff ${productname} ohne Administratorrechte zu installieren. $\r$\n\
+$\r$\n\
+Ohne Administratorrechte werden Sie von Windows zur Bestätigung jeder Zertifikatsänderung einzeln aufgefordert. $\r$\n$\r$\n\
+Wenn Sie die Möglichkeit besitzen Administratorrechte auf diesem System zu erlangen wird daher dazu geraten diesen Installer erneut mit der Funktion \
+'Als Administrator ausführen' zu starten.  $\r$\n$\r$\n\
+Möchten Sie die Installation ohne Administratorrechte fortsetzen?" /SD IDYES IDYES goOn IDNO stopNow
+    stopNow:
+      Quit
+    goOn:
+  ${EndIf}
+
   Var /GLOBAL is_update
   Var /GLOBAL changed_dir
   ${GetParameters} $R0
@@ -233,6 +248,8 @@
   WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \
                  "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
 
+  ; Below this is HKCU only!
+  SetShellVarContext current
   !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 
   ;Create shortcuts
@@ -257,8 +274,7 @@
 
   !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
 
-  Delete "$SMPROGRAMS\$StartMenuFolder\${productname}.lnk"
-  RMDir "$SMPROGRAMS\$StartMenuFolder"
+  DeleteRegValue SHCTX "Software\${productname_short}" "Start Menu Folder"
 
   DeleteRegKey /ifempty SHCTX "Software\${productname_short}"
 
@@ -270,5 +286,12 @@
 
 ; Remove uninstaller
   DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}"
+
+  ; Below this is HKCU only!
+  SetShellVarContext current
+
+  Delete "$SMPROGRAMS\$StartMenuFolder\${productname}.lnk"
+  RMDir "$SMPROGRAMS\$StartMenuFolder"
+
 SectionEnd
 !endif
--- a/ui/mainwindow.cpp	Thu Aug 21 13:58:33 2014 +0200
+++ b/ui/mainwindow.cpp	Thu Aug 21 13:58:59 2014 +0200
@@ -1158,6 +1158,15 @@
     unselected << mInstallList->unselectedCertificates();
     unselected << mRemoveList->unselectedCertificates();
 
+#ifdef Q_OS_WIN
+    if (!is_admin() || !is_system_install()) {
+        QMessageBox::information(this,
+                tr("Installation as normal user."),
+                tr("TrustBridge does not have the necessary privileges to install the certificates silently.") + "\n" +
+                tr("Windows will explicitly ask you to verify every modification TrustBridge intends to make."));
+    }
+#endif
+
     QProgressDialog *progress = new QProgressDialog(this);
     progress->setWindowModality(Qt::WindowModal);
     progress->setLabelText(tr("Installing certificates..."));
--- a/ui/sslconnection_bare.cpp	Thu Aug 21 13:58:33 2014 +0200
+++ b/ui/sslconnection_bare.cpp	Thu Aug 21 13:58:59 2014 +0200
@@ -438,6 +438,11 @@
 
     ret = write(getRequest.toUtf8());
 
+    if (ret != 0) {
+        qDebug() << "Failed to send request.";
+        return false;
+    }
+
     // Open / Create the file to write to.
     if (!outputFile.open(QIODevice::WriteOnly)) {
         qDebug() << "Failed to open file";

http://wald.intevation.org/projects/trustbridge/