-
Notifications
You must be signed in to change notification settings - Fork 138
/
mk_inno.pl
executable file
·99 lines (78 loc) · 2.41 KB
/
mk_inno.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#! perl
# Copyright (C) 2005-2009, Parrot Foundation.
=head1 TITLE
tools/dev/mk_inno.pl - Create a script for Inno Setup
=head1 SYNOPSIS
% perl tools/dev/mk_inno.pl
=head1 DESCRIPTION
From L<http://www.jrsoftware.org/>: Inno Setup is a free installer for
Windows programs.
=cut
use strict;
use warnings;
use lib qw( lib ../lib ../../lib );
use Parrot::Config;
my $version = $PConfig{VERSION} . $PConfig{DEVEL};
my $prefix = $PConfig{prefix};
$prefix =~ s/\//\\/g;
my $icu_section = q{};
$icu_section = qq{
Source: "$PConfig{icu_dir}\\license.html"; DestDir: "{app}\\icu"; Flags:
Source: "$PConfig{icu_dir}\\bin\\icu*.dll"; DestDir: "{app}\\bin"; Flags:
} if ($PConfig{has_icu});
my %dll = (
gccversion => [ 'libgcc_s_sjlj-1.dll' ],
HAS_GETTEXT => [ 'libintl3.dll', 'libiconv2.dll' ],
HAS_PCRE => [ 'pcre3.dll' ],
HAS_READLINE => [ 'readline5.dll' ],
);
my $dll_section = q{};
while (my ($flag, $dlls) = each %dll) {
next unless ($PConfig{$flag});
foreach my $dll (@{$dlls}) {
my $path = `which $dll`;
chomp $path;
$path =~ s/\//\\/g;
$dll_section .= "Source: \"$path\"; DestDir: \"{app}\\bin\"; Flags:\n"
if ($path);
}
}
my $filename = 'parrot.iss';
open my $OUT, '>', $filename
or die "Can't open $filename ($!)";
print $OUT qq{
; generated by tools/dev/mk_inno.pl for the Inno Setup Script Compiler.
[Setup]
AppName=Parrot
AppVerName=Parrot-$version
AppPublisher=Parrot Foundation
AppPublisherURL=http://www.parrot.org/
AppSupportURL=http://www.parrot.org/
AppUpdatesURL=http://www.parrot.org/
DefaultDirName={sd}$prefix
DefaultGroupName=Parrot
AllowNoIcons=yes
LicenseFile=$prefix\\share\\doc\\parrot\\LICENSE
OutputDir=.\\
OutputBaseFilename=setup-parrot-$version
Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
PrivilegesRequired=none
ChangesEnvironment=yes
[Files]
Source: "$prefix\\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
${icu_section}
${dll_section}
[Icons]
Name: "{group}\\{cm:UninstallProgram,parrot}"; Filename: "{uninstallexe}"
[Registry]
Root: HKLM; SubKey: "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\"; ValueType: expandsz; ValueName: "Path"; ValueData: "{reg:HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\,Path};{app}\\bin"
};
close $OUT;
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: