#-*- perl -*- # Copyright (C) 2001-7 R Development Core Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # A copy of the GNU General Public License is available at # http://www.r-project.org/Licenses/ # Send any bug reports to r-bugs@r-project.org use Cwd; use File::Find; my $fn, $component, $path; my $startdir=cwd(); my $RVER, $RVER0, $SVN; my $RW=$ARGV[0]; my $SRCDIR=$ARGV[1]; my $MDISDI=$ARGV[2]; my $HelpStyle=$ARGV[3]; my $Internet=$ARGV[4]; $SRCDIR =~ s+/+\\+g; # need DOS-style paths ## add to the target command line in the CmdParms function below open ver, "< ../../../VERSION"; $RVER = ; close ver; $RVER =~ s/\n.*$//; $RVER =~ s/Under .*$/Pre-release/; $RVER0 = $RVER; $RVER0 =~ s/ .*$//; ## now add SVN revision open ver, "< ../../../SVN-REVISION"; $SVN = ; close ver; $SVN =~s/Revision: //; $RVER0 .= "." . $SVN; open insfile, "> R.iss" || die "Cannot open R.iss\n"; print insfile < 0 then begin if active then lines[i][1] := \' \' else lines[i][1] := \'#\'; exit; end; end; procedure EditOptions(); var lines : TArrayOfString; filename : String; begin filename := ExpandConstant(CurrentFilename); LoadStringsFromFile(filename, lines); SetCommentMarker(lines, \'MDI = yes\', MDISDIPage.SelectedValueIndex = 0); SetCommentMarker(lines, \'MDI = no\', MDISDIPage.SelectedValueIndex = 1); SetCommentMarker(lines, \'options(chmhelp\', HelpStylePage.SelectedValueIndex = 1); SetCommentMarker(lines, \'options(htmlhelp\', HelpStylePage.SelectedValueIndex = 2); SaveStringsToFile(filename, lines, False); end; function CmdParms(Param:String): String; begin Result := \'\'; if InternetPage.SelectedValueIndex = 1 then Result := \'--internet2\'; end; function ShouldSkipPage(PageID: Integer): boolean; begin if PageID = NoAdminPage.ID then Result := IsAdmin else if (PageID = MDISDIPage.ID) or (PageID = HelpStylePage.ID) or (PageID = InternetPage.ID) then Result := SelectOptionsPage.SelectedValueIndex = 1 else Result := false; end; function UserPF(Param:String): String; begin Result := ExpandConstant(\'{pf}\'); if (not IsAdmin) then begin try Result := ExpandConstant('\{userdocs}\'); except // Do nothing, user doesn't have a My Documents folder end; end; end; [Files] END my %develfiles=("doc\\html\\logo.jpg" => 1, "README.packages" => 1, "COPYING.LIB" => 1, "bin\\INSTALL" => 1, "bin\\REMOVE" => 1, "bin\\SHLIB" => 1, "bin\\build" => 1, "bin\\check" => 1, "bin\\massage-Examples" => 1, "bin\\Rd2dvi.sh" => 1, "bin\\Rd2txt" => 1, "bin\\Rdconv" => 1, "bin\\Rdiff.sh" => 1, "bin\\Sd2Rd" => 1, "etc\\Makeconf" => 1); $path="${SRCDIR}";chdir($path); find(\&listFiles, "."); close insfile; sub listFiles { $fn = $File::Find::name; $fn =~ s+^./++; if (!(-d $_)) { $fn =~ s+/+\\+g; $dir = $fn; $dir =~ s/[^\\]+$//; $dir = "\\".$dir; $dir =~ s/\\$//; $_ = $fn; if ($_ eq "bin\\Rchtml.dll" || m/^library\\[^\\]*\\chtml/) { $component = "chtml"; } elsif ($_ eq "doc\\html\\logo.jpg") { $component = "html devel"; } elsif ($_ eq "doc\\manual\\R-FAQ.html" || $_ eq "doc\\html\\rw-FAQ.html" || $_ eq "share\\texmf\\Sweave.sty") { $component = "main"; } elsif (m/^library\\[^\\]*\\html/ || m/^library\\[^\\]*\\CONTENTS/ || $_ eq "library\\R.css") { $component = "html/help"; } elsif (m/^doc\\html/ || m/^doc\\manual\\[^\\]*\.html/ ) { $component = "html"; } elsif ($_ eq "doc\\manual\\R-data.pdf" || $_ eq "doc\\manual\\R-intro.pdf") { $component = "manuals/basic"; } elsif ($_ eq "doc\\manual\\R-admin.pdf" || $_ eq "doc\\manual\\R-exts.pdf" || $_ eq "doc\\manual\\R-ints.pdf" || $_ eq "doc\\manual\\R-lang.pdf") { $component = "manuals/technical"; } elsif ($_ eq "doc\\manual\\refman.pdf") { $component = "manuals/refman"; } elsif (m/^doc\\manual/ && $_ ne "doc\\manual\\R-FAQ.pdf") { $component = "manuals"; } elsif (m/^library\\[^\\]*\\latex/) { $component = "latex"; } elsif (m/^library\\[^\\]*\\man/) { $component = "Rd"; # } elsif (m/^Tcl\\doc/) { # $component = "tcl/docs"; } elsif (m/^Tcl\\doc\\.*chm$/) { $component = "tcl/chm"; } elsif (m/^Tcl/) { $component = "tcl"; } elsif (exists($develfiles{$_}) || m/^doc\\KEYWORDS/ || m/^src\\gnuwin32/ || m/^include/ || m/^src\\library\\windlgs/ || m/^share\\make/ || m/^share\\perl/ || m/^share\\R/ || m/^share\\texmf/ || m/^bin\\build/ || m/^bin\\check/ || m/^bin\\INSTALL/ || m/^bin\\massage-Examples/ || m/^bin\\Rd2dvi.sh/ || m/^bin\\Rd2txt/ || m/^bin\\Rdconv/ || m/^bin\\Rdiff.sh/ || m/^bin\\REMOVE/ || m/^bin\\Rprof/ || m/^bin\\Sd2Rd/ || m/^bin\\SHLIB/ || m/^lib\\/) { $component = "devel"; } elsif (m/^library\\grid\\doc/ || $_ eq "library\\survival\\survival.ps.gz") { $component = "libdocs"; } elsif ($_ eq "modules\\iconv.dll") { $component = "main"; } elsif (m/^share\\locale/ || m/^library\\[^\\]*\\po/) { # needs iconv $component = "trans"; } else { $component = "main"; } $lines="Source: \"$path\\$fn\"; DestDir: \"{app}$dir\"; Flags: ignoreversion; Components: $component"; $lines="$lines; AfterInstall: EditOptions()" if $_ eq "etc\\Rprofile.site" || $_ eq "etc\\Rconsole"; $lines="$lines\n"; print insfile $lines; } }