1 /* Copyright (C) 2009 Trend Micro Inc.
4 * This program is a free software; you can redistribute it
5 * and/or modify it under the terms of the GNU General Public
6 * License (version 2) as published by the FSF - Free Software
10 #include "setup-shared.h"
13 /* Set up Windows after installation */
14 int main(int argc, char **argv)
20 printf("%s: Invalid syntax.\n", argv[0]);
21 printf("Try: '%s directory'\n\n", argv[0]);
25 /* Try to chdir to the OSSEC directory */
26 if (chdir(argv[1]) != 0) {
27 printf("%s: Invalid directory: '%s'.\n", argv[0], argv[1]);
31 /* Configure OSSEC for automatic startup */
32 system("sc config OssecSvc start= auto");
34 /* Change permissions */
38 char cmd[OS_MAXSTR + 1];
40 /* Copy some files to outside */
41 snprintf(cmd, OS_MAXSTR, "move os_win32ui.exe ../");
44 snprintf(cmd, OS_MAXSTR, "move win32ui.exe ../");
47 snprintf(cmd, OS_MAXSTR, "move uninstall.exe ../");
50 snprintf(cmd, OS_MAXSTR, "move doc.html ../");
53 snprintf(cmd, OS_MAXSTR, "move help.txt ../");
56 /* Change permissions */
57 system("echo y|icacls * /T \"*S-1-5-32-544:F\" ");
60 snprintf(cmd, OS_MAXSTR, "move ..\\os_win32ui.exe .");
63 snprintf(cmd, OS_MAXSTR, "move ..\\win32ui.exe .");
66 snprintf(cmd, OS_MAXSTR, "move ..\\uninstall.exe .");
69 snprintf(cmd, OS_MAXSTR, "move ..\\doc.html .");
72 snprintf(cmd, OS_MAXSTR, "move ..\\help.txt .");
75 system("echo y|icacls . /T /G \"*S-1-5-32-544:F\" ");