forked from cheshuai/Terminals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRelease.bat
197 lines (163 loc) · 9.91 KB
/
Release.bat
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
@Echo off
rem Set the XulRunner runtime version (i.e. the Mozilla engine), ATTENTION: the SDK version won't work
set XULRUNNER=xulrunner-16.0.2.en-US.win32\xulrunner
set XULRUNNER=xulrunner-29.0.en-US.win32\xulrunner
rem Copy the Terminals updater to the build directory
copy "..\..\..\..\TerminalsUpdater\bin\Release\TerminalsUpdater.exe" "TerminalsUpdater.exe" /Y > NUL
rem Copy SciLexer.dll and SciLexer64.dll from Scintilla to the Plugin directory.
copy "..\..\..\..\DLLs\ScintillaNET v2.5.2\SciLex*.dll" "Plugins\AutoIt\SciLex*.dll" /Y > NUL
rem Delete plugin files from the root of Terminals (files are intended for AutoIt plugin not for Terminals itself)
del /Q /F "Bug in Scintilla.pdf"
del /Q /F "CodeEditor.*"
del /Q /F "ScintillaNET.dll"
rem Copy AutoIt to Plugin directory
xcopy "..\..\..\..\DLLs\Tools\AutoIt" "Plugins\AutoIt" /E /C /R /I /K /Y > NUL
rem Copy the explorer browser to Terminals.exe directory
copy "..\..\..\..\Kohl.Explorer\bin\Release\Kohl.Explorer.exe" "Kohl.Explorer.exe" /Y > NUL
del /Q /F /S "..\Distribution Release\*.*" > NUL
rmdir /S /Q "..\Distribution Release\" > NUL
mkdir "..\Distribution Release\" > NUL
cls
echo.
echo Copying configuration files.
copy "Credentials.xml" "..\Distribution Release\Credentials.xml" /Y > NUL
copy "Terminals.config" "..\Distribution Release\Terminals.config" /Y > NUL
copy "Terminals.log4net.config" "..\Distribution Release\Terminals.log4net.config" /Y > NUL
echo.
echo Copying Terminals.Configuration.dll & KeePassLib.dll.
copy "Terminals.Configuration.dll" "..\Distribution Release\Terminals.Configuration.dll" /Y > NUL
copy "KeePassLib.dll" "..\Distribution Release\KeePassLib.dll" /Y > NUL
echo Copying FireFox dependencies.
copy "..\..\..\..\DLLs\%XULRUNNER%\omni.ja" "omni.ja" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\plugin-container.exe" "plugin-container.exe" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\freebl3.dll" "freebl3.dll" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\gkmedias.dll" "gkmedias.dll" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\libEGL.dll" "libEGL.dll" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\libGLESv2.dll" "libGLESv2.dll" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\mozalloc.dll" "mozalloc.dll" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\mozglue.dll" "mozglue.dll" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\mozjs.dll" "mozjs.dll" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\nss3.dll" "nss3.dll" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\nssckbi.dll" "nssckbi.dll" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\nssdbm3.dll" "nssdbm3.dll" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\softokn3.dll" "softokn3.dll" /Y > NUL
copy "..\..\..\..\DLLs\%XULRUNNER%\xul.dll" "xul.dll" /Y > NUL
echo.
echo Copying Microsoft Virtual Machine Remote Control (VMRC) dependencies.
copy "..\..\..\..\DLLs\VMRC\*.dll" "*.dll" /Y > NUL
copy "..\..\..\..\DLLs\VMRC\RegisterVMRC.bat" "RegisterVMRC.bat" /Y > NUL
echo.
echo Copying Citrix dependencies.
copy "..\..\..\..\DLLs\Citrix\*.dll" "*.dll" /Y > NUL
echo.
echo Copy everything from the release folder to the distribution folder.
copy "*.dll" "..\Distribution Release\*.dll" /Y > NUL
copy "*.pak" "..\Distribution Release\*.pak" /Y > NUL
copy "*.bat" "..\Distribution Release\*.bat" /Y > NUL
copy "Kohl.Explorer.exe" "..\Distribution Release\Kohl.Explorer.exe" /Y > NUL
copy "Terminals.exe" "..\Distribution Release\Terminals.exe" /Y > NUL
copy "TerminalsUpdater.exe" "..\Distribution Release\TerminalsUpdater.exe" /Y > NUL
copy "plugin-container.exe" "..\Distribution Release\plugin-container.exe" /Y > NUL
copy "Kohl.Explorer.exe" "..\Distribution Release\Kohl.Explorer.exe" /Y > NUL
copy "omni.ja" "..\Distribution Release\omni.ja" /Y > NUL
echo Copying plugins
copy "..\..\..\..\DLLs\Tools\Putty\putty.exe" "..\Distribution Release\putty.exe" /Y > NUL
xcopy "..\..\..\..\DLLs\Tools\Radmin Viewer 3" "..\Distribution Release\Radmin Viewer 3" /E /C /R /I /K /Y > NUL
xcopy "Plugins" "..\Distribution Release\Plugins" /E /C /R /I /K /Y > NUL
del /Q /F "..\Distribution Release\Plugins\Kohl.*"
del /Q /F "..\Distribution Release\Plugins\AutoIt\ScintillaNET.pdb"
del /Q /F "..\Distribution Release\Plugins\log4net.dll"
del /Q /F "..\Distribution Release\Plugins\Terminals.Connection.dll"
del /Q /F "..\Distribution Release\Plugins\Terminals.Connection.pdb"
del /Q /F "..\Distribution Release\Plugins\Terminals.Configuration.dll"
echo Compilation and clean up done - optional last step will be started now ...
cd ..\Distribution Release\
echo Preparing netz compiler
copy /Y ..\..\..\..\netz-src\netz\compress\defcomp.dll ..\..\..\..\netz-src\netz\bin\Release\defcomp.dll
copy /Y ..\..\..\..\netz-src\netz\compress\zip.dll ..\..\..\..\netz-src\netz\bin\Release\zip.dll
echo Packing and compressing the distributable version.
"..\..\..\..\netz-src\netz\bin\Release\netz.exe" -z -w -o Out -s -so -x86 Kohl.Explorer.exe Microsoft.WindowsAPICodePack.dll ICSharpCode.SharpZipLib.dll Microsoft.WindowsAPICodePack.Shell.dll ExplorerBrowser.dll
rem It is not a good idea to embed the AxInterop.MSTSCLib.dll
"..\..\..\..\netz-src\netz\bin\Release\netz.exe" -z -w -o Out -s -so -x86 Terminals.exe AxInterop.Microsoft.VMRCClientControl.Interop.dll AxWFICALib.dll Be.Windows.Forms.HexBox.dll DotRas.dll ICSharpCode.SharpZipLib.dll log4net.dll Metro.dll Microsoft.VMRCClientControl.Interop.dll PacketDotNet.dll SharpPcap.dll TerminalEmulator.dll VncSharp.dll WFICALib.dll Microsoft.WindowsAPICodePack.dll Microsoft.WindowsAPICodePack.Shell.dll ExplorerBrowser.dll
"..\..\..\..\netz-src\netz\bin\Release\netz.exe" -z -w -o Out -s -so TerminalsUpdater.exe log4net.dll
echo Copy the Terminals DLLs and config to the output folder
copy /Y "Terminals.log4net.config" "Out\Terminals.log4net.config"
copy /Y "Kohl.Framework.dll" "Out\Kohl.Framework.dll"
copy /Y "Terminals.Configuration.dll" "Out\Terminals.Configuration.dll"
copy /Y "KeePassLib.dll" "Out\KeePassLib.dll"
copy /Y "Terminals.Connection.dll" "Out\Terminals.Connection.dll"
rem copy /Y "TerminalsUpdater.exe" "Out\TerminalsUpdater.exe"
echo Copy the XUL DLLs to the output folder
copy /Y "omni.ja" "Out\omni.ja"
copy /Y "plugin-container.exe" "Out\plugin-container.exe"
copy /Y "freebl3.dll" "Out\freebl3.dll"
copy /Y "gkmedias.dll" "Out\gkmedias.dll"
copy /Y "libEGL.dll" "Out\libEGL.dll"
copy /Y "libGLESv2.dll" "Out\libGLESv2.dll"
copy /Y "mozalloc.dll" "Out\mozalloc.dll"
copy /Y "mozglue.dll" "Out\mozglue.dll"
copy /Y "mozjs.dll" "Out\mozjs.dll"
copy /Y "nss3.dll" "Out\nss3.dll"
copy /Y "nssckbi.dll" "Out\nssckbi.dll"
copy /Y "nssdbm3.dll" "Out\nssdbm3.dll"
copy /Y "softokn3.dll" "Out\softokn3.dll"
copy /Y "xul.dll" "Out\xul.dll"
echo Copy the .NET XUL wrapper DLLs to the output folder
copy /Y "Geckofx-Core.dll" "Out\Geckofx-Core.dll"
copy /Y "Geckofx-Winforms.dll" "Out\Geckofx-Winforms.dll"
echo Copy third party DLLs to the output folder
copy /Y "VMKeyboardHook.dll" "Out\VMKeyboardHook.dll"
copy /Y "VMKeyboardHook64.dll" "Out\VMKeyboardHook64.dll"
copy /Y "VMRCActiveXClient.dll" "Out\VMRCActiveXClient.dll"
copy /Y "VMRCActiveXClient64.dll" "Out\VMRCActiveXClient64.dll"
copy /Y "AxInterop.MSTSCLib.dll" "Out\AxInterop.MSTSCLib.dll"
copy /Y "Interop.MSTSCLib.dll" "Out\Interop.MSTSCLib.dll"
copy /Y ICSharpCode.SharpZipLib.dll Out\ICSharpCode.SharpZipLib.dll
copy /Y ZedGraph.dll Out\ZedGraph.dll
copy /Y Granados.dll Out\Granados.dll
copy /Y PostSharp.dll Out\PostSharp.dll
rem copy /Y "..\..\..\..\netz-src\netz\compress\zip.dll" Out\zip.dll
rem copy /Y "..\..\..\..\netz-src\netz\compress\defcomp.dll" Out\defcomp.dll
copy /Y "putty.exe" "Out\putty.exe"
xcopy "Radmin Viewer 3" "Out\Radmin Viewer 3" /E /C /R /I /K /Y > NUL
copy /Y "*.bat" "Out\*.bat"
echo Copying plugins
XCOPY "Plugins" "Out\Plugins" /E /C /R /I /K /Y > NUL
cd Out
rem Merge the Assembly info file into the resulting exe file and pack the original assemblies as dll
rem The Rpx\Packing\CompileProcess.cs file has been patched at line 318 to support the x86 platform i.e.
rem -> from
rem cp.CompilerOptions = " /filealign:512 /optimize+";
rem -> to
rem cp.CompilerOptions = " /filealign:512 /optimize+ /platform:x86";
rem
"..\..\..\..\..\Resources\Packer\rpx-1.3-14635\Rpx\bin\Debug\rpx.exe" Terminals.exe /A "..\..\..\..\..\Terminals\Properties\AssemblyInfo.cs" /output Terminals.exe +W
"..\..\..\..\..\Resources\Packer\rpx-1.3-14635\Rpx\bin\Debug\rpx.exe" Kohl.Explorer.exe /A "..\..\..\..\..\Kohl.Explorer\Properties\AssemblyInfo.cs" /output Kohl.Explorer.exe +W
echo Pack our DLLs
"..\..\..\..\..\Resources\mpress\mpress.exe" -s plugin-container.exe
rem Packing putty with upx results in an McAfee virus warning!
"..\..\..\..\..\Resources\mpress\mpress.exe" -s putty.exe
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 freebl3.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 gkmedias.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 libEGL.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 libGLESv2.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 mozalloc.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 mozglue.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 mozjs.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 nss3.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 nssckbi.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 nssdbm3.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 softokn3.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 VMKeyboardHook.dll
"..\..\..\..\..\Resources\mpress\mpress.exe" -s VMKeyboardHook64.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 VMRCActiveXClient.dll
"..\..\..\..\..\Resources\mpress\mpress.exe" -s VMRCActiveXClient64.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 xul.dll
..\..\..\..\..\Resources\Packer\upx308w\upx.exe -9 ZedGraph.dll
echo.
echo Done Building Terminals
echo.
echo Starting with Setup and Zip file creation
cd ..\..\..\..\..\Terminals.Setup\
.\Compile.bat
exit /b 0