instrumentation: add next-share/
[cs-p2p-next.git] / instrumentation / next-share / xpitransmakedist.bat
1 REM @echo off\r
2 set LIBRARYNAME=BaseLib\r
3 \r
4 set PYTHONHOME=\Python254\r
5 REM Arno: Add . to find our core (py 2.5)\r
6 set PYTHONPATH=.;%PYTHONHOME%\r
7 echo PYTHONPATH SET TO %PYTHONPATH%\r
8 \r
9 set XULRUNNER=..\xulrunner-sdk\r
10 set ZIP7CMD="\Program Files\7-Zip\7z.exe"\r
11 \r
12 REM ----- Check for Python and essential site-packages\r
13 \r
14 IF NOT EXIST %PYTHONHOME%\python.exe (\r
15   echo .\r
16   echo Could not locate Python in %PYTHONHOME%.\r
17   echo Please modify this script or install python [www.python.org]\r
18   exit /b\r
19 )\r
20 \r
21 IF NOT EXIST %PYTHONHOME%\Lib\site-packages\wx-*-unicode (\r
22   echo .\r
23   echo Could not locate wxPython in %PYTHONHOME%\Lib\site-packages.\r
24   echo Please modify this script or install wxPython [www.wxpython.org]\r
25   exit /b\r
26 )\r
27 \r
28 IF NOT EXIST %PYTHONHOME%\Lib\site-packages\py2exe (\r
29   echo .\r
30   echo Could not locate py2exe in %PYTHONHOME%\Lib\site-packages.\r
31   echo Please modify this script or install py2exe [www.py2exe.org]\r
32   exit /b\r
33 )\r
34 \r
35 REM ----- Check for XULRUNNER\r
36 \r
37 IF NOT EXIST %XULRUNNER% (\r
38   echo .\r
39   echo Could not locate the XULRUNNER SDK at %XULRUNNER%.\r
40   echo Please modify this script or install from https://developer.mozilla.org/en/XULRunner\r
41   exit /b\r
42 )\r
43 \r
44 REM ----- Check for ZIP7CMD\r
45 \r
46 IF NOT EXIST %ZIP7CMD% (\r
47   echo .\r
48   echo Could not locate the 7-Zip at %ZIP7CMD%.\r
49   echo Please modify this script or install from ww.7-zip.org\r
50   exit /b\r
51 )\r
52 \r
53 \r
54 REM ----- Clean up\r
55 \r
56 call clean.bat\r
57 \r
58 REM ----- Build\r
59 \r
60 REM Arno: When adding files here, make sure tribler.nsi actually\r
61 REM packs them in the installer .EXE\r
62 \r
63 REM Diego: building the deepest dir we get all of them.\r
64 mkdir dist\installdir\bgprocess\%LIBRARYNAME%\Images\r
65 \r
66 %PYTHONHOME%\python.exe -O %LIBRARYNAME%\Transport\Build\Win32\setupBGexe.py py2exe\r
67 \r
68 REM Arno: Move py2exe results to installdir\r
69 move dist\*.* dist\installdir\bgprocess\r
70 copy %LIBRARYNAME%\Images\SwarmPlayerIcon.ico dist\installdir\bgprocess\%LIBRARYNAME%\Images\r
71 \r
72 REM Riccardo:  move the files needed for the WebUI
73 xcopy %LIBRARYNAME%\WebUI dist\installdir\bgprocess\%LIBRARYNAME%\WebUI /S /I
74 del dist\installdir\bgprocess\%LIBRARYNAME%\WebUI\*.py
75 \r
76 REM Diego: replace vlc *.txt with P2P-Next License.txt\r
77 del dist\installdir\*.txt\r
78 type %LIBRARYNAME%\ns-LICENSE.txt %LIBRARYNAME%\binary-LICENSE-postfix.txt > %LIBRARYNAME%\binary-LICENSE.txt\r
79 copy %LIBRARYNAME%\binary-LICENSE.txt dist\installdir\r
80 \r
81 copy %PYTHONHOME%\Lib\site-packages\wx-2.8-msw-unicode\wx\msvcp71.dll dist\installdir\bgprocess\r
82 \r
83 copy reset.bat dist\installdir\r
84 \r
85 REM Arno: Move swift binary to installdir\r
86 copy swift.exe dist\installdir\bgprocess\r
87 \r
88 \r
89 REM ----- Build XPI of SwarmTransport\r
90 mkdir dist\installdir\components\r
91 copy %LIBRARYNAME%\Transport\icon.png dist\installdir\r
92 copy %LIBRARYNAME%\Transport\install.rdf dist\installdir\r
93 copy %LIBRARYNAME%\Transport\chrome.manifest dist\installdir\r
94 xcopy %LIBRARYNAME%\Transport\components dist\installdir\components /S /I\r
95 xcopy %LIBRARYNAME%\Transport\chrome dist\installdir\chrome /S /I
96 xcopy %LIBRARYNAME%\Transport\skin dist\installdir\skin /S /I\r
97 \r
98 REM ----- Turn .idl into .xpt\r
99 %XULRUNNER%\bin\xpidl -m typelib -w -v -I %XULRUNNER%\idl -e dist\installdir\components\tribeIChannel.xpt %LIBRARYNAME%\Transport\tribeIChannel.idl\r
100 %XULRUNNER%\bin\xpidl -m typelib -w -v -I %XULRUNNER%\idl -e dist\installdir\components\tribeISwarmTransport.xpt %LIBRARYNAME%\Transport\tribeISwarmTransport.idl\r
101 \r
102 cd dist\installdir\r
103 \r
104 REM Arno: Win7 gives popup if SwarmEngine is not signed\r
105 "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin\signtool.exe" sign /f c:\build\certs\swarmplayerprivatekey.pfx /p "" /d "SwarmEngine" /du "http://www.pds.ewi.tudelft.nl/code.html" /t "http://timestamp.verisign.com/scripts/timestamp.dll" bgprocess\SwarmEngine.exe\r
106 \r
107 REM ----- Turn installdir into .xpi\r
108 %ZIP7CMD% a -tzip "SwarmPlayer.xpi" * -r -mx=9 \r
109 move SwarmPlayer.xpi ..\r
110 cd ..\..\r
111  \r
112 \r