Fixed bugs in installing per-user startup programs on windows 95

family.
This commit is contained in:
crs 2004-03-28 14:05:31 +00:00
parent e2a31e8b66
commit d2f4cbf002
4 changed files with 16 additions and 8 deletions

View File

@ -122,7 +122,12 @@ CAutoStart::update()
// update messages // update messages
CString msg, label; CString msg, label;
if (canInstallSystem) { 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) { else if (canInstallUser) {
msg = getString(IDS_AUTOSTART_PERMISSION_USER); msg = getString(IDS_AUTOSTART_PERMISSION_USER);

View File

@ -319,7 +319,7 @@ END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
BEGIN BEGIN
IDS_AUTOSTART_PERMISSION_SYSTEM 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 IDS_AUTOSTART_PERMISSION_USER
"You have sufficient access rights to install and uninstall Auto Start for just yourself." "You have sufficient access rights to install and uninstall Auto Start for just yourself."
IDS_AUTOSTART_PERMISSION_NONE IDS_AUTOSTART_PERMISSION_NONE
@ -335,8 +335,8 @@ BEGIN
IDS_INSTALL_GENERIC_ERROR "Install failed: %{1}" IDS_INSTALL_GENERIC_ERROR "Install failed: %{1}"
IDS_UNINSTALL_GENERIC_ERROR "Uninstall failed: %{1}" IDS_UNINSTALL_GENERIC_ERROR "Uninstall failed: %{1}"
IDS_INSTALL_TITLE "Installed Auto-Start" 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_SYSTEM "Installed auto-start. Synergy will 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_USER "Installed auto-start. Synergy will automatically start each time you log in."
END END
STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE
@ -349,6 +349,8 @@ BEGIN
IDS_ADD_SCREEN "Add Screen" IDS_ADD_SCREEN "Add Screen"
IDS_EDIT_SCREEN "Edit Screen %{1}" IDS_EDIT_SCREEN "Edit Screen %{1}"
IDS_ERROR_CODE "Error code: %{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 END
#endif // English (U.S.) resources #endif // English (U.S.) resources

View File

@ -42,6 +42,7 @@
#define IDS_EDIT_SCREEN 38 #define IDS_EDIT_SCREEN 38
#define IDS_INVALID_TIME 39 #define IDS_INVALID_TIME 39
#define IDS_ERROR_CODE 39 #define IDS_ERROR_CODE 39
#define IDS_AUTOSTART_PERMISSION_ALL 40
#define IDD_MAIN 101 #define IDD_MAIN 101
#define IDD_ADD 102 #define IDD_ADD 102
#define IDD_WAIT 103 #define IDD_WAIT 103

View File

@ -88,7 +88,7 @@ CArchDaemonWindows::installDaemon(const char* name,
// key. if windows 95 family then use windows 95 services key. // key. if windows 95 family then use windows 95 services key.
if (!allUsers || CArchMiscWindows::isWindows95Family()) { if (!allUsers || CArchMiscWindows::isWindows95Family()) {
// open registry // open registry
HKEY key = CArchMiscWindows::isWindows95Family() ? HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ?
open95ServicesKey() : openUserStartupKey(); open95ServicesKey() : openUserStartupKey();
if (key == NULL) { if (key == NULL) {
// can't open key // 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. // key. if windows 95 family then use windows 95 services key.
if (!allUsers || CArchMiscWindows::isWindows95Family()) { if (!allUsers || CArchMiscWindows::isWindows95Family()) {
// open registry // open registry
HKEY key = CArchMiscWindows::isWindows95Family() ? HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ?
open95ServicesKey() : openUserStartupKey(); open95ServicesKey() : openUserStartupKey();
if (key == NULL) { if (key == NULL) {
// can't open key. daemon is probably not installed. // 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. // key. if windows 95 family then use windows 95 services key.
if (!allUsers || CArchMiscWindows::isWindows95Family()) { if (!allUsers || CArchMiscWindows::isWindows95Family()) {
// check if we can open the registry key // check if we can open the registry key
HKEY key = CArchMiscWindows::isWindows95Family() ? HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ?
open95ServicesKey() : openUserStartupKey(); open95ServicesKey() : openUserStartupKey();
CArchMiscWindows::closeKey(key); CArchMiscWindows::closeKey(key);
return (key != NULL); 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. // key. if windows 95 family then use windows 95 services key.
if (!allUsers || CArchMiscWindows::isWindows95Family()) { if (!allUsers || CArchMiscWindows::isWindows95Family()) {
// check if we can open the registry key // check if we can open the registry key
HKEY key = CArchMiscWindows::isWindows95Family() ? HKEY key = (allUsers && CArchMiscWindows::isWindows95Family()) ?
open95ServicesKey() : openUserStartupKey(); open95ServicesKey() : openUserStartupKey();
if (key == NULL) { if (key == NULL) {
return false; return false;