Rev 28254 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
#-*- perl -*-# Copyright (C) 2001-3 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 via WWW at# http://www.gnu.org/copyleft/gpl.html. You can also obtain it by# writing to the Free Software Foundation, Inc., 59 Temple Place,# Suite 330, Boston, MA 02111-1307 USA.# Send any bug reports to r-bugs@r-project.orguse Cwd;use File::Find;my $fn, $component, $mini, $path;my $startdir=cwd();my $RVER;my $RW=$ARGV[0];my $iconpars="WorkingDir: \"{app}\"" ;## add to the target command line as in the next example# my $iconpars="Parameters: \"--sdi\"; WorkingDir: \"{app}\"" ;open ver, "< ../../../VERSION";$RVER = <ver>;close ver;$RVER =~ s/\n.*$//;$RVER =~ s/Under .*$/Pre-release/;open insfile, "> R.iss" || die "Cannot open R.iss\n";open minifile,"> Rsmall.iss" || die "Cannot open Rsmall.iss\n";print minifile <<END;[Setup]OutputBaseFilename=miniRDiskSpanning=yesENDprint insfile <<END;[Setup]OutputBaseFilename=${RW}ENDmy $lines=<<END;AppName=R for WindowsAppVerName=R for Windows $RVERAppPublisher=R Development Core TeamAppPublisherURL=http://www.r-project.orgAppSupportURL=http://www.r-project.orgAppUpdatesURL=http://www.r-project.orgAppVersion=${RVER}DefaultDirName={pf}\\R\\${RW}DefaultGroupName=RAllowNoIcons=yesLicenseFile=${RW}\\COPYINGDisableReadyPage=yesDisableStartupPrompt=yesOutputDir=.WizardSmallImageFile=R.bmpUsePreviousAppDir=noChangesAssociations=yesCompression=lzmaENDmy $lines2=<<END;[Tasks]Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; MinVersion: 4,4Name: "associate"; Description: "&Associate R with .RData files"; GroupDescription: "Registry entries:"; MinVersion: 4,4Name: "DCOM"; Description: "&Register R path for use by the (D)COM server"; GroupDescription: "Registry entries:"; MinVersion: 4,4[Icons]Name: "{group}\\R $RVER"; Filename: "{app}\\bin\\Rgui.exe"; $iconparsName: "{group}\\Uninstall R $RVER"; Filename: "{uninstallexe}"Name: "{userdesktop}\\R $RVER"; Filename: "{app}\\bin\\Rgui.exe"; MinVersion: 4,4; Tasks: desktopicon; $iconpars[Registry]Root: HKLM; Subkey: "Software\\R-core"; Flags: uninsdeletekeyifempty; Tasks: DCOMRoot: HKLM; Subkey: "Software\\R-core\\R"; Flags: uninsdeletekey; Tasks: DCOMRoot: HKLM; Subkey: "Software\\R-core\\R"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"; Tasks: DCOMRoot: HKLM; Subkey: "Software\\R-core\\R"; ValueType: string; ValueName: "Current Version"; ValueData: "${RVER}"; Tasks: DCOMRoot: HKCR; Subkey: ".RData"; ValueType: string; ValueName: ""; ValueData: "RWorkspace"; Flags: uninsdeletevalue; Tasks: associateRoot: HKCR; Subkey: "RWorkspace"; ValueType: string; ValueName: ""; ValueData: "R Workspace"; Flags: uninsdeletekey; Tasks: associateRoot: HKCR; Subkey: "RWorkspace\\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\\bin\\RGui.exe,0"; Tasks: associateRoot: HKCR; Subkey: "RWorkspace\\shell\\open\\command"; ValueType: string; ValueName: ""; ValueData: """{app}\\bin\\RGui.exe"" ""%1"""; Tasks: associateENDprint insfile $lines;print insfile "SolidCompression=yes\n";print insfile $lines2;print insfile <<END;[Icons]Name: "{group}\\R $RVER Help"; Filename: "{app}\\doc\\html\\Rwin.html"; Components: html[Types]Name: "user"; Description: "User installation"Name: "compact"; Description: "Minimal user installation"Name: "full"; Description: "Full installation"Name: "custom"; Description: "Custom installation"; Flags: iscustom[Components]Name: "main"; Description: "Main Files"; Types: user compact full custom; Flags: fixedName: "chtml"; Description: "Compiled HTML Help Files"; Types: user full customName: "html"; Description: "HTML Help Files"; Types: user full customName: "latex"; Description: "Latex Help Files"; Types: full customName: "manuals"; Description: "On-line (PDF) Manuals"; Types: user full customName: "refman"; Description: "Reference Manual"; Types: full customName: "devel"; Description: "Source Package Installation Files"; Types: user full customName: "tcl"; Description: "Support Files for library(tcltk)"; Types: user full custom[Files]ENDprint minifile $lines;print minifile $lines2;print minifile <<END;[Types]Name: "compact"; Description: "Minimal user installation"Name: "custom"; Description: "Custom installation"; Flags: iscustom[Components]Name: "main"; Description: "Main Files"; Types: compact custom; Flags: fixedName: "chtml"; Description: "Compiled HTML Help Files"; Types: customName: "manuals"; Description: "On-line (PDF) Manuals"; Types: custom[Files]ENDmy %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);$path="${RW}";chdir($path);find(\&listFiles, ".");close insfile;close minifile;sub listFiles {$fn = $File::Find::name;$fn =~ s+^./++;my $mini = 1;if (!(-d $_)) {$fn =~ s+/+\\+g;$dir = $fn;$dir =~ s/[^\\]+$//;$dir = "\\".$dir;$dir =~ s/\\$//;$_ = $fn;if (m/^library\\tcltk/) {$mini = 0;}if ($_ eq "bin\\Rchtml.dll"|| m/^library\\[^\\]*\\chtml/) {$component = "chtml";} elsif ($_ eq "doc\\html\\logo.jpg") {$component = "html devel";$mini = 0;} elsif ($_ eq "doc\\html\\faq.html"|| $_ eq "doc\\html\\rw-FAQ.html"|| $_ eq "share\\texmf\\Sweave.sty") {$component = "main";} elsif (m/^doc\\html/|| m/^doc\\manual\\[^\\]*\.html/|| m/^library\\[^\\]*\\html/|| $_ eq "library\\R.css") {$component = "html";$mini = 0;} elsif ($_ eq "doc\\manual\\refman.pdf") {$component = "refman";$mini = 0;} elsif (m/^doc\\manual/ && $_ ne "doc\\manual\\R-FAQ.pdf") {$component = "manuals";if (m/R-admin.pdf/ || m/R-exts.pdf/ || m/R-lang.pdf/) {$mini = 0;}} elsif (m/^library\\[^\\]*\\latex/) {$component = "latex";$mini = 0;} elsif (m/^Tcl/) {$component = "tcl";$mini = 0;} elsif (exists($develfiles{$_})|| m/^doc\\KEYWORDS/|| m/^src\\gnuwin32/|| m/^src\\include/|| m/^src\\library\\windlgs/|| m/^share\\make/|| m/^share\\perl/|| m/^share\\R/|| m/^share\\texmf/|| m/^lib\\/) {$component = "devel";$mini = 0;} else {$component = "main";if ( m/^library\\[^\\]*\\man/|| m/^library\\grid\\doc/|| $_ eq "library\\survival\\survival.ps.gz") {$mini = 0;}}$lines="Source: \"$path\\$fn\"; DestDir: \"{app}$dir\"; Flags: ignoreversion; Components: $component\n";print insfile $lines;if ($mini) {print minifile $lines;}}}