1 #!/usr/bin/perl -w # please develop with -w
6 use strict; # please develop with the strict pragma
10 Install::setlanguage 'en';
12 my $domainname = `hostname`; # Note: must not have any arguments (portability)
13 $domainname = $domainname =~ /^[^\.]+\.(.*)$/? $1: undef;
14 Install::setdomainname $domainname;
17 Install::setetcdir $etcdir;
20 print "You must be root to run this script.\n";
25 unless (-d 'intranet-html') {
27 You seem to be installing from CVS. Please run the "buildrelease" script
28 and install from the resulting release tarball.
33 my $kohaversion=`cat koha.version`;
35 Install::setkohaversion $kohaversion;
38 if ($kohaversion =~ /RC/) {
39 releasecandidatewarning();
42 checkabortedinstall();
44 if (-e "$etcdir/koha.conf") {
45 my $installedversion=`grep kohaversion= $etcdir/koha.conf`;
46 chomp $installedversion;
47 $installedversion=~m/kohaversion=(.*)/;
49 my $installedversionmsg;
50 if ($installedversion) {
51 $installedversionmsg=getmessage('KohaVersionInstalled', [$installedversion]);
53 $installedversionmsg=getmessage('KohaUnknownVersionInstalled');
56 my $message=getmessage('KohaAlreadyInstalled', [$etcdir, $kohaversion, $installedversionmsg]);
57 showmessage($message, 'none');
61 my $continuingmsg=getmessage('continuing');
63 my $message=getmessage('WelcomeToKohaInstaller');
64 my $answer=showmessage($message, 'yn');
66 if ($answer eq "Y" || $answer eq "y") {
70 This installer currently does not support a completely automated
73 Please be sure to read the documentation, or visit the Koha website
74 at http://www.koha.org for more information.
79 # Check for missing Perl Modules
82 # Ask for installation directories
85 getinstallationdirectories();
93 basicauthentication();
108 # Installation is complete. Rename the koha.conf.tmp file
110 rename "$etcdir/koha.conf.tmp", "$etcdir/koha.conf" || warn "Couldn't rename file at $etcdir. Must have write capability.\n";
113 showmessage(getmessage('AuthenticationWarning', [$etcdir]), 'PressEnter');
116 showmessage(getmessage('Completed', [ Install::getservername(), Install::getintranetport(), Install::getservername(), Install::getopacport()]), 'PressEnter');
121 if (-f "kohareporter") {
122 my $reply=showmessage('Would you like to complete a survey about your library?', 'yn', 'y');
124 system("perl kohareporter");