shithub: puzzles

Download patch

ref: b05cb1eaf37d9ffd2dad7e335c344b2455d9f1e2
parent: 63e5783d7e3a84764e6ba12a99afa8656215e0f2
author: Simon Tatham <anakin@pobox.com>
date: Sat Feb 24 14:33:38 EST 2007

Build an installer for Puzzles.

[originally from svn r7319]

--- a/Buildscr
+++ b/Buildscr
@@ -24,9 +24,11 @@
   return puzzles/Puzzles.dmg
 enddelegate
 
-# Build the Windows binaries and the CHM file.
+# Build the Windows binaries and installer, and the CHM file.
 in puzzles do make -f Makefile.doc clean
 in puzzles do make -f Makefile.doc chm
+in puzzles do make -f Makefile.doc # build help file for installer
+in puzzles do perl winiss.pl $(revision) wingames.lst > puzzles.iss
 delegate windows
   # Ignore the poorly controlled return value from HHC, and instead
   # just test that the output file was generated.
@@ -34,13 +36,16 @@
   # FIXME: Cygwin alternative?
   in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc clean'
   in puzzles do cmd /c 'vcvars32 & nmake -f Makefile.vc VER=-DREVISION=$(revision)'
+  # Build installer.
+  in puzzles do iscc puzzles.iss
   return puzzles/puzzles.chm
   return puzzles/*.exe
+  return puzzles/Output/setup.exe
 enddelegate
 
 # Build the help file and the HTML docs.
-in puzzles do make -f Makefile.doc clean
-in puzzles do make -f Makefile.doc
+in puzzles do make -f Makefile.doc clean # remove CHM-target HTML
+in puzzles do make -f Makefile.doc # and rebuild help file...
 in puzzles do mkdir doc
 in puzzles do mkdir devel
 in puzzles/doc do halibut --html -Chtml-contents-filename:index.html -Chtml-index-filename:indexpage.html -Chtml-template-filename:%k.html -Chtml-template-fragment:%k ../puzzles.but
@@ -51,7 +56,7 @@
 # excludes the command-line auxiliary utilities such as solosolver,
 # and nullgame.exe) into a subdirectory for easy access.
 in puzzles do mkdir winbin
-in puzzles do mv `cat wingames.lst` winbin
+in puzzles do mv `cut -f1 -d: wingames.lst` winbin
 
 # Make a zip file of the Windows binaries and help files.
 in puzzles do zip -j puzzles.zip winbin/*.exe puzzles.chm puzzles.hlp puzzles.cnt
@@ -77,6 +82,7 @@
 deliver puzzles/puzzles.hlp $@
 deliver puzzles/puzzles.cnt $@
 deliver puzzles/puzzles.zip $@
+deliver puzzles/Output/setup.exe puzzles-r$(revision)-installer.exe
 # This one isn't in the puzzles subdir, because makedist.sh left it
 # one level up.
 deliver puzzles*.tar.gz $@
--- a/blackbox.R
+++ b/blackbox.R
@@ -15,5 +15,5 @@
 !end
 
 !begin >wingames.lst
-blackbox.exe
+blackbox.exe:Black Box
 !end
--- a/bridges.R
+++ b/bridges.R
@@ -17,5 +17,5 @@
 !end
 
 !begin >wingames.lst
-bridges.exe
+bridges.exe:Bridges
 !end
--- a/cube.R
+++ b/cube.R
@@ -15,5 +15,5 @@
 !end
 
 !begin >wingames.lst
-cube.exe
+cube.exe:Cube
 !end
--- a/dominosa.R
+++ b/dominosa.R
@@ -15,5 +15,5 @@
 !end
 
 !begin >wingames.lst
-dominosa.exe
+dominosa.exe:Dominosa
 !end
--- a/fifteen.R
+++ b/fifteen.R
@@ -15,5 +15,5 @@
 !end
 
 !begin >wingames.lst
-fifteen.exe
+fifteen.exe:Fifteen
 !end
--- a/flip.R
+++ b/flip.R
@@ -17,5 +17,5 @@
 !end
 
 !begin >wingames.lst
-flip.exe
+flip.exe:Flip
 !end
--- a/galaxies.R
+++ b/galaxies.R
@@ -20,5 +20,5 @@
 !end
 
 !begin >wingames.lst
-galaxies.exe
+galaxies.exe:Galaxies
 !end
--- a/guess.R
+++ b/guess.R
@@ -15,5 +15,5 @@
 !end
 
 !begin >wingames.lst
-guess.exe
+guess.exe:Guess
 !end
--- a/inertia.R
+++ b/inertia.R
@@ -15,5 +15,5 @@
 !end
 
 !begin >wingames.lst
-inertia.exe
+inertia.exe:Inertia
 !end
--- a/lightup.R
+++ b/lightup.R
@@ -20,5 +20,5 @@
 !end
 
 !begin >wingames.lst
-lightup.exe
+lightup.exe:Light Up
 !end
--- a/loopy.R
+++ b/loopy.R
@@ -17,5 +17,5 @@
 !end
 
 !begin >wingames.lst
-loopy.exe
+loopy.exe:Loopy
 !end
--- a/map.R
+++ b/map.R
@@ -20,5 +20,5 @@
 !end
 
 !begin >wingames.lst
-map.exe
+map.exe:Map
 !end
--- a/mines.R
+++ b/mines.R
@@ -20,5 +20,5 @@
 !end
 
 !begin >wingames.lst
-mines.exe
+mines.exe:Mines
 !end
--- a/net.R
+++ b/net.R
@@ -19,5 +19,5 @@
 !end
 
 !begin >wingames.lst
-netgame.exe
+netgame.exe:Net
 !end
--- a/netslide.R
+++ b/netslide.R
@@ -17,5 +17,5 @@
 !end
 
 !begin >wingames.lst
-netslide.exe
+netslide.exe:Netslide
 !end
--- a/pattern.R
+++ b/pattern.R
@@ -18,5 +18,5 @@
 !end
 
 !begin >wingames.lst
-pattern.exe
+pattern.exe:Pattern
 !end
--- a/pegs.R
+++ b/pegs.R
@@ -17,5 +17,5 @@
 !end
 
 !begin >wingames.lst
-pegs.exe
+pegs.exe:Pegs
 !end
--- a/rect.R
+++ b/rect.R
@@ -15,5 +15,5 @@
 !end
 
 !begin >wingames.lst
-rect.exe
+rect.exe:Rectangles
 !end
--- a/samegame.R
+++ b/samegame.R
@@ -15,5 +15,5 @@
 !end
 
 !begin >wingames.lst
-samegame.exe
+samegame.exe:Same Game
 !end
--- a/sixteen.R
+++ b/sixteen.R
@@ -15,5 +15,5 @@
 !end
 
 !begin >wingames.lst
-sixteen.exe
+sixteen.exe:Sixteen
 !end
--- a/slant.R
+++ b/slant.R
@@ -20,5 +20,5 @@
 !end
 
 !begin >wingames.lst
-slant.exe
+slant.exe:Slant
 !end
--- a/solo.R
+++ b/solo.R
@@ -18,5 +18,5 @@
 !end
 
 !begin >wingames.lst
-solo.exe
+solo.exe:Solo
 !end
--- a/tents.R
+++ b/tents.R
@@ -20,5 +20,5 @@
 !end
 
 !begin >wingames.lst
-tents.exe
+tents.exe:Tents
 !end
--- a/twiddle.R
+++ b/twiddle.R
@@ -15,5 +15,5 @@
 !end
 
 !begin >wingames.lst
-twiddle.exe
+twiddle.exe:Twiddle
 !end
--- a/unequal.R
+++ b/unequal.R
@@ -23,5 +23,5 @@
 !end
 
 !begin >wingames.lst
-unequal.exe
+unequal.exe:Unequal
 !end
--- a/untangle.R
+++ b/untangle.R
@@ -17,5 +17,5 @@
 !end
 
 !begin >wingames.lst
-untangle.exe
+untangle.exe:Untangle
 !end
--- /dev/null
+++ b/website.url
@@ -1,0 +1,2 @@
+[InternetShortcut]
+URL=http://www.chiark.greenend.org.uk/~sgtatham/puzzles/
--- /dev/null
+++ b/winiss.pl
@@ -1,0 +1,64 @@
+#!/usr/bin/perl
+
+# Perl script to generate an Inno Setup installer script for
+# Puzzles. This has to be scripted so that it can read wingames.lst
+# and automatically adjust to the current available set of puzzles.
+
+# Usage:
+#
+#   $ ./winiss.pl 1234 wingames.lst > puzzles.iss
+#
+# where `1234' is the revision number which will be encoded in the
+# installer's version indicators.
+
+$rev = shift @ARGV;
+($revclean=$rev) =~ s/M$//;
+$lst = shift @ARGV;
+open LST, "<", $lst;
+while (<LST>) {
+    chomp;
+    split /:/;
+    push @exes, $_[0];
+    $names{$_[0]} = $_[1];
+}
+close LST;
+
+print '; -*- no -*-'."\n";
+print ';'."\n";
+print '; -- Inno Setup installer script for Puzzles.'."\n";
+print ''."\n";
+print '[Setup]'."\n";
+print 'AppName=Simon Tatham\'s Portable Puzzle Collection'."\n";
+print 'AppVerName=Puzzles revision '.$rev."\n";
+print 'VersionInfoTextVersion=Revision '.$rev."\n";
+print 'AppVersion=r'.$rev."\n";
+print 'VersionInfoVersion=0.0.'.$revclean.'.0'."\n";
+print 'AppPublisher=Simon Tatham'."\n";
+print 'AppPublisherURL=http://www.chiark.greenend.org.uk/~sgtatham/puzzles/'."\n";
+print 'DefaultDirName={pf}\Simon Tatham\'s Portable Puzzle Collection'."\n";
+print 'DefaultGroupName=Simon Tatham\'s Puzzles'."\n";
+# print 'SetupIconFile=fixmethinkoneup.ico'."\n";
+# print 'UninstallDisplayIcon={app}\fixmethinkoneup.exe'."\n";
+print 'ChangesAssociations=no'."\n";
+print 'Compression=zip/9'."\n";
+print 'AllowNoIcons=yes'."\n";
+print ''."\n";
+print '[Files]'."\n";
+for $exe (@exes) {
+    print 'Source: "'.$exe.'"; DestDir: "{app}"; Flags: promptifolder replacesameversion uninsrestartdelete'."\n";
+}
+print 'Source: "website.url"; DestDir: "{app}"; Flags: uninsrestartdelete'."\n";
+print 'Source: "puzzles.chm"; DestDir: "{app}"; Flags: uninsrestartdelete'."\n";
+print 'Source: "puzzles.hlp"; DestDir: "{app}"; Flags: uninsrestartdelete'."\n";
+print 'Source: "puzzles.cnt"; DestDir: "{app}"; Flags: uninsrestartdelete'."\n";
+print 'Source: "LICENCE"; DestDir: "{app}"; Flags: uninsrestartdelete'."\n";
+print ''."\n";
+print '[Icons]'."\n";
+for $exe (@exes) {
+    print 'Name: "{group}\\'.$names{$exe}.'"; Filename: "{app}\\'.$exe.'"'."\n";
+}
+print '; We have to fall back from the .chm to the older .hlp file on some Windows'."\n";
+print '; versions.'."\n";
+print 'Name: "{group}\Puzzles Manual"; Filename: "{app}\puzzles.chm"; MinVersion: 4.1,5.0'."\n";
+print 'Name: "{group}\Puzzles Manual"; Filename: "{app}\puzzles.hlp"; OnlyBelowVersion: 4.1,5.0'."\n";
+print 'Name: "{group}\Puzzles Web Site"; Filename: "{app}\website.url"'."\n";