/****************************************************************************** * Icinga 2 * * Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software Foundation * * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ #include "base/utility.hpp" #include "base/application.hpp" using namespace icinga; int InstallIcinga(void) { MessageBox(NULL, "Install", "Icinga 2", 0); return 0; } int UninstallIcinga(void) { MessageBox(NULL, "Uninstall", "Icinga 2", 0); return 0; } /** * Entry point for the installer application. */ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { /* must be called before using any other libbase functions */ Application::InitializeBase(); int rc; if (strcmp(lpCmdLine, "install") == 0) { rc = InstallIcinga(); } else if (strcmp(lpCmdLine, "uninstall") == 0) { rc = UninstallIcinga(); } else { MessageBox(NULL, "This application should only be run by the MSI installer package.", "Icinga 2 Installer", MB_ICONWARNING); rc = 1; } Application::Exit(rc); }