]> git.saurik.com Git - wxWidgets.git/blob - utils/tex2rtf/distrib/zipdistinno.bat
1643306ce73f3ba235bbd75aa1debcc2fd5c91a4
[wxWidgets.git] / utils / tex2rtf / distrib / zipdistinno.bat
1 @echo off
2 rem Zip up a distribution of Tex2RTF using Inno Setup.
3 Rem This batch file requires the 4DOS/4NT command processor.
4 set src=%WXWIN%\utils\tex2rtf
5 set dest=%WXWIN%\deliver
6 set inno=1
7 set ReleaseDir=Release
8
9 if "%src%" == "" goto usage
10 if "%dest%" == "" goto usage
11
12 if "%1" == "innoonly" set inno=1
13 if "%1" == "innoonly" goto dounzip
14 if "%1" == "inno" set inno=1
15
16 echo About to archive Tex2RTF
17 echo From %src%
18 echo To %dest%
19 echo CTRL-C if this is not correct.
20 pause
21
22 erase /E %dest%\tex2rtf.zip
23 erase /E %dest%\tex2rtf_setup.exe
24 erase /E %dest\tex2rtf_src.zip
25
26 if direxist %dest%\tex2rtf erase /sxzy %dest%\tex2rtf\
27
28 Rem *** First, determine version from symbols.h
29 call ming2952
30 echo `#include <stdio.h>` > tex2rtfver.c
31 echo `#include "symbols.h"` >> tex2rtfver.c
32 echo `int main() { printf("%.2f", TEX2RTF_VERSION_NUMBER); }` >> tex2rtfver.c
33 gcc tex2rtfver.c -I%src%\src -o tex2rtfver.exe
34 tex2rtfver.exe > tex2rtfversion.txt
35 set ver=%@LINE[tex2rtfversion.txt,0]
36 echo %ver%
37 erase tex2rtfver.exe tex2rtfver.c
38 set ver_filename=%ver%
39
40 echo Updating docs...
41 call msvc6
42
43 pushd %src%\docs
44 erase /Y tex2rtf_contents.html
45 nmake -f makefile.vc htmlhelp htb
46 popd
47
48 cd %src%
49 echo Zipping source...
50
51 zip32 -@ %src%\tex2rtf_src.zip < %src%\distrib\src.rsp
52
53 echo Adding files...
54
55 copy %src%\src\%ReleaseDir%\tex2rtf.exe %src%
56 copy %src%\docs\licence.txt %src%
57 copy %src%\docs\lgpl.txt %src%
58 copy %src%\docs\gpl.txt %src%
59 copy %src%\docs\readme.txt %src%
60 copy %src%\docs\tex2rtf.chm %src%
61 copy %src%\distrib\tex2rtf.exe.manifest %src%
62 copy %src%\tools\lacheck.exe %src%
63 copy %src%\tools\lacheck.txt %src%
64 Rem goto end
65
66 upx %src%\tex2rtf.exe
67
68 zip -@ %dest%\tex2rtf.zip < %src%\distrib\distrib.rsp
69 zip -j -u %dest%\tex2rtf.zip %src%\tex2rtf.exe
70
71 :dounzip
72
73 cd %dest%
74
75 mkdir tex2rtf
76 cd tex2rtf
77 unzip32 -o ..\tex2rtf.zip
78
79 cd %dest%
80
81 echo inno = %inno%
82
83 Rem Skip Inno Setup setup if inno is 0.
84 if "%inno%" == "0" goto end
85
86 set tex2rtfver=%ver%
87
88 echo ver is %ver%
89 echo tex2rtfver is %tex2rtfver%
90
91 echo Calling 'makeinno' to generate tex2rtf.iss...
92 cd %dest%\tex2rtf
93 call %src%\distrib\makeinno.bat
94
95 sed -e "s/TEX2RTFVERSION/%tex2rtfver%/g" %src%\distrib\tex2rtf.iss > %TEMP%\tex2rtf.iss
96
97 move %TEMP%\tex2rtf.iss %src%\distrib\tex2rtf.iss
98
99 rem Now invoke Inno Setup install on the new tex2rtf.iss
100 set innocmd="C:\Program Files\Inno Setup 2\compil32.exe" /cc %src%\distrib\tex2rtf.iss
101 echo Invoking %innocmd%...
102 cd %dest%
103 start "Inno Setup" /w %innocmd%
104
105 Rem Rename to give it a version
106 move setup.exe tex2rtf_%ver_filename%_setup.exe
107
108 Rem clean up files
109 cd %src%
110 erase /EFY *.bmp *.htm *.exe *.hlp *.cnt *.txt *.rtf *.doc *.gif *.jpg *.manifest *.chm
111
112 cd %dest%
113
114 echo Tex2RTF archived.
115 goto end
116
117 :usage
118 echo Tex2RTF distribution.
119
120 :end