1 /* @(#) $Id: ./src/win32/setup-win.c, 2011/09/08 dcid Exp $
4 /* Copyright (C) 2009 Trend Micro Inc.
7 * This program is a free software; you can redistribute it
8 * and/or modify it under the terms of the GNU General Public
9 * License (version 2) as published by the FSF - Free Software
14 #include "setup-shared.h"
17 /* Setup windows after install */
18 int main(int argc, char **argv)
20 /* Setting the name */
25 printf("%s: Invalid syntax.\n", argv[0]);
26 printf("Try: '%s directory'\n\n", argv[0]);
30 /* Trying to chdir to ossec directory. */
31 if(chdir(argv[1]) != 0)
33 printf("%s: Invalid directory: '%s'.\n", argv[0], argv[1]);
38 /* Configure ossec for automatic startup */
39 system("sc config OssecSvc start= auto");
42 /* Changing permissions. */
48 char cmd[OS_MAXSTR +1];
50 /* Copy some files to outside */
51 snprintf(cmd, OS_MAXSTR, "move os_win32ui.exe ../");
54 snprintf(cmd, OS_MAXSTR, "move win32ui.exe ../");
57 snprintf(cmd, OS_MAXSTR, "move uninstall.exe ../");
60 snprintf(cmd, OS_MAXSTR, "move doc.html ../");
63 snprintf(cmd, OS_MAXSTR, "move help.txt ../");
67 /* Changing permissions. */
68 system("echo y|cacls * /T /G Administrators:f ");
71 /* Copying them back. */
72 snprintf(cmd, OS_MAXSTR, "move ..\\os_win32ui.exe .");
75 snprintf(cmd, OS_MAXSTR, "move ..\\win32ui.exe .");
78 snprintf(cmd, OS_MAXSTR, "move ..\\uninstall.exe .");
81 snprintf(cmd, OS_MAXSTR, "move ..\\doc.html .");
84 snprintf(cmd, OS_MAXSTR, "move ..\\help.txt .");
89 system("echo y|cacls . /T /G Administrators:f ");