-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupgrade.pl
157 lines (118 loc) · 3.29 KB
/
upgrade.pl
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#Imago <[email protected]>
# Stops server, replaces objects, Starts server
# This file is for host azbuildslave
use strict;
use Win32::Process;
my $cmd = "";
my $azbp = $ARGV[0];
print "Shutting down...\n";
open (PS,"$azbp\\pslist.exe 2>crap AllSrv |");
my $pid = 0;
while (<PS>) {
if ($_ =~ /AllSrv\s+(\d+)/) {
$pid = $1;
$cmd = "$azbp\\pskill 2>crap $pid";
print "Killing AllSrv executable $pid\n";
`$cmd`;
}
}
close PS;
sleep(5) if ($pid);
$cmd = "$azbp\\pskill 2>crap AllSrv";
print "Killing AllSrv executable by name...\n";
`$cmd`;
$cmd = "TASKKILL /IM AllSrv.exe /T /F";
system($cmd);
sleep(2);
$cmd = "net start server";
`$cmd`;
print "Unregistering...\n";
$cmd = "C:\\AllegBeta\\PigAccts.exe -UnRegServer";
`$cmd`;
$cmd = "C:\\AllegBeta\\PigSrv.exe -UnRegServer";
`$cmd`;
$cmd = "C:\\AllegBeta\\AllSrv.exe -UnRegServer";
`$cmd`;
#$cmd = "C:\\AllegBeta\\AllClub.exe -UnRegServer";
#`$cmd`;
$cmd = "regsvr32 C:\\AllegBeta\\AGC.dll /u /s";
`$cmd`;
$cmd = "regsvr32 C:\\AllegBeta\\TCObj.dll /u /s";
`$cmd`;
$cmd = "regsvr32 C:\\AllegBeta\\PigsLib.dll /u /s";
`$cmd`;
sleep(2);
$cmd = "TASKKILL /IM AllSrv.exe /T /F";
system($cmd);
sleep(2);
print "Copying files again...\n";
$cmd = "copy C:\\AGC.dll C:\\AllegBeta\\AGC.dll /Y";
`$cmd`;
$cmd = "copy C:\\AllSrv.exe C:\\AllegBeta\\AllSrv.exe /Y";
`$cmd`;
$cmd = "copy C:\\AGC.pdb C:\\AllegBeta\\AGC.pdb /Y";
`$cmd`;
$cmd = "copy C:\\AllSrv.pdb C:\\AllegBeta\\AllSrv.pdb /Y";
`$cmd`;
$cmd = "copy C:\\AllLobby.pdb C:\\AllegBeta\\AllLobby.pdb /Y";
`$cmd`;
$cmd = "copy C:\\AutoUpdate.exe C:\\AllegBeta\\AutoUpdate.exe /Y";
`$cmd`;
$cmd = "copy C:\\PigsLib.pdb C:\\AllegBeta\\PigsLib.pdb /Y";
`$cmd`;
$cmd = "copy C:\\PigsLib.dll C:\\AllegBeta\\PigsLib.dll /Y";
`$cmd`;
$cmd = "copy C:\\AllClub.exe C:\\AllegBeta\\AllClub.exe /Y";
`$cmd`;
$cmd = "copy C:\\AllClub.pdb C:\\AllegBeta\\AllClub.pdb /Y";
`$cmd`;
$cmd = "copy C:\\PigSrv.exe C:\\AllegBeta\\PigSrv.exe /Y";
`$cmd`;
$cmd = "copy C:\\PigSrv.pdb C:\\AllegBeta\\PigSrv.pdb /Y";
`$cmd`;
$cmd = "copy C:\\PigConfig.exe C:\\AllegBeta\\PigConfig.exe /Y";
`$cmd`;
$cmd = "copy C:\\PigConfig.pdb C:\\AllegBeta\\PigConfig.pdb /Y";
`$cmd`;
$cmd = "copy C:\\PigAccts.exe C:\\AllegBeta\\PigAccts.exe /Y";
`$cmd`;
$cmd = "copy C:\\PigAccts.pdb C:\\AllegBeta\\PigAccts.pdb /Y";
`$cmd`;
$cmd = "copy C:\\TCObj.pdb C:\\AllegBeta\\TCObj.pdb /Y";
`$cmd`;
$cmd = "copy C:\\TCObj.dll C:\\AllegBeta\\TCObj.dll /Y";
`$cmd`;
print "Re-registering...\n";
$cmd = "regsvr32 C:\\AllegBeta\\AGC.dll /s";
`$cmd`;
$cmd = "regsvr32 C:\\AllegBeta\\TCObj.dll /s";
`$cmd`;
$cmd = "regsvr32 C:\\AllegBeta\\PigsLib.dll /s";
`$cmd`;
$cmd = "C:\\AllegBeta\\AllSrv.exe -RegServer";
`$cmd`;
#$cmd = "C:\\AllegBeta\\AllClub.exe -RegServer";
#`$cmd`;
$cmd = "C:\\AllegBeta\\PigAccts.exe -RegServer pigs PigPass!";
`$cmd`;
$cmd = "C:\\AllegBeta\\PigSrv.exe -RegServer pigs PigPass!";
`$cmd`;
$cmd = "net stop server";
`$cmd`;
print "Restarting...\n";
$cmd = "TASKKILL /IM AllSrv.exe /T /F";
system($cmd);
sleep(2);
$cmd = "C:\\AllegBeta\\AllSrv.exe";
print "Starting AllSrv executable\n";
my $ProcessObj = "";
Win32::Process::Create($ProcessObj,
$cmd,
"AllSrv",
0,
NORMAL_PRIORITY_CLASS|CREATE_NEW_CONSOLE,
"C:\\AllegBeta")|| die "Failed to start AllSrv";
sleep(10);
$cmd = "$azbp\\makedm.bat $azbp";
`$cmd`;
exit 0;