-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.cmd
executable file
·103 lines (86 loc) · 3.42 KB
/
build.cmd
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
@echo off
::
:: This script will build the Freenet Windows Installer.
::
:: To build from a Windows command prompt: "build.cmd"
:: To build from a linux terminal: "wine cmd /c build.cmd"
::
:: The following files are not packed and need to be manually added before compiling:
::
:: - res\tool_ahk\Ahk2Exe.exe (AutoHotkey compiler - http://www.autohotkey.com/)
:: - res\tool_ahk\AutoHotkeySC.bin (AHK library, comes with AutoHotkey compiler)
::
:: - res\install_node\freenet.jar (Freenet jar)
:: - res\install_node\freenet-ext.jar (Freenet jar)
:: - res\install_node\seednodes.fref (Freenet seednodes file)
:: - res\install_node\bcprov-jdk15on-149.jar (Bouncycastle crypto library)
::
:: - res\install_node\plugins\JSTUN.jar (Freenet plugin jar)
:: - res\install_node\plugins\KeyUtils.jar (Freenet plugin jar)
:: - res\install_node\plugins\ThawIndexBrowser.jar (Freenet plugin jar)
:: - res\install_node\plugins\UPnP.jar (Freenet plugin jar)
:: - res\install_node\plugins\Library.jar (Freenet plugin jar)
::
:: Remember to update src\freenetinstaller\FreenetInstaller_Include_Info.inc with the latest version information.
:: If running under Wine, you should install the relevant wine-gecko MSI file where wine expects to find it.
::
:: Cleanup and prepare
::
echo +++++
echo + Preparing bin folder...
if exist bin rmdir /S /Q bin
echo + (Ignore any "not found" errors above this line (WINE bug at time of writing))
mkdir bin
cd bin
::
:: Copy various files to our bin folder
::
echo + Copying files into bin folder...
copy ..\res\tool_ahk\Ahk2Exe.exe Ahk2Exe.exe
copy ..\res\tool_ahk\AutoHotkeySC.bin AutoHotkeySC.bin
copy "..\res\tool_ahk\Unicode 32-bit.bin" "Unicode 32-bit.bin"
copy ..\res\tool_reshacker\ResHacker.exe ResHacker.exe
copy ..\res\tool_reshacker\ResHack_Resource_Icon_Freenet.ico ResHack_Resource_Icon_Freenet.ico
copy ..\res\tool_reshacker\ResHack_Resource_Manifest.txt ResHack_Resource_Manifest.txt
copy ..\res\tool_reshacker\ResHack_Script_Normal.txt ResHack_Script_Normal.txt
::
:: Patch AHK library
::
echo + Patching AHK library...
ResHacker.exe -script ResHack_Script_Normal.txt
del AutoHotkeySC.bin
move /Y AutoHotkeySC_Normal.bin AutoHotkeySC.bin
::
:: Compile non-elevated executables
::
echo + Compiling executables...
echo +++++
Ahk2Exe.exe /in "..\src\freenetlauncher\FreenetLauncher.ahk" /out "..\res\install_node\freenetlauncher.exe"
echo Compiled freenetlauncher.exe
Ahk2Exe.exe /in "..\src\freenettray\FreenetTray.ahk" /out "..\res\install_node\freenet.exe"
echo Compiled freenet.exe
Ahk2Exe.exe /in "..\src\freenetuninstaller\FreenetUninstaller.ahk" /out "..\res\install_node\freenetuninstaller.exe"
echo Compiled freenetuninstaller.exe
Ahk2Exe.exe /in "..\src\freenetinstaller\FreenetInstaller.ahk" /out "FreenetInstaller.exe"
echo Compiled FreenetInstaller.exe
::
:: Cleanup and delete files we copied into the source and move compiled .exe's to the bin folder in case we need them for something else.
::
echo +++++
echo + Cleaning up...
del Ahk2Exe.exe
del AutoHotkeySC.bin
del ResHacker.exe
del ResHacker.ini
del ResHack_Log_Normal.txt
del ResHack_Resource_Icon_Freenet.ico
del ResHack_Resource_Manifest.txt
del ResHack_Script_Normal.txt
echo + Fetching executables into bin folder
move ..\res\install_node\freenetlauncher.exe freenetlauncher.exe
move ..\res\install_node\freenet.exe freenet.exe
move ..\res\install_node\freenetuninstaller.exe freenetuninstaller.exe
echo +++++
echo + All done! Hopefully no errors above...
echo +++++
cd ..