use strict;
use Getopt::Long;
use Pod::Usage;
+use File::Temp qw/tempfile/;
=pod
=cut
my $objdump;
+my %files;
+
my $help = '';
my $man = '';
my $verbose = '';
-my %files;
+my $run = '';
my $name = '';
my $outfile = 'installer.exe';
my $installdir = '';
"help|?" => \$help,
"man" => \$man,
"verbose" => \$verbose,
+ "run" => \$run,
"name=s" => \$name,
"outfile=s" => \$outfile,
"installdir=s" => \$installdir,
WriteUninstaller "\$INSTDIR\\Uninstall $name.exe"
SectionEnd
EOT
+}
+# Run makensis on the named file.
+
+sub run_makensis
+{
+ my $filename = shift;
+
+ system ("makensis", $filename) == 0 or die "makensis: $?"
}
# Main program.
do_dependencies ();
install_names ();
print_files () if $verbose;
- write_script (\*STDOUT);
+ if ($run) {
+ my ($io, $filename) = tempfile ("nswXXXXXX", UNLINK => 1);
+ write_script ($io);
+ close $io;
+ run_makensis ($filename);
+ } else {
+ write_script (\*STDOUT);
+ }
}
main ()