summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2009-07-14 19:26:49 +0200
committerJose <jose@zeroc.com>2009-07-14 19:26:49 +0200
commit2e7926b99cfdb08f446d4b80b31077f06c4fed78 (patch)
tree6ee2f502791e1f7637b6c0d4fd02ce2e1c5391f8 /cpp/src
parent4163 - New warning in C# build. (diff)
downloadice-2e7926b99cfdb08f446d4b80b31077f06c4fed78.tar.bz2
ice-2e7926b99cfdb08f446d4b80b31077f06c4fed78.tar.xz
ice-2e7926b99cfdb08f446d4b80b31077f06c4fed78.zip
4026 - Add config-in-registry support to IceServiceInstall
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/iceserviceinstall/ServiceInstaller.cpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/cpp/src/iceserviceinstall/ServiceInstaller.cpp b/cpp/src/iceserviceinstall/ServiceInstaller.cpp
index af489da477b..127d7a84070 100644
--- a/cpp/src/iceserviceinstall/ServiceInstaller.cpp
+++ b/cpp/src/iceserviceinstall/ServiceInstaller.cpp
@@ -232,8 +232,11 @@ IceServiceInstaller::install(const PropertiesPtr& properties)
}
}
- grantPermissions(_configFile);
-
+ if(!_configFile.find("HKLM\\") == 0 && !_configFile.find("HKCU\\") == 0)
+ {
+ grantPermissions(_configFile);
+ }
+
string eventLog = properties->getProperty("EventLog");
if(eventLog == "")
{
@@ -276,17 +279,24 @@ IceServiceInstaller::install(const PropertiesPtr& properties)
deps += '\0'; // must be double-null terminated
+ string command = "\"" + imagePath + "\" --service " + _serviceName
+ + " --Ice.Config=\"";
//
- // Get the full path of config file
+ // Get the full path of config file.
//
- char fullPath[MAX_PATH];
- if(GetFullPathName(_configFile.c_str(), MAX_PATH, fullPath, 0) > MAX_PATH)
+ if(!_configFile.find("HKLM\\") == 0 && !_configFile.find("HKCU\\") == 0)
{
- throw "Could not compute the full path of " + _configFile;
+ char fullPath[MAX_PATH];
+ if(GetFullPathName(_configFile.c_str(), MAX_PATH, fullPath, 0) > MAX_PATH)
+ {
+ throw "Could not compute the full path of " + _configFile;
+ }
+ command += string(fullPath) + "\"";
+ }
+ else
+ {
+ command += _configFile + "\"";
}
-
- string command = "\"" + imagePath + "\" --service " + _serviceName
- + " --Ice.Config=\"" + fullPath + "\"";
bool autoStart = properties->getPropertyAsIntWithDefault("AutoStart", 1) != 0;
string password = properties->getProperty("Password");