diff options
author | Karl Berry <karl@freefriends.org> | 2008-10-10 23:57:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-10-10 23:57:12 +0000 |
commit | 1a5ee81681544353ec1d0d5bb03fd2683588ead5 (patch) | |
tree | 33a4042638129b59dc69f04294b102070dc483e3 /Master/tlpkg/bin/tl-update-nsis | |
parent | 5045cf0ceaea0306461134c8e404a9c11833f9c7 (diff) |
rename for consistency with others
git-svn-id: svn://tug.org/texlive/trunk@10919 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/tl-update-nsis')
-rwxr-xr-x | Master/tlpkg/bin/tl-update-nsis | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/Master/tlpkg/bin/tl-update-nsis b/Master/tlpkg/bin/tl-update-nsis new file mode 100755 index 00000000000..483f2f68ce1 --- /dev/null +++ b/Master/tlpkg/bin/tl-update-nsis @@ -0,0 +1,160 @@ +#!/usr/bin/env perl +# $Id$ +# Copyright 2008 Norbert Preining +# This file is licensed under the GNU General Public License version 2 +# or any later version. +# +# Create a .nsi file for the Win32 updates + +BEGIN { + $^W = 1; + ($mydir = $0) =~ s,/[^/]*$,,; + unshift (@INC, "$mydir/.."); +} + +our $mydir; + +use strict; + +use TeXLive::TLConfig; +use TeXLive::TLUtils; +use TeXLive::TLPOBJ; +use TeXLive::TLPDB; +use Getopt::Long; +use Pod::Usage; +use File::Path; + +my $help = 0; + +TeXLive::TLUtils::process_logging_options(); + +GetOptions("help|?" => \$help) or pod2usage(1); +pod2usage(-exitstatus => 0, -verbose => 2) if $help; + +exit (&main ()); + +sub main +{ + # get the db. + chomp (my $Master = `cd $mydir/../.. && pwd`); # xx TLPDB should default + my $tlpdb = TeXLive::TLPDB->new ("root" => "$Master"); + die("Cannot find tlpdb in $Master!\n") unless defined($tlpdb); + my $bintexlive = $tlpdb->get_package("bin-texlive"); + my $bintexlivew32 = $tlpdb->get_package("bin-texlive.win32"); + my $texliveinfra = $tlpdb->get_package("texlive.infra"); + my $texliveinfraw32 = $tlpdb->get_package("texlive.infra.win32"); + my %dirtofiles; + my @allfiles; + push @allfiles, $bintexlive->all_files; + push @allfiles, $bintexlivew32->all_files if defined $bintexlivew32; + push @allfiles, $texliveinfra->all_files; + push @allfiles, $texliveinfraw32->all_files; + my $rev = $bintexlive->revision; + if (defined($bintexlivew32)) { + $rev = ( $rev > $bintexlivew32->revision ? $rev : $bintexlivew32->revision ); + } + $rev = ( $rev > $texliveinfra->revision ? $rev : $texliveinfra->revision ); + $rev = ( $rev > $texliveinfraw32->revision ? $rev : $texliveinfraw32->revision ); + for my $f (@allfiles) { + if ($f !~ m!/!) { + $f = "./$f"; + } + my ($dn, $fn) = TeXLive::TLUtils::dirname_and_basename($f); + if (!defined($dirtofiles{$dn})) { + @{$dirtofiles{$dn}} = (); + } + push @{$dirtofiles{$dn}}, $fn; + } + print <<'EOF'; +!include "FileFunc.nsh" +!insertmacro GetParent + +EOF + print "!define REV \"rev$rev\"\n"; + +print <<'EOF'; + +Page directory +Page instfiles + +Name "TeX Live Update ${REV}" +OutFile "update-texlive-${REV}.exe" +InstallDir "$PROGRAMFILES\texlive\2008" + +DirText "Setup will update your TeX Live installation in the following folder. \ + To install in a different folder, click Browse and select another folder. \ + Click Install to start the update." + +Function .onInit + SearchPath $0 tlmgr.bat + ${GetParent} $0 $1 + ${GetParent} $1 $0 + ${GetParent} $0 $1 + ;MessageBox MB_OK "tlmgr=$1" + StrCpy $INSTDIR $1 + ;SetOutPath $1 +FunctionEnd + +Function .onVerifyInstDir + IfFileExists $INSTDIR\tlpkg\texlive.tlpdb PathGood + Abort + PathGood: +FunctionEnd + +Section "MainGroup" + #SetOutPath "$INSTDIR" + #File /r tlupdates\*.* +EOF + for my $d (keys %dirtofiles) { + my $dd = $d; + $dd =~ s!/!\\!g; + print " SetOutPath \"\$INSTDIR\\$dd\"\n"; + for my $f (@{$dirtofiles{$d}}) { + $f =~ s!/!\\!g; + print " File $dd\\$f\n"; + } + } +print <<'EOF'; + # order here is important!!! first the main packages, then the .doc ones! + ExecWait '"$INSTDIR\bin\win32\tlmgr.bat" _include_tlpobj "$INSTDIR\tlpkg\tlpobj\bin-texlive.tlpobj" "$INSTDIR\tlpkg\tlpobj\texlive.infra.tlpobj" "$INSTDIR\tlpkg\tlpobj\texlive.infra.doc.tlpobj" "$INSTDIR\tlpkg\tlpobj\texlive.infra.win32.tlpobj"' +SectionEnd +EOF +} + + + +__END__ + +=head1 NAME + +tl-create-nsis - creates a .nsi file for bin-texlive and texlive.infra + +=head1 SYNOPSIS + +tl-create-nsis [OPTION]... + +=head1 OPTIONS + +Only the standard options B<-help> and B<-q>, B<-v>, and +B<-logfile>=I<file> are accepted; see the C<process_logging_options> +function in L<TeXLive::TLUtils> for details. + +=head1 DESCRIPTION + +Creates a .nsi file that can be used with NSIS to create an update package +for Win32. + +=head1 AUTHORS AND COPYRIGHT + +This script and its documentation were written for the TeX Live +distribution (L<http://tug.org/texlive>) and both are licensed under the +GNU General Public License Version 2 or later. + +=cut + +### Local Variables: +### perl-indent-level: 2 +### tab-width: 2 +### indent-tabs-mode: nil +### End: +# vim:set tabstop=2 expandtab: # |