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