diff options
author | Michi Henning <michi@zeroc.com> | 2008-04-03 12:36:57 +1000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2008-04-03 12:36:57 +1000 |
commit | 27a24cf07fa7646c5a27cbbfb60d6e4a86184ebc (patch) | |
tree | 4d825c1cb800b154ea4b33b238027f1ff9a13531 /cpp/src/iceserviceinstall/ServiceInstaller.cpp | |
parent | Fixed comment for GCShared (wrong namespace). (diff) | |
parent | Merge branch 'master' of cvs:/home/git/ice (diff) | |
download | ice-27a24cf07fa7646c5a27cbbfb60d6e4a86184ebc.tar.bz2 ice-27a24cf07fa7646c5a27cbbfb60d6e4a86184ebc.tar.xz ice-27a24cf07fa7646c5a27cbbfb60d6e4a86184ebc.zip |
Merge branch 'master' of ssh://cvs.zeroc.com/home/git/ice
Diffstat (limited to 'cpp/src/iceserviceinstall/ServiceInstaller.cpp')
-rwxr-xr-x | cpp/src/iceserviceinstall/ServiceInstaller.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/cpp/src/iceserviceinstall/ServiceInstaller.cpp b/cpp/src/iceserviceinstall/ServiceInstaller.cpp index 66c770998b5..fc055fe1efc 100755 --- a/cpp/src/iceserviceinstall/ServiceInstaller.cpp +++ b/cpp/src/iceserviceinstall/ServiceInstaller.cpp @@ -30,10 +30,28 @@ using namespace std; using namespace Ice; +// +// Replace / by \ +// +inline string +fixDirSeparator(const string& path) +{ + string result = path; + size_t pos = 0; + while((pos = result.find('/', pos)) != string::npos) + { + result[pos] = '\\'; + pos++; + } + + return result; +} + + IceServiceInstaller::IceServiceInstaller(int serviceType, const string& configFile, const CommunicatorPtr& communicator) : _serviceType(serviceType), - _configFile(configFile), + _configFile(fixDirSeparator(configFile)), _communicator(communicator), _serviceProperties(createProperties()), _sid(0), @@ -137,6 +155,10 @@ IceServiceInstaller::install(const PropertiesPtr& properties) imagePath.replace(imagePath.rfind('\\'), string::npos, "\\" + serviceTypeToLowerString(_serviceType) + ".exe"); } + else + { + imagePath = fixDirSeparator(imagePath); + } if(!fileExists(imagePath)) { throw imagePath + ": not found"; @@ -151,7 +173,7 @@ IceServiceInstaller::install(const PropertiesPtr& properties) throw "The IceGrid registry service can't depend on itself"; } - string registryDataDir = _serviceProperties->getProperty("IceGrid.Registry.Data"); + string registryDataDir = fixDirSeparator(_serviceProperties->getProperty("IceGrid.Registry.Data")); if(registryDataDir == "") { throw "IceGrid.Registry.Data must be set in " + _configFile; @@ -163,7 +185,7 @@ IceServiceInstaller::install(const PropertiesPtr& properties) } else if(_serviceType == icegridnode) { - string nodeDataDir = _serviceProperties->getProperty("IceGrid.Node.Data"); + string nodeDataDir = fixDirSeparator(_serviceProperties->getProperty("IceGrid.Node.Data")); if(nodeDataDir == "") { throw "IceGrid.Node.Data must be set in " + _configFile; |