# HG changeset patch # User Emanuel Schuetze # Date 1408622339 -7200 # Node ID e48ad80c3aca35af861adc9429926a0ab83cea32 # Parent e15637472a99082b798d5502de928e13e3d411b3# Parent e5fd2d0cf42fe8c3ccb48c4ada4a78c72ff8d49a Merged. diff -r e15637472a99 -r e48ad80c3aca CMakeLists.txt --- 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/") diff -r e15637472a99 -r e48ad80c3aca packaging/linux-installer.inc.in --- 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" diff -r e15637472a99 -r e48ad80c3aca packaging/trustbridge.nsi --- 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 diff -r e15637472a99 -r e48ad80c3aca ui/mainwindow.cpp --- 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...")); diff -r e15637472a99 -r e48ad80c3aca ui/sslconnection_bare.cpp --- 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";