1 #!/usr/bin/perl -w # please develop with -w
6 use strict; # please develop with the strict pragma
12 print "You must be root to run this script.\n";
17 unless (-d 'intranet-html') {
19 You seem to be installing from CVS. Please run the "buildrelease" script
20 and install from the resulting release tarball.
25 $::kohaversion=`cat koha.version`;
29 if ($::kohaversion =~ /RC/) {
30 releasecandidatewarning();
33 if (-e "/etc/koha.conf") {
34 $::installedversion=`grep kohaversion= /etc/koha.conf`;
35 chomp $::installedversion;
36 $::installedversion=~m/kohaversion=(.*)/;
37 $::installedversion=$1;
38 my $installedversionmsg;
39 if ($::installedversion) {
40 $installedversionmsg=getmessage('KohaVersionInstalled', [$::installedversion]);
42 $installedversionmsg=getmessage('KohaUnknownVersionInstalled');
45 my $message=getmessage('KohaAlreadyInstalled', [$::kohaversion, $installedversionmsg]);
46 showmessage($message, 'none');
50 my $continuingmsg=getmessage('continuing');
52 my $message=getmessage('WelcomeToKohaInstaller');
53 my $answer=showmessage($message, 'yn');
55 if ($answer eq "Y" || $answer eq "y") {
59 This installer currently does not support a completely automated
62 Please be sure to read the documentation, or visit the Koha website
63 at http://www.koha.org for more information.
69 $::domainname = `hostname -d`;
74 # Check for missing Perl Modules
77 # Ask for installation directories
80 getinstallationdirectories();
88 basicauthentication();
97 # Installation is complete. Rename the koha.conf.tmp file
99 rename "$::etcdir/koha.conf.tmp", "$::etcdir/koha.conf" || warn "Couldn't rename file at $::etcdir. Must have write capability.\n";
106 showmessage(getmessage('AuthenticationWarning'), 'PressEnter');
109 showmessage(getmessage('Completed', [ $::servername, $::intranetport, $::servername, $::opacport]), 'PressEnter');
114 my $reply=showmessage('Would you like to complete a survey about your library?', 'yn', 'y');
116 system("perl kohareporter");