#!/usr/bin/perl
# Installer script for AgoraCart Route 66 community version.
#######################################################################
#
# This installer script, AgoraCart and all associated files, except where noted, are
# Copyright 2001 to Present jointly by K-Factor Technologies, Inc.
# and by C E Mayo (aka Mister Ed) at AgoraCart.com & K-Factor.net
# This is NOT FREE AND/OR GPL SOFTWARE!
# This software is a separate script to install an ecommerce shopping cart and
# is the confidential and proprietary information of K-Factor Technologies, Inc. You shall
# not disclose such Confidential Information and shall use it only in
# conjunction with installing the AgoraCart shopping cart.
#
# This file and related 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.
#
# This copyright notice may not be removed or altered in any way.
#
#######################################################################
# FTP/WWW Installation Instructions:
#
# This file is actually a perl program that may be used to install
# AgoraCart on a UNIX or LINUX web hosting server that has FTP access or a File
# Management app inside a web hosting control panel.
#
# This script requires the following Perl modules to be installed:
# LWP::Simple
# CGI
#
# Any remaining Perl modules necessary for AgoraCart to operate will be tested by this script.
#
# This script installs the latest AgoraCart Route 66 Community Version (06.6.x).
#
#
# STEP 1 -- Put the correct path to perl on line 1 of this file, above. Default should be okay on most cPanel based servers.
#
# STEP 2 -- Transfer this file via FTP, in ASCII/text mode, in the directory of your
# hosting account that you wish to install your store.
#
# STEP 3 -- Rename this file to myR66.cgi
#
# STEP 4 -- make this file readable/executeable (chmod 755) via your FTP software or file manager.
#
# STEP 5 -- If you already have a directory named 'ac66_new', please rename it to something else now!
# ac66_new is a temporary directory used to install your new Route 66 storefront.
#
# STEP 6 -- run this script from your web browser via a URL like:
# http://www.yourdomain.com/myR66.cgi
#
# STEP 7 -- Make sure this file is erased from your server immediately.
# This script will attempt to delete itself and the compressed tar archive files it downloads.
#
use CGI qw(:standard);
# cPanel only - loads perl modules local to the users account.
eval('use cPanelUserConfig;');
$| = 1; # Flush
$ENV{"PATH"} = "/bin:/usr/bin";
$my_path = $ENV{'PATH'};
$install_me = "communityRoute66_current.tgz";
$install_me_no_db = "communityRoute66_noDB_current.tgz";
$installer_file_name = "myR66.cgi";
print "Content-type: text/html\n\n";
&print_page_top();
if ( !( -e $installer_file_name ) ) {
print qq~
AgoraCart Route 66 Installer Error
Thank you for using & supporting AgoraCart!
Please rename this file to $installer_file_name and try again!
~;
&print_page_bottom();
exit(0);
}
foreach my $sparam (param()){$form_data{$sparam} = param($sparam);}
if ( $form_data{"install_now"} ) {
&get_extract();
exit(0);
}
print qq~
AgoraCart Route 66 Community Installer
Thank you for using AgoraCart!
Below you will find the information about your Perl version, OS (operating system), and the Perl modules that are required. Most are considered Perl core, and others are found on 95% of Linux based web servers. The only Perl module that is not on most servers is the GD Perl Module for graphics, which is okay as AgoraCart will run without it (only automatic image resizing is affected in a couple of manager screens). You can also ask to see if your hosting company will install any missing Perl modules, such as GD.
If things look okay, enter your Members only credentials below, and press the install button to get started. Once AgoraCart is installed, you will need to go to the store manager to do additional setups, including: the store URL, your emails, and chose a payment gateway. Other settings can be done later.
The Unix whoami command and/or your UID response contains: 'nobody', 'www', 'apache' which might be a problem. If this is something other than your username (typically the ID you use to login with when accessing your hosting account), you should NOT use this install script without additional script wrappers.
If the Linux/Unix whoami command and the User ID responds back with your username, you can go ahead and proceed with the install.
|;
}
$server_name = "$ENV{'SERVER_NAME'}";
( $core_modules, $my_modules ) = q{};
$test_perl_version = sprintf( "%vd", $^V );
$os_version = "$^O";
$perl_test_error_mesage = q{};
$perl_test_status = '';
my ( $major, $majorMin, $minner ) = split( /\./, $test_perl_version );
if ( ( $major < 5 ) || ( ( $major == 5 ) && ( $majorMin < 8 ) ) || ( ( $major == 5 ) && ( $majorMin == 8 ) && ( $minner < 9 ) ) ) {
$perl_test_error_mesage = qq|
WARNING: Your Perl version is VERY old (Released before 2006). The current Perl version on newer servers is 5.12.4 or 5.16.2. The AgoraCart Route 66 community version requires Perl 5.8.8 or higher, but versions 5.10.1/5.12.4 thru 5.20.x are recommended. Please ask your hosting provider if they have an additional Perl version installed that your scripts can use.
|;
$perl_test_status .= ' but very old. See warning message at bottom!';
}
if ( ( $major == 5 ) && ( $majorMin < 12 ) && ( $minner < 9 ) ) {
$perl_test_error_mesage = qq||;
$perl_test_status .= 'but slightly outdated!';
}
print qq~
|;
# required modules. Some we install local to script
foreach $x(qw(
CGI::Simple::Standard
GD
HTTP::BrowserDetect
HTTP::Request
LWP::UserAgent
LWP::Simple
XML::Simple
)) {
eval "use $x";
$my_modules .= qq|$x:|;
if ( $x eq "CGI::Simple::Standard" || $x eq "HTTP::BrowserDetect" || $x eq "XML::Simple" ) {
$my_modules .= "$@" ? ' But we will install a copy for you'."" : '';
}
elsif ($x eq "GD") {
$my_modules .= "$@" ? '-- Store & Manager areas will work ok -- but you cannot use automatic image resizing for product images on product add & edit screens'."" : '';
}
else {
$my_modules .= "$@" ? ''."" : '';
}
$my_modules .= "\n";
}
print $my_modules;
print qq|
\n|;
print qq~
\n
Enter Your Basic Store Setup Info
~;
&print_page_bottom();
exit(0);
#######################################################################
#######################################################################
sub print_page_top {
print <AgoraCart Route 66 Community Version Installer
ENDOFTEXT
}
#######################################################################
sub print_page_bottom {
print <
|;
# Now extract AgoraCart install file
$Archive::Tar::CHMOD = 0; # PRESERVE PERMISSIONS!
my $artar = Archive::Tar->new();
$artar->read( $install_me );
$artar->extract();
my $size = -s $install_me;
if ( $size < 1024000 ) { # at least half of the known file size
$file = ''; # it is not really the file
unlink("$install_me");
unlink("$installer_file_name");
&agc_no_file_open;
}
sleep(1);
print qq|
Thank you for installing AgoraCart. Your AgoraCart Route 66 Community Version shopping cart has been installed, but it will still need some basic configuration before it is fully functional.
Please edit your store settings & configuration using the following link (Please bookmark it!):
using the following default credentials: username: manager password: admin
SETUP NOTES:
1) Make sure to setup the Main/Core Agoracart Settings prior to setting any other settings
2) Set the password settings prior to using the update/upgrade manager.
Initial/Basic Setup Cheat Sheet
Setup your Gold version in the order listed below, using the included online managers found by clicking on "Store Settings" link on the left side menu:
Main/Core AgoraCart Settings (make sure your URLs are correct! save and login again)
Password Settings (change the defaults, save and then login again - NEVER, EVER LEAVE THE DEFAULTS ACTIVE)
Set .htaccess protection (on main link menu, skip if not shown as a link. submit and login at popup login screen - this can be skipped and warnings disabled in the Misc tab of the Main/Core AgoraCart Settings manager)
Under Main/Core AgoraCart Settings configure items under the following tabs and then save:
Email
Checkout
Security
MetaTags
Misc
Upgrade AgoraCart Modules (upgrade any modules that should be upgraded. Skip new modules/features for now)
Shipping Settings and Custom Logic (set up. If not sure, consult user manuals and forums for help)
Tax Settings and Custom Logic (set up. If not sure, consult user manuals and forums for help)
Payment Gateway (set gateways & edit from Payment Gateway Settings manager found in the Store Settings area)
Test store with default products (can delete later)
Setup Templates & Layouts (choose template or copy one and then select it, edit other layout settings)
Enter Products & Services (just a few, to see how it works, delete demo products)
Test store with new products
Finish any remaining store setup and product/service database entry.