///////////////////////////////////////////////////////////////////////////////
// EVENT: Installed event is sent just after files for the feature:
// Common are transferred.
///////////////////////////////////////////////////////////////////////////////
export prototype Common_Installed();
function Common_Installed()
STRING cmd, cmdline, dbfile;
begin
// use setpw to set the admin password
// in the users.db database
dbfile = INSTALLDIR ^ "etc" ^ "users.db";
cmd = "\"" + SRCDIR ^ "Windows" ^ "bin" ^ "windows" ^ "setpw.exe\"";
cmdline = " -u admin -p " + svAdminPassword + " -o \"" + dbfile + "\"";
if (LaunchApp(cmd, cmdline) != 0) then
MessageBox(@TEXT_SETPW_FAIL, WARNING);
endif;
// if installing on NT/2000 we need to set permissions
// in a few places
SetPermissions();
end;
///////////////////////////////////////////////////////////////////////////////
// EVENT: Installed event is sent just after files for the
// WebLibrary or SourceCode features are transferred.
///////////////////////////////////////////////////////////////////////////////
export prototype WebLibrary_Installed();
function WebLibrary_Installed()
STRING svReturnLine, szInsertLine, szFileName, svGSDLHOME;
NUMBER nResult, nvLineNumber;
STRING szTitle, szMsg, svTmp;
STRING szServerTxt, svCgiBin;
LIST listInfo;
begin
svGSDLHOME = INSTALLDIR;
// edit the gsdlsite.cfg file
VarSave(SRCTARGETDIR);
StrRemoveLastSlash(svGSDLHOME);
SRCDIR = INSTALLDIR ^ "cgi-bin";
szFileName = INSTALLDIR ^ "cgi-bin" ^ "gsdlsite.cfg";
// if filegrep fails it's probably because gsdlsite.cfg has already
// been edited by a previous call to WebLibrary_Installed (this will
// happen if both the SourceCode and WebLibrary features are being
// installed)
nResult = FileGrep(szFileName, "**GSDLHOME**", svReturnLine, nvLineNumber, RESTART);
if (nResult = 0) then
szInsertLine = "gsdlhome \"" + svGSDLHOME + "\"";
FileInsertLine("gsdlsite.cfg", szInsertLine, nvLineNumber, REPLACE);
nResult = FileGrep(szFileName, "#httpprefix", svReturnLine, nvLineNumber, RESTART);
if (nResult = 0) then
szInsertLine = "httpprefix /gsdl";
FileInsertLine("gsdlsite.cfg", szInsertLine, nvLineNumber, REPLACE);
else
MessageBox(@TEXT_FILEGREP_FAILED, WARNING);
endif;
nResult = FileGrep(szFileName, "httpimg /images", svReturnLine,
nvLineNumber, RESTART);
if (nResult = 0) then
szInsertLine = "httpimg /gsdl/images";
FileInsertLine("gsdlsite.cfg", szInsertLine, nvLineNumber, REPLACE);
else
MessageBox(@TEXT_FILEGREP_FAILED, WARNING);
endif;
endif;
VarRestore(SRCTARGETDIR);
// Create and display the SERVER.TXT file (will already exist if
// this is the second call to this function)
if (!Is(FILE_EXISTS, INSTALLDIR ^ "SERVER.TXT")) then
szServerTxt = INSTALLDIR ^ "SERVER.TXT";
svCgiBin = INSTALLDIR ^ "cgi-bin";
szTitle = "";
szMsg = " ";
listInfo = ListCreate(STRINGLIST);
ListAddString(listInfo, @TEXT_SERVERTXT_01, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_02, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_03, AFTER);
ListAddString(listInfo, " ", AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_04, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_05, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_06, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_07, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_08, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_09, AFTER);
ListAddString(listInfo, " ", AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_10, AFTER);
Sprintf(svTmp, @TEXT_SERVERTXT_11, szServerTxt);
ListAddString(listInfo, svTmp, AFTER);
ListAddString(listInfo, " ", AFTER);
Sprintf(svTmp, @TEXT_SERVERTXT_12, TARGETDIR);
ListAddString(listInfo, svTmp, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_13, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_14, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_15, AFTER);
Sprintf(svTmp, @TEXT_SERVERTXT_16, svCgiBin);
ListAddString(listInfo, svTmp, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_17, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_18, AFTER);
ListAddString(listInfo, " ", AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_19, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_20, AFTER);
ListAddString(listInfo, " ", AFTER);
rs(svCgiBin);
rs(svGSDLHOME);
ListAddString(listInfo, " ScriptAlias /gsdl/cgi-bin \"" + svCgiBin + "/\"", AFTER);
ListAddString(listInfo, " ", AFTER);
ListAddString(listInfo, " Options None", AFTER);
ListAddString(listInfo, " AllowOverride None", AFTER);
ListAddString(listInfo, " ", AFTER);
ListAddString(listInfo, " ", AFTER);
ListAddString(listInfo, " Alias /gsdl \"" + svGSDLHOME + "/\"", AFTER);
ListAddString(listInfo, " ", AFTER);
ListAddString(listInfo, " Options Indexes MultiViews FollowSymLinks", AFTER);
ListAddString(listInfo, " AllowOverride None", AFTER);
ListAddString(listInfo, " Order allow,deny", AFTER);
ListAddString(listInfo, " Allow from all", AFTER);
ListAddString(listInfo, " ", AFTER);
ListAddString(listInfo, " ", AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_21, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_22, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_23, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_24, AFTER);
ListAddString(listInfo, " ", AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_25, AFTER);
ListAddString(listInfo, @TEXT_SERVERTXT_26, AFTER);
ListAddString(listInfo, " ", AFTER);
ListWriteToFile(listInfo, szServerTxt);
SdShowInfoList(szTitle, szMsg, listInfo);
ListDestroy(listInfo);
endif;
end;
///////////////////////////////////////////////////////////////////////////////
// EVENT: Installed event is sent just after files for the feature:
// CollectionBuild are transferred.
///////////////////////////////////////////////////////////////////////////////
export prototype CollectionBuild_Installed();
function CollectionBuild_Installed()
STRING svReturnLine, szInsertLine, szFileName, svGSDLHOME;
NUMBER nResult, nvLineNumber;
begin
// create those empty directories that are required at
// build time
CreateDir(INSTALLDIR ^ "tmp");
CreateDir(INSTALLDIR ^ "collect" ^ "modelcol" ^ "import");
CreateDir(INSTALLDIR ^ "collect" ^ "modelcol" ^ "archives");
CreateDir(INSTALLDIR ^ "collect" ^ "modelcol" ^ "building");
CreateDir(INSTALLDIR ^ "collect" ^ "modelcol" ^ "index");
CreateDir(INSTALLDIR ^ "collect" ^ "modelcol" ^ "images");
CreateDir(INSTALLDIR ^ "collect" ^ "modelcol" ^ "perllib");
// edit the setup.bat file
VarSave(SRCTARGETDIR);
SRCDIR = INSTALLDIR;
svGSDLHOME = INSTALLDIR;
StrRemoveLastSlash(svGSDLHOME);
szFileName = INSTALLDIR ^ "setup.bat";
nResult = FileGrep(szFileName, "**GSDLHOME**", svReturnLine, nvLineNumber, RESTART);
if (nResult = 0) then
szInsertLine = "set GSDLHOME=" + svGSDLHOME;
FileInsertLine("setup.bat", szInsertLine, nvLineNumber, REPLACE);
else
MessageBox(@TEXT_FILEGREP_FAILED, WARNING);
endif;
VarRestore(SRCTARGETDIR);
end;
///////////////////////////////////////////////////////////////////////////////
// EVENT: Uninstalling event is sent just before files for the feature:
// CollectionBuild are removed during uninstallation.
///////////////////////////////////////////////////////////////////////////////
export prototype CollectionBuild_UnInstalling();
function CollectionBuild_UnInstalling()
STRING szDir;
begin
szDir = INSTALLDIR ^ "collect";
DeleteDir(szDir, ALLCONTENTS);
szDir = INSTALLDIR ^ "tmp";
DeleteDir(szDir, ALLCONTENTS);
end;
///////////////////////////////////////////////////////////////////////////////
// EVENT: Uninstalling event is sent just before files for the feature:
// WebLibrary are removed during uninstallation.
///////////////////////////////////////////////////////////////////////////////
export prototype WebLibrary_UnInstalling();
function WebLibrary_UnInstalling()
STRING szFile;
begin
szFile = INSTALLDIR ^ "SERVER.TXT";
DeleteFile(szFile);
end;
///////////////////////////////////////////////////////////////////////////////
// EVENT: Uninstalling event is sent just before files for the feature:
// Common\NotInstalled2\NotInstalled1\dlpeople\Documentation\LocalLibrary are removed during uninstallation.
///////////////////////////////////////////////////////////////////////////////
export prototype LocalLibrary_UnInstalling();
function LocalLibrary_UnInstalling()
STRING szFile;
begin
szFile = INSTALLDIR ^ "gsdlsite.cfg";
DeleteFile(szFile);
end;