chiark / gitweb /
Fix completion checking in Killer Solo.
[sgt-puzzles.git] / wceinf.pl
1 #!/usr/bin/perl
2
3 # Perl script to generate a .INF file for building a Pocket PC .CAB
4 # archive of Puzzles. This has to be scripted so that it can read
5 # gamedesc.txt and automatically adjust to the current available
6 # set of puzzles.
7
8 # Usage:
9 #
10 #   $ ./wceinf.pl gamedesc.txt > puzzles.inf
11
12 $desc = shift @ARGV;
13 open DESC, "<", $desc;
14 while (<DESC>) {
15     chomp;
16     @_ = split /:/;
17     push @exes, $_[1];
18     $names{$_[1]} = $_[2];
19 }
20 close DESC;
21
22 print '[Version]'."\n";
23 print 'Signature   = "$Windows NT$"    ; required as-is'."\n";
24 print 'Provider    = "Simon Tatham"    ; full app name will be "<Provider> <AppName>"'."\n";
25 print 'CESignature = "$Windows CE$"    ; required as-is'."\n";
26 print ''."\n";
27 print '[CEStrings]'."\n";
28 print 'AppName     = "Puzzle Collection"    ; full app name will be "<Provider> <AppName>"'."\n";
29 print 'InstallDir  = %CE8%\%AppName%        ; "\Program Files\Games\Puzzle Collection" (default install directory)'."\n";
30 print ''."\n";
31 print '[CEDevice.x86]'."\n";
32 print 'ProcessorType = 686'."\n";
33 print ''."\n";
34 print '[CEDevice.ARM]'."\n";
35 print 'ProcessorType = 2577'."\n";
36 print ''."\n";
37 print '[SourceDisksNames.x86]             ; CPU-dependent files'."\n";
38 print '2 = ,"x86 Files",,.'."\n";
39 print ''."\n";
40 print '[SourceDisksNames.ARMV4]           ; CPU-dependent files'."\n";
41 print '2 = ,"ARM Files",,.'."\n";
42 print ''."\n";
43 print '[SourceDisksFiles]'."\n";
44 for $exe (@exes) {
45     print $exe.' = 2'."\n";
46 }
47 print ''."\n";
48 print '[DefaultInstall]'."\n";
49 print 'CopyFiles   = PuzzleFiles'."\n";
50 print 'CEShortcuts = Links'."\n";
51 print ''."\n";
52 print '[DestinationDirs]'."\n";
53 print 'PuzzleFiles = 0, %InstallDir%'."\n";
54 print 'Links       = 0, %CE14%\Puzzles'."\n";
55 print ''."\n";
56 print ';File copy list.'."\n";
57 print '[PuzzleFiles]'."\n";
58 for $exe (@exes) {
59     print $exe."\n";
60 }
61 print ''."\n";
62 print '[Links]'."\n";
63 for $exe (@exes) {
64     print '"'.$names{$exe}.'",0,'.$exe."\n";
65 }