[cage] Unbreak the build
[parrot.git] / tools / dev / mk_inno.pl
blobff39fa41ce84bb3bb8004675e04b57f23c7cebd5
1 #! perl
2 # Copyright (C) 2005-2009, Parrot Foundation.
3 # $Id$
5 =head1 TITLE
7 tools/dev/mk_inno.pl - Create a script for Inno Setup
9 =head1 SYNOPSIS
11 % perl tools/dev/mk_inno.pl
13 =head1 SEE ALSO
15 http://www.jrsoftware.org/
17 =cut
19 use strict;
20 use warnings;
21 use lib qw( lib ../lib ../../lib );
22 use Parrot::Config;
24 my $version = $PConfig{VERSION} . $PConfig{DEVEL};
26 my $prefix = $PConfig{prefix};
27 $prefix =~ s/\//\\/g;
29 my $icu_section = q{};
30 $icu_section = qq{
31 Source: "$PConfig{icu_dir}\\license.html"; DestDir: "{app}\\icu"; Flags:
32 Source: "$PConfig{icu_dir}\\bin\\icu*.dll"; DestDir: "{app}\\bin"; Flags:
33 } if ($PConfig{has_icu});
35 my %dll = (
36 has_gdbm => [ 'gdbm3.dll' ],
37 HAS_GETTEXT => [ 'libintl3.dll', 'libiconv2.dll' ],
38 HAS_PCRE => [ 'pcre3.dll' ],
39 HAS_READLINE => [ 'readline5.dll' ],
42 my $dll_section = q{};
43 while (my ($flag, $dlls) = each %dll) {
44 next unless ($PConfig{$flag});
45 foreach my $dll (@{$dlls}) {
46 my $path = `which $dll`;
47 chomp $path;
48 $path =~ s/\//\\/g;
49 $dll_section .= "Source: \"$path\"; DestDir: \"{app}\\bin\"; Flags:\n"
50 if ($path);
54 my $filename = 'parrot.iss';
55 open my $OUT, '>', $filename
56 or die "Can't open $filename ($!)";
58 print $OUT qq{
59 ; generated by tools/dev/mk_inno.pl for the Inno Setup Script Compiler.
61 [Setup]
62 AppName=Parrot
63 AppVerName=Parrot-$version
64 AppPublisher=Parrot Foundation
65 AppPublisherURL=http://www.parrot.org/
66 AppSupportURL=http://www.parrot.org/
67 AppUpdatesURL=http://www.parrot.org/
68 DefaultDirName={sd}$prefix
69 DefaultGroupName=Parrot
70 AllowNoIcons=yes
71 LicenseFile=$prefix\\share\\doc\\parrot\\LICENSE
72 OutputDir=.\\
73 OutputBaseFilename=setup-parrot-$version
74 Compression=lzma
75 SolidCompression=yes
76 ChangesAssociations=yes
77 PrivilegesRequired=none
78 ChangesEnvironment=yes
80 [Files]
81 Source: "$prefix\\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
82 ${icu_section}
83 ${dll_section}
85 [Icons]
86 Name: "{group}\\{cm:UninstallProgram,parrot}"; Filename: "{uninstallexe}"
88 [Registry]
89 Root: HKLM; SubKey: "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\"; ValueType: string; ValueName: "Path"; ValueData: "{reg:HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\,Path};{app}\\bin"
92 close $OUT;
94 # Local Variables:
95 # mode: cperl
96 # cperl-indent-level: 4
97 # fill-column: 100
98 # End:
99 # vim: expandtab shiftwidth=4: