]> granicus.if.org Git - icinga2/blobdiff - icinga-installer/icinga-installer.cpp
Move new password functions into tlsutility
[icinga2] / icinga-installer / icinga-installer.cpp
index 5fb10512ed511208f78b86062064829c9eddc9c8..438ddc37db7eba7ddc1a0f8299293ef382ba918d 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  * Icinga 2                                                                   *
- * Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/)  *
+ * Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/)  *
  *                                                                            *
  * This program is free software; you can redistribute it and/or              *
  * modify it under the terms of the GNU General Public License                *
@@ -43,6 +43,7 @@ static std::string GetIcingaInstallPath(void)
        return szFileName;
 }
 
+
 static bool ExecuteCommand(const std::string& app, const std::string& arguments)
 {
        SHELLEXECUTEINFO sei = {};
@@ -96,14 +97,6 @@ static bool PathExists(const std::string& path)
        return (_stat(path.c_str(), &statbuf) >= 0);
 }
 
-static void CopyFile(const std::string& source, const std::string& target)
-{
-       std::ifstream ifs(source.c_str(), std::ios::binary);
-       std::ofstream ofs(target.c_str(), std::ios::binary | std::ios::trunc);
-
-       ofs << ifs.rdbuf();
-}
-
 static std::string GetIcingaDataPath(void)
 {
        char path[MAX_PATH];
@@ -132,18 +125,6 @@ static void MkDirP(const std::string& path)
        }
 }
 
-static void CopyConfigFile(const std::string& installDir, const std::string& sourceConfigPath, size_t skelPrefixLength)
-{
-       std::string relativeConfigPath = sourceConfigPath.substr(skelPrefixLength);
-
-       std::string targetConfigPath = installDir + relativeConfigPath;
-
-       if (!PathExists(targetConfigPath)) {
-               MkDirP(DirName(targetConfigPath));
-               CopyFile(sourceConfigPath, targetConfigPath);
-       }
-}
-
 static std::string GetNSISInstallPath(void)
 {
        HKEY hKey;
@@ -164,11 +145,6 @@ static std::string GetNSISInstallPath(void)
        return "";
 }
 
-static void CollectPaths(std::vector<std::string>& paths, const std::string& path)
-{
-       paths.push_back(path);
-}
-
 static bool CopyDirectory(const std::string& source, const std::string& destination)
 {
        // SHFileOperation requires file names to be terminated with two \0s
@@ -270,11 +246,11 @@ static int InstallIcinga(void)
 
                MkDirP(dataDir + "/etc/icinga2/pki");
                MkDirP(dataDir + "/var/cache/icinga2");
-               MkDirP(dataDir + "/var/lib/icinga2/pki");
+               MkDirP(dataDir + "/var/lib/icinga2/certs");
+               MkDirP(dataDir + "/var/lib/icinga2/certificate-requests");
                MkDirP(dataDir + "/var/lib/icinga2/agent/inventory");
                MkDirP(dataDir + "/var/lib/icinga2/api/config");
                MkDirP(dataDir + "/var/lib/icinga2/api/log");
-               MkDirP(dataDir + "/var/lib/icinga2/api/repository");
                MkDirP(dataDir + "/var/lib/icinga2/api/zones");
                MkDirP(dataDir + "/var/log/icinga2/compat/archive");
                MkDirP(dataDir + "/var/log/icinga2/crash");
@@ -306,7 +282,6 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
        CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
 
        //AllocConsole();
-
        int rc;
 
        if (strcmp(lpCmdLine, "install") == 0) {