5 my $term = new Term::ReadLine "BSE Install";
10 unless ($term->ReadLine eq 'Term::ReadLine') {
11 print "Happily, you may have a decent readline\n";
14 print "Sadly, you only have the basic readline stub installed\n";
21 This script will take you through installation of BSE.
23 If you want to perform an upgrade, change directory to the cgi-bin directory
24 of the existing installation and run this script again.
26 Press Enter to continue (or Ctrl-C to abort).
33 if (-e 'modules/Constants.pm' && -e 'modules/Generate/Article.pm') {
35 An existing installation has been found.
37 Do you want to perform an upgrade?
39 if (askYN($prompt, 1)) {
46 DB => { desc => "Name of mysql database", cat=>'db', },
47 UN => { desc => "Mysql database username", cat=>'db', },
48 PW => { desc => "Mysql database password", cat=>'db', },
49 BASEDIR => { desc=>"Base directory of installation", cat=>'dir',
51 The directory that the other directories are based under. This isn't
52 actually used directly, but can be used to help initialize the other
55 This must be an absolute directory.
57 val => \&is_absdir, def=>},
58 TMPLDIR => { desc=>"Templates directory", cat=>'dir',
59 def=>'$BASEDIR/templates', help=><<EOS,
60 This is where page and email templates are stored.
62 This can be an absolute directory, or use ./foo to make it relative to
65 val => \&is_abs_baserel },
66 CONTENTBASE => { desc=>"Content directory", cat=>'dir',
67 def=>'$BASEDIR/htdocs', help=><<"EOS",
68 The base directory that contains your site content. This must be the top
69 directory of your site.
71 This can be an absolute directory, or use ./foo to make it relative to
74 val=>\&is_abs_baserel },
75 IMAGEDIR => { desc => "Images directory", cat=>'dir',
76 def => '$CONTENTDIR/images', help => <<"EOS",
80 DATADIR => { desc => "Data directory" },
83 my %conf_info = @conf_info;
84 my @conf_order = grep !ref, @conf_info;
89 my ($query, $def) = @_;
92 print $def ? "[Y]" : "[N]",":";
93 my $resp = $term->readline;
94 return $def if $resp =~ /^\s*$/;
95 return 1 if $resp =~ /y/i;
96 return 0 if $resp =~ /n/i;
97 print "Please enter yes or no ";
105 $item->{def} and ($def = $item->{def}) =~ s/\$(\w+)/$config{$1}/g;
107 my $resp = $term->readline($item->{desc}, $def);
108 if ($resp eq 'help' || $resp eq '?') {
109 print $item->{help} || "Sorry, no help for this item\n";
114 $item->{val}->($resp);
126 if ($^O =~ /win32/i) {