From d2f4cbf0026f35613385659decb5cc3f8ee4bed9 Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 28 Mar 2004 14:05:31 +0000 Subject: [PATCH] Fixed bugs in installing per-user startup programs on windows 95 family. --- cmd/launcher/CAutoStart.cpp | 7 ++++++- cmd/launcher/launcher.rc | 8 +++++--- cmd/launcher/resource.h | 1 + lib/arch/CArchDaemonWindows.cpp | 8 ++++---- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/cmd/launcher/CAutoStart.cpp b/cmd/launcher/CAutoStart.cpp index 13910634..66fb3fd0 100644 --- a/cmd/launcher/CAutoStart.cpp +++ b/cmd/launcher/CAutoStart.cpp @@ -122,7 +122,12 @@ CAutoStart::update() // update messages CString msg, label; if (canInstallSystem) { - msg = getString(IDS_AUTOSTART_PERMISSION_SYSTEM); + if (canInstallUser) { + msg = getString(IDS_AUTOSTART_PERMISSION_ALL); + } + else { + msg = getString(IDS_AUTOSTART_PERMISSION_SYSTEM); + } } else if (canInstallUser) { msg = getString(IDS_AUTOSTART_PERMISSION_USER); diff --git a/cmd/launcher/launcher.rc b/cmd/launcher/launcher.rc index 0a5ceb01..9d4b6ca5 100644 --- a/cmd/launcher/launcher.rc +++ b/cmd/launcher/launcher.rc @@ -319,7 +319,7 @@ END STRINGTABLE DISCARDABLE BEGIN IDS_AUTOSTART_PERMISSION_SYSTEM - "You have sufficient access rights to install and uninstall Auto Start for all users or for just yourself." + "You have sufficient access rights to install and uninstall Auto Start for all users." IDS_AUTOSTART_PERMISSION_USER "You have sufficient access rights to install and uninstall Auto Start for just yourself." IDS_AUTOSTART_PERMISSION_NONE @@ -335,8 +335,8 @@ BEGIN IDS_INSTALL_GENERIC_ERROR "Install failed: %{1}" IDS_UNINSTALL_GENERIC_ERROR "Uninstall failed: %{1}" IDS_INSTALL_TITLE "Installed Auto-Start" - IDS_INSTALLED_SYSTEM "Installed auto-start. Synergy will now automatically start each time you start your computer." - IDS_INSTALLED_USER "Installed auto-start. Synergy will now automatically start each time you log in." + IDS_INSTALLED_SYSTEM "Installed auto-start. Synergy will automatically start each time you start your computer." + IDS_INSTALLED_USER "Installed auto-start. Synergy will automatically start each time you log in." END STRINGTABLE DISCARDABLE @@ -349,6 +349,8 @@ BEGIN IDS_ADD_SCREEN "Add Screen" IDS_EDIT_SCREEN "Edit Screen %{1}" IDS_ERROR_CODE "Error code: %{1}" + IDS_AUTOSTART_PERMISSION_ALL + "You have sufficient access rights to install and uninstall Auto Start for all users or for just yourself." END #endif // English (U.S.) resources diff --git a/cmd/launcher/resource.h b/cmd/launcher/resource.h index 3ef98665..3044c2d5 100644 --- a/cmd/launcher/resource.h +++ b/cmd/launcher/resource.h @@ -42,6 +42,7 @@ #define IDS_EDIT_SCREEN 38 #define IDS_INVALID_TIME 39 #define IDS_ERROR_CODE 39 +#define IDS_AUTOSTART_PERMISSION_ALL 40 #define IDD_MAIN 101 #define IDD_ADD 102 #define IDD_WAIT 103 diff --git a/lib/arch/CArchDaemonWindows.cpp b/lib/arch/CArchDaemonWindows.cpp index edca9385..d702cb99 100644 --- a/lib/arch/CArchDaemonWindows.cpp +++ b/lib/arch/CArchDaemonWindows.cpp @@ -88,7 +88,7 @@ CArchDaemonWindows::installDaemon(const char* name, // key. if windows 95 family then use windows 95 services key. if (!allUsers || CArchMiscWindows::isWindows95Family()) { // open registry - HKEY key = CArchMiscWindows::isWindows95Family() ? + HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ? open95ServicesKey() : openUserStartupKey(); if (key == NULL) { // can't open key @@ -191,7 +191,7 @@ CArchDaemonWindows::uninstallDaemon(const char* name, bool allUsers) // key. if windows 95 family then use windows 95 services key. if (!allUsers || CArchMiscWindows::isWindows95Family()) { // open registry - HKEY key = CArchMiscWindows::isWindows95Family() ? + HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ? open95ServicesKey() : openUserStartupKey(); if (key == NULL) { // can't open key. daemon is probably not installed. @@ -322,7 +322,7 @@ CArchDaemonWindows::canInstallDaemon(const char* name, bool allUsers) // key. if windows 95 family then use windows 95 services key. if (!allUsers || CArchMiscWindows::isWindows95Family()) { // check if we can open the registry key - HKEY key = CArchMiscWindows::isWindows95Family() ? + HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ? open95ServicesKey() : openUserStartupKey(); CArchMiscWindows::closeKey(key); return (key != NULL); @@ -354,7 +354,7 @@ CArchDaemonWindows::isDaemonInstalled(const char* name, bool allUsers) // key. if windows 95 family then use windows 95 services key. if (!allUsers || CArchMiscWindows::isWindows95Family()) { // check if we can open the registry key - HKEY key = CArchMiscWindows::isWindows95Family() ? + HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ? open95ServicesKey() : openUserStartupKey(); if (key == NULL) { return false;