summaryrefslogtreecommitdiff
path: root/sql/winservice.c
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-03-12 12:14:04 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2012-03-12 12:14:04 +0100
commit3886fdf009874a472fa31c15c918c4a25d708e63 (patch)
tree79a7ed0c526684f3963fb5661eb36be983ec66c0 /sql/winservice.c
parent8c083498828cf1c2df017b23fa50eda8e961b455 (diff)
downloadmariadb-git-3886fdf009874a472fa31c15c918c4a25d708e63.tar.gz
LP952607: Do not show MySQL services preinstalled by Dell in the upgrade wizard
Diffstat (limited to 'sql/winservice.c')
-rw-r--r--sql/winservice.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/sql/winservice.c b/sql/winservice.c
index 3ec91c26835..f70f8018509 100644
--- a/sql/winservice.c
+++ b/sql/winservice.c
@@ -59,6 +59,41 @@ void normalize_path(char *path, size_t size)
}
/*
+ Exclusion rules.
+
+ Some hardware manufacturers deliver systems with own preinstalled MySQL copy
+ and services. We do not want to mess up with these installations. We will
+ just ignore such services, pretending it is not MySQL.
+
+ ´@return
+ TRUE, if this service should be excluded from UI lists etc (OEM install)
+ FALSE otherwise.
+*/
+BOOL exclude_service(mysqld_service_properties *props)
+{
+ static const char* exclude_patterns[] =
+ {
+ "common files\\dell\\mysql\\bin\\", /* Dell's private installation */
+ NULL
+ };
+ int i;
+ char buf[MAX_PATH];
+
+ /* Convert mysqld path to lower case, rules for paths are case-insensitive. */
+ memcpy(buf, props->mysqld_exe, sizeof(props->mysqld_exe));
+ _strlwr(buf);
+
+ for(i= 0; exclude_patterns[i]; i++)
+ {
+ if (strstr(buf, exclude_patterns[i]))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+/*
Retrieve some properties from windows mysqld service binary path.
We're interested in ini file location and datadir, and also in version of
the data. We tolerate missing mysqld.exe.
@@ -240,7 +275,9 @@ int get_mysql_service_properties(const wchar_t *bin_path,
}
}
}
- retval = 0;
+
+ if (!exclude_service(props))
+ retval = 0;
end:
LocalFree((HLOCAL)args);
return retval;