3 # Create an Inno Setup installer on MSW. It requires MSYS.
7 # distrib/msw/createsetup.sh
11 # (1) Change VERSION to the desired wxWidgets version.
12 # (2) Change APPDIR to the root of a wxWidgets distribution containing
14 # (3) Change DESTDIR (if necessary) to a directory for creating the
16 # (4) Change SETUPCOMPILER to where Inno Setup is installed.
17 # (6) Make sure 'unzip' is in your path.
18 # (7) Make sure wxMSW-x.y.z.zip and wxWidgets-x.y.z-CHM.zip are in
19 # the directory $DESTDIR.
20 # (8) Run createsetup.sh.
22 # The necessary script files are:
24 # distrib/msw/createsetup.sh ; The main script
25 # distrib/msw/wxwidgets_in.iss ; The input for making the .iss
28 #-------------------------------------------------------------------------
30 #-------------------------------------------------------------------------
34 #-------------------------------------------------------------------------
35 # The application title
36 #-------------------------------------------------------------------------
40 #-------------------------------------------------------------------------
41 # The application author (copyright holder)
42 #-------------------------------------------------------------------------
44 AUTHOR
="The wxWidgets Team"
46 #-------------------------------------------------------------------------
47 # The application vendor (organisation)
48 #-------------------------------------------------------------------------
52 #-------------------------------------------------------------------------
53 # The top-level directory of the application source tree
54 #-------------------------------------------------------------------------
56 APPDIR
=c
:/wx
2dev
/wxWindows
58 #-------------------------------------------------------------------------
59 # The destination directory of the setup
60 #-------------------------------------------------------------------------
62 DESTDIR
=$APPDIR/deliver
64 #-------------------------------------------------------------------------
65 # The temporary image directory to use when preparing the setup
66 #-------------------------------------------------------------------------
68 SETUPIMAGEDIR
=$DESTDIR/wxWidgets
-$VERSION
70 #-------------------------------------------------------------------------
71 # The location of the setup script
72 #-------------------------------------------------------------------------
74 SETUPSCRIPTNAME
=$APPDIR/distrib
/msw
/wxwidgets.iss
75 SETUPSCRIPTNAME_IN
=$APPDIR/distrib
/msw
/wxwidgets_in.iss
77 #-------------------------------------------------------------------------
78 # The location of the zip files to be used to create the setup
79 #-------------------------------------------------------------------------
81 WXMSWARCHIVE
=$DESTDIR/wxMSW
-$VERSION.
zip
82 WXCHMARCHIVE
=$DESTDIR/wxWidgets
-$VERSION-CHM.
zip
84 #-------------------------------------------------------------------------
85 # The locations of the readme and license files
86 #-------------------------------------------------------------------------
88 READMEFILE
=$SETUPIMAGEDIR/docs
/readme.txt
89 READMEAFTERFILE
=$SETUPIMAGEDIR/docs
/msw
/install.txt
90 LICENSEFILE
=$SETUPIMAGEDIR/docs
/licence.txt
92 #-------------------------------------------------------------------------
93 # The location of the setup compiler
94 #-------------------------------------------------------------------------
96 SETUPCOMPILER
="c:/Program Files/Inno Setup 5/compil32.exe"
98 #-------------------------------------------------------------------------
100 #-------------------------------------------------------------------------
102 # If your zip accepts Cygwin-style paths, then
103 # use cygpath, else substitute echo
107 SCRIPTDIR
=$WXWIN/distrib
/msw
110 # Seds the file represented by the 1st arg, using the expression passed as the 2nd arg.
116 if [ -f $thefile ]; then
117 sed -e "$theexpr" < $thefile > $thefile.tmp
118 mv $thefile.tmp
$thefile
120 echo "*** $thefile not found."
126 echo $1 | sed -e "s/\//\\\\\\\/g" > /tmp
/filename.tmp
127 RETVALUE
=`cat /tmp/filename.tmp`
128 rm -f /tmp
/filename.tmp
133 echo $1 | sed -e "s/\//\\\\/g" > /tmp
/filename.tmp
134 RETVALUE
=`cat /tmp/filename.tmp`
135 rm -f /tmp
/filename.tmp
140 if [ "$VERBOSE" != "1" ]; then
145 # Do the actual spin.
154 rm -f -r wxWidgets
-$VERSION
155 rm -f -r wxMSW
-$VERSION
157 echo Unzipping the wxMSW files...
159 unzip $ZIPFLAGS $WXMSWARCHIVE
161 # This 'pause' is only necessary because on my system, the following 'mv' seems to fail
163 echo About to rename wxMSW
-$VERSION to wxWidgets
-$VERSION. Press Return to
continue.
166 mv wxMSW
-$VERSION wxWidgets
-$VERSION
168 if [ ! -d wxWidgets
-$VERSION ]; then
169 echo *** Could not
find wxWidgets
-$VERSION: exiting.
173 echo Unzipping the CHM files...
175 cd wxWidgets
-$VERSION
176 unzip $ZIPFLAGS $WXCHMARCHIVE
178 echo Copying readme files...
179 cp docs
/msw
/readme.txt README
-MSW.txt
180 cp docs
/msw
/install.txt INSTALL
-MSW.txt
181 cp docs
/licence.txt LICENCE.txt
182 cp docs
/lgpl.txt COPYING.LIB
183 cp docs
/changes.txt CHANGES.txt
184 cp docs
/readme.txt README.txt
186 # Now cp some binary files to 'bin'
188 # if [ ! -d bin ]; then
191 # cp $APPDIR/bin/tex2rtf.exe bin
192 # cp $APPDIR/bin/tex2rtf.chm bin
193 # cp $APPDIR/bin/widgets.exe bin
194 # cp $APPDIR/bin/life.exe bin
195 # cp $APPDIR/demos/life/breeder.lif bin
196 # cp $APPDIR/docs/htmlhelp/tex2rtf.chm bin
198 # Now replace %VERSION% with the real application version, and other
201 cp $SETUPSCRIPTNAME_IN $SETUPSCRIPTNAME
203 echo Replacing variables
in the setup
script
204 doreplace
$SETUPSCRIPTNAME "s/%VERSION%/$VERSION/g"
205 doreplace
$SETUPSCRIPTNAME "s/%COPYRIGHTHOLDER%/$AUTHOR/g"
206 doreplace
$SETUPSCRIPTNAME "s/%VENDOR%/$VENDOR/g"
208 unix2dosname
$READMEFILE
209 doreplace
$SETUPSCRIPTNAME "s;%READMEFILE%;$RETVALUE;g"
211 unix2dosname
$READMEAFTERFILE
212 doreplace
$SETUPSCRIPTNAME "s;%READMEAFTERFILE%;$RETVALUE;g"
214 unix2dosname
$LICENSEFILE
215 doreplace
$SETUPSCRIPTNAME "s;%LICENSEFILE%;$RETVALUE;g"
217 doreplace
$SETUPSCRIPTNAME "s/%APPTITLE%/$APPTITLE/g"
219 unix2dosname
$SETUPIMAGEDIR
220 doreplace
$SETUPSCRIPTNAME "s;%SOURCEDIR%;$RETVALUE;g"
222 unix2dosname
$DESTDIR
223 doreplace
$SETUPSCRIPTNAME "s;%OUTPUTDIR%;$RETVALUE;g"
225 rm -f $DESTDIR/setup
*.
* $DESTDIR/wxMSW
-$VERSION-Setup.exe
227 # Inno Setup complains if this step is not done
228 unix2dos
--unix2dos $SETUPSCRIPTNAME
230 # Now invoke INNO compiler on the new ISS file
231 # First, make a DOS filename or Inno Setup will get confused.
233 unix2dosname2
$SETUPSCRIPTNAME
234 DOSFILENAME
=$RETVALUE
236 # Note: the double slash is Mingw32/MSYS convention for
237 # denoting a switch, that must not be converted into
238 # a path (otherwise /c = c:/)
240 cd `dirname $SETUPSCRIPTNAME`
241 BASESCRIPTNAME
=`basename $SETUPSCRIPTNAME`
242 echo Invoking Inno Setup compiler on
$BASESCRIPTNAME
244 "$SETUPCOMPILER" //cc
$BASESCRIPTNAME
246 if [ ! -f $DESTDIR/setup.exe
]; then
247 echo "*** Error - the setup.exe was not generated."
252 mv setup.exe wxMSW
-$VERSION-Setup.exe
254 echo If you saw no warnings or errors
, $APPTITLE was successfully spun.
261 echo Getting archives...
263 curl http
://biolpc22.york.ac.uk
/pub
/$VERSION/wxMSW
-$VERSION.
zip
264 curl http
://biolpc22.york.ac.uk
/pub
/$VERSION/wxWidgets
-$VERSION-CHM.
zip
267 #curl http://biolpc22.york.ac.uk/pub/$VERSION/wxWidgets-Windows-Binaries.zip
269 echo Done getting archives.
272 # We can't use e.g. this:
273 # ls `cat $SRC/distrib/msw/makefile.rsp` zip -@ -u $DEST/wxWidgets-$VERSION-gen.zip
274 # because there's not enough space on the command line, plus we need to ignore the
276 # So if we need to (not in this script so far) we do something like this instead:
277 # expandlines $SRC/setup/files.rsp temp.txt
278 # zip -@ `$CYGPATHPROG -w $DEST/archive.zip` < temp.txt
287 for line
in `cat $toexpand` ; do
288 if [ $line != "" ]; then
289 ls $line >> $outputfile
296 echo "Usage: $PROGNAME [ options ]" 1>&2
298 echo " --help Display this help message"
299 echo " --verbose Verbose zip operation"
301 echo Note that options only override settings
in $SCRIPTDIR/setup.var.
305 # Process command line options.
309 --getarchives) GETARCHIVES
=1 ;;
310 --verbose) VERBOSE
=1 ;;
321 if [ "$GETARCHIVES" = "1" ]; then