-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtools-installer.c
110 lines (94 loc) · 3.21 KB
/
tools-installer.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#define _UNIX03_SOURCE
#include <Windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
FILE *file;
void initSDK() {
if(!CreateDirectory("C:\\Barca", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\lib", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\bin", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\etc", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\log", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\engine", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\engine\\core", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\engine\\modules", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\engine\\modules\\apis", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\engine\\docs", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\engine\\config", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\engine\\tracking", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
if(!CreateDirectory("C:\\Barca\\cli", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
file = fopen("C:\\Barca\\engine\\version.txt", "w");
file = fopen("C:\\Barca\\engine\\serial.txt", "w+");
fputs("----------------------------------------------------------\n", file);
fputs(" \n", file);
fputs(" \n", file);
fputs(" Copyright © Project Barca \n", file);
fputs(" \n", file);
fputs(" \n", file);
fputs(" Email: annibalhsouza@gmail.com Author: Aníbal Souza \n", file);
fputs("----------------------------------------------------------\n\n\n", file);
fputs("SERIAL KEY: YKUOR1-AOFLR9-APTROD-MBUSO4-OPR301", file);
}
void iLog(char* path, char* txt) {
file = fopen(path, "w");
fputs(txt, file);
}
void initCLI() {
char *gopath;
gopath = getenv("GOPATH");
printf(gopath);
}
void initDesktop() {
char *programFiles;
programFiles = getenv("ProgramFiles");
printf(programFiles);
if(!CreateDirectory(*programFiles + "\\Barca", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
}
void initAPIs() {
char *programFiles;
programFiles = getenv("ProgramFiles");
printf(programFiles);
}
void initBWC(void) {
char* profile;
profile = getenv("USERPROFILE");
if(!CreateDirectory(*profile+"\\.bwc", NULL)) {
fprintf(stderr, "ERRO: %d\n", GetLastError());
}
system("setx BARCA_CLOUD \"C:\\.bwc\"");
}
int main() {
setlocale(LC_ALL, "Portuguese_Brasil");
initSDK();
iLog("C:\\Barca\\logs\\log-march-2022.txt", "LOG 22/03/2022 - Instalação Concluída!");
return 0;
}