; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! ;developed by the Galileo University (www.galileo.edu) by Byron Haroldo Linares Roman bhlr@galileo.edu #define MyAppName "OpenACS" #define MyAppVerName "OpenACSInstaller 1.0.1" #define MyAppPublisher "OpenACS." #define MyAppURL "http://localhost" #define MyAppUrlName "openacs.url" [Setup] AppName={#MyAppName} AppVerName={#MyAppVerName} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} DefaultDirName=C:\{#MyAppName} DefaultGroupName={#MyAppName} AllowNoIcons=yes LicenseFile=license_en.txt InfoBeforeFile=important.txt InfoAfterFile=nota.txt OutputDir=comp OutputBaseFilename=setup SetupIconFile=oacs.ico Compression=lzma SolidCompression=yes WizardImageFile=logos.bmp WizardSmallImageFile=oacs.bmp [Languages] Name: "eng"; MessagesFile: "compiler:Default.isl" [Components] Name: "dotLRN"; Description: "dotLRN-Manual"; Types: full; Flags: exclusive; Name: "openACS"; Description: "OpenACS-Manual"; Types: custom; Flags: exclusive; Name: "dotLRNA"; Description: "dotLRN(Automatico)"; Types: full; Flags: exclusive; Name: "openACSA"; Description: "OpenACS(Auntomatico)"; Types: custom; Flags: exclusive; Name: "Opencc"; Description: "OpenACS-core"; Types: full compact custom; Flags: fixed; Name: "cyg"; Description: "Cygwin"; Types: full compact custom; Flags: fixed; Name: "aol"; Description: "AOlserver"; Types: full compact custom; Flags: fixed; Name: "codigo"; Description: "source code"; Types: full; [Files] Source: "oacs-dotlrn\*"; DestDir: "{app}\oacs-dotlrn\"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Opencc; Source: "cygwin.zip"; DestDir: "{tmp}"; Flags: ignoreversion; Components: cyg; Source: "AOLserver_4-0-beta-10_2003-08-04.zip"; DestDir: "{tmp}"; Flags: ignoreversion; Components: aol; Source: "tools\process.exe"; DestDir: "{tmp}" Source: "tools\reg.exe"; DestDir: "{tmp}" Source: "tools\reg.exe"; DestDir: "{app}\Oacs\bin" Source: "tools\setx.exe"; DestDir: "{tmp}" Source: "tools\unzip.exe"; DestDir: "{tmp}" Source: "start.bat"; DestDir: "{app}" Source: "stop.bat"; DestDir: "{app}" Source: "tcl\binstallw.tcl"; DestDir: "{app}\nsd4";AfterInstall: Patchinstaltcl('nsd4\binstallw.tcl'); Source: "cygwin.bat"; DestDir: "{app}\Cygwin";AfterInstall: PatchCygwin('Cygwin\cygwin.bat'); Source: "tcl\windows-procs.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-tcl\tcl" Source: "tcl\apm-file-procs.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-tcl\tcl" Source: "install.xml"; DestDir: "{app}\oacs-dotlrn"; DestName: "install.xml"; Components: dotLRN; Source: "install.xml"; DestDir: "{app}\oacs-dotlrn"; DestName: "install.xml"; Components: dotLRNA; Source: "install.xml"; DestDir: "{app}\oacs-dotlrn"; DestName: "no-install.xml"; Components: openACS; Source: "tcl\index.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer\installer"; DestName: "index.tcl"; AfterInstall: Patchindex('\oacs-dotlrn\packages\acs-bootstrap-installer\installer\index.tcl'); Components: dotLRNA; Source: "tcl\index-org.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer\installer"; DestName: "index.tcl"; Components: dotLRN; Source: "tcl\installer.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer"; DestName: "installer.tcl"; Components: dotLRNA; Source: "tcl\installer-org.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer"; DestName: "installer.tcl"; Components: dotLRN; Source: "tcl\index.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer\installer"; DestName: "index.tcl"; AfterInstall: Patchindex('\oacs-dotlrn\packages\acs-bootstrap-installer\installer\index.tcl'); Components: OpenACSA; Source: "tcl\index-org.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer\installer"; DestName: "index.tcl"; Components: OpenACS; Source: "tcl\installer.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer"; DestName: "installer.tcl"; Components: OpenACSA; Source: "tcl\installer-org.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer"; DestName: "installer.tcl"; Components: OpenACS; Source: "tcl\windows-procs.tcl"; DestDir: "{app}\tcl"; Components: codigo; Source: "tcl\apm-file-procs.tcl"; DestDir: "{app}\tcl"; Components: codigo; Source: "tcl\index.tcl"; DestDir: "{app}\tcl"; Components: codigo; Source: "tcl\index-org.tcl"; DestDir: "{app}\tcl"; Components: codigo; Source: "tcl\installer.tcl"; DestDir: "{app}\tcl"; Components: codigo; Source: "tcl\installer-org.tcl"; DestDir: "{app}\tcl"; Components: codigo; Source: "oacs.ico"; DestDir: "(app)"; Components: codigo; Source: "oacs.bmp"; DestDir: "(app)"; Components: codigo; Source: "logos.bmp"; DestDir: "(app)"; Components: codigo; Source: "installer.iss"; DestDir: "{app}"; Components: codigo; [INI] Filename: "{app}\{#MyAppUrlName}"; Section: "InternetShortcut"; Key: "URL"; String: "{#MyAppURL}" [Dirs] Name: "/tmp" Name: "{app}\Cygwin" Name: "{app}\ZIP" Name: "{app}\nsd4" Name: "(app)\tcl" [Icons] Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{app}\{#MyAppUrlName}" Name: "{group}\Start Server"; Filename: "{app}\start.bat" Name: "{group}\Stop Server"; Filename: "{app}\stop.bat" Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" [Registry] Root: HKLM; Subkey: "Software\Cygnus Solutions"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2"; ValueType: string; ValueName: "cygdrive prefix"; ValueData: "/cygdrive" Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2"; ValueType: dword; ValueName: "cygdrive flags"; ValueData: "$22" Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/"; ValueType: string; ValueName: "native"; ValueData: "{code:UnixDir}/cygwin" Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/"; ValueType: dword; ValueName: "flags"; ValueData: "$a" Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/bin"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/bin"; ValueType: string; ValueName: "native"; ValueData: "{code:UnixDir}/cygwin/bin" Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/bin"; ValueType: dword; ValueName: "flags"; ValueData: "$a" Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/lib"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/lib"; ValueType: string; ValueName: "native"; ValueData: "{code:UnixDir}/cygwin/lib" Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/lib"; ValueType: dword; ValueName: "flags"; ValueData: "$a" Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\Program Options"; Flags: uninsdeletekeyifempty [Run] ; Extract the installed ZIP files. Unzip ignores the ones that doesn't exist Filename: "{tmp}\unzip.exe"; StatusMsg: "Extracting CygWin (1-2 min)..."; Parameters: "-o {tmp}\cygwin.zip -d ""{app}"" "; Flags: runhidden ; Setting global environment variables ;laurel Filename: "{tmp}\setx.exe"; StatusMsg: "Setting ENV Path..."; Parameters: "Path ""{code:Path};{app}\cygwin\bin;{app}\cygwin\sbin;{app}\cygwin\usr\bin;{app}\cygwin\usr\sbin"" -m"; Flags: runhidden Filename: "{tmp}\setx.exe"; StatusMsg: "Setting ENV Cygwin..."; Parameters: "CYGWIN server -m"; Flags: runhidden Filename: "{tmp}\setx.exe"; StatusMsg: "Setting ENV Home..."; Parameters: "HOME ""{userappdata}"" -m"; Flags: runhidden Filename: "{tmp}\setx.exe"; StatusMsg: "Setting ENV TmpDir..."; Parameters: "TMPDIR ""{code:EnvTmp}"" -m"; Flags: runhidden ; Setup CygWin. ; Filename: "{app}\cygwin\bin\chmod"; StatusMsg: "Setting Permissions..."; Parameters: "a+rx /bin -R"; Flags: runhidden Filename: "{app}\cygwin\bin\bash"; StatusMsg: "Generating CygWin /etc/passwd..."; Parameters: " -c ""/bin/mkpasswd -l > /etc/passwd"" "; Flags: runhidden Filename: "{app}\cygwin\bin\bash"; StatusMsg: "Generating CygWin /etc/group..."; Parameters: " -c ""/bin/mkgroup -l > /etc/group"" "; Flags: runhidden Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Installing CygServer Service..."; Parameters: " -I cygserver -d ""by-CygServer"" -p /usr/sbin/cygserver"; Flags: runhidden Filename: "{tmp}\reg.exe"; StatusMsg: "Setting CygServer Display Name..."; Parameters: "add HKLM\SYSTEM\CurrentControlSet\Services\cygserver /v DisplayName /t REG_SZ /d ""by-CygServer"" /f"; Flags: runhidden Filename: "{sys}\net.exe"; StatusMsg: "Launching CygServer Service..."; Parameters: "start cygserver"; Flags: runhidden ; Init the postgreSQL database Filename: "{app}\cygwin\bin\bash"; StatusMsg: "Initializing PostgreSQL Database (1 min)..."; Parameters: " -c ""CYGWIN=server; export CYGWIN; PATH=/bin; export PATH; /bin/initdb -D /var/postgresql/data"" "; Flags: runhidden Filename: "{app}\cygwin\bin\chmod"; StatusMsg: "Setting PostgreSQL Permissions..."; Parameters: "777 /var/postgresql/data -R"; Flags: runhidden ; Starting PostgreSQL service Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Installing PostgreSQL Service..."; Parameters: " -I cygpostgres -d ""PostgreSQL Database"" -p /usr/bin/postmaster -e ""CYGWIN=server"" -a ""-D /var/postgresql/data -i"" -y cygserver -s INT -o"; Flags: runhidden Filename: "{tmp}\reg.exe"; StatusMsg: "Setting CygServer Display Name..."; Parameters: "add HKLM\SYSTEM\CurrentControlSet\Services\cygpostgres /v DisplayName /t REG_SZ /d ""PostgreSQL Database"" /f"; Flags: runhidden Filename: "{sys}\net.exe"; StatusMsg: "Launching PostgreSQL Service (1 min)..."; Parameters: "start cygpostgres"; Flags: runhidden ; database Filename: "{app}\cygwin\bin\psql"; StatusMsg: "Creating PostgreSQL User..."; Parameters: " -c ""CREATE USER oacss CREATEUSER CREATEDB password 'oacss';"" template1"; Flags: runhidden Filename: "{app}\cygwin\bin\psql"; StatusMsg: "Creating PostgreSQL Database..."; Parameters: " -c ""CREATE DATABASE oacs ENCODING='UNICODE' OWNER oacss;"" template1"; Flags: runhidden Filename: "{app}\cygwin\bin\createlang"; StatusMsg: "Creating PostgreSQL Language..."; Parameters: " -h localhost -U oacss plpgsql oacs"; Flags: runhidden ;aolserver Filename: "{tmp}\unzip.exe"; StatusMsg: "AOLserver_4-0-beta-10 (1-2 min)..."; Parameters: "-o {tmp}\AOLserver_4-0-beta-10_2003-08-04.zip -d ""{app}\nsd4"" "; Flags: runhidden ; Setup AOLServer Filename: "{app}\nsd4\bin\nsd.exe"; StatusMsg: "Installing AOLServer Service..."; Parameters: " -I -t ""..\binstallw.tcl"" "; Flags: runhidden Filename: "{app}\cygwin\bin\chmod"; StatusMsg: "Setting AOLServer Permissions..."; Parameters: " -R a+rw ""{code:UnixDir}/nsd4"; Flags: runhidden Filename: "{tmp}\reg.exe"; StatusMsg: "Adding AOLServer Dependency..."; Parameters: "add HKLM\SYSTEM\CurrentControlSet\Services\AOLserver-oacs-dotlrn /v DependOnService /t REG_MULTI_SZ /d cygpostgres /f"; Flags: runhidden Filename: "{tmp}\reg.exe"; StatusMsg: "Setting AOLServer Display Name..."; Parameters: "add HKLM\SYSTEM\CurrentControlSet\Services\AOLserver-oacs-dotlrn /v DisplayName /t REG_SZ /d ""by-AOLServer-by"" /f"; Flags: runhidden Filename: "{sys}\net.exe"; StatusMsg: "Launching AOLServer Service (1-3 min)..."; Parameters: "start AOLserver-oacs-dotlrn"; Flags: runhidden filename: "{app}\openacs.url"; StatusMsg: "installer"; Flags: shellexec [UninstallRun] Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Stopping Service AOLServer..."; Parameters: " -E AOLServer-oacs-dotlrn" Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Removing Service AOLServer..."; Parameters: " -R AOLServer-oacs-dotlrn" Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Stopping Service PostgreSQL..."; Parameters: " -E cygpostgres" Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Removing Service PostgreSQL..."; Parameters: " -R cygpostgres" Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Stopping Service CygServer..."; Parameters: " -E cygserver" Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Removing Service CygServer..."; Parameters: " -R cygserver" ;net Filename: "{sys}\net"; StatusMsg: "Stopping Service AOLServer via net..."; Parameters: " stop AOLServer-oacs-dotlrn" Filename: "{sys}\net"; StatusMsg: "Stopping Service PostgreSQL via net..."; Parameters: " stop cygpostgres" Filename: "{sys}\net"; StatusMsg: "Stopping Service CygServer via net..."; Parameters: " stop cygserver" Filename: "{app}\Oacs\bin\reg.exe"; StatusMsg: "Deleting Registry Settings..."; Parameters: "DELETE ""HKCU\Software\Cygnus Solutions"" /f" Filename: "{app}\Oacs\bin\reg.exe"; StatusMsg: "Deleting Registry Settings..."; Parameters: "DELETE ""HKLM\Software\Cygnus Solutions"" /f" Filename: "{tmp}\chown"; Parameters: "-v -R Administrators {app}\cygwin\"; StatusMsg: "Setting Owner to Administrators..." Filename: "{tmp}\subinacl.exe"; Parameters: "/subdirectories {app}\cygwin\* /grant=Everyone=F"; StatusMsg: "Setting Permissions for Everyone..." ; Delete the entire directory Filename: "{sys}\cmd"; Parameters: "/C ""rmdir /S /Q '{app}' """; StatusMsg: "Deleting (App) directory..." Filename: "{sys}\cmd"; Parameters: "/C ""rmdir /S /Q '{group}' """; StatusMsg: "Deleting (Group)..." [UninstallDelete] Type: files; Name: "{app}\{#MyAppUrlName}" Type: filesandordirs; Name: "{app}" Type: filesandordirs; Name: "{group}" [Code] var UserPage: TInputQueryWizardPage; UserPage2: TInputQueryWizardPage; Values: TArrayOfString; Name: string; Usname:string; Last_NAME:string; Email:string; System_name:string; pass:string; confpass: string; function Path(Default: String): String; begin Result := GetEnv('Path'); end; function UnixDir(Default: String): String; var i: Integer; dir: String; begin dir := ExpandConstant('{app}'); for i := 1 to length(dir)do begin if (StrGet(dir, i) = '\') then begin StrSet('/', i, dir); end; end; Result := dir; end; function EnvTmp(Default: String): String; begin Result := GetEnv('Tmp'); end; procedure msg(linea, def: string); begin MsgBox('parametro faltante'+linea+'se pondra'+def, mbInformation, MB_OK); end; procedure parametros(); begin Name:= UserPage2.Values[0]; Last_NAME:= UserPage2.Values[1]; Email:= UserPage2.Values[2]; System_name:= UserPage2.Values[3]; Usname:= Email; pass:= UserPage.Values[0]; confpass:= UserPage.Values[1]; if (CompareStr(pass,confpass)<>0) then begin MsgBox('Las contraseņas no coinsiden se pondra oacs como contraseņa temporal', mbInformation, MB_OK); pass:='oacs'; confpass:='oacs'; end if ((Name='')) then begin msg('Name','oacs'); Name:='oacs'; end if ((Last_NAME='')) then begin msg('Lasr Name','oacs'); Last_NAME:='oacs'; end if ((Email='')) then begin msg('Email','oacs@temp.com'); Last_NAME:='oacs@temp.com'; end if ((System_name='')) then begin msg('System name','oacs'); Last_NAME:='oacs'; end end; function ReplaceLine(var strLine: TArrayOfString; strFind, strReplace: String): boolean ; var i, p: longint; commentSize: longint; arraySize: longint; fileChanged: boolean; strTemp: string; begin arraySize := GetArrayLength(strLine)-1; for i := 0 to arraySize do begin p := Pos(strFind,strLine[i]); if p > 0 then begin strTemp := copy(strLine[i], 1, p-1) + strReplace + copy(strLine[i], p+length(strFind), 99999); strLine[i] := strTemp; end end; end; procedure Patchindex(FileName: String); var Patch: String; strLine: TArrayOfString; que:boolean; que2:boolean; dir:String; dir2:String; begin parametros(); dir := ExpandConstant('{app}'); dir2:=dir+'\'+FileName; LoadStringsFromFile(dir2,strLine); ReplaceLine(strLine,'|email|',Email); ReplaceLine(strLine,'|name|',Name); ReplaceLine(strLine,'|usname|',Usname); ReplaceLine(strLine,'|LsName|',Last_NAME); ReplaceLine(strLine,'|pass|',pass); ReplaceLine(strLine,'|Cpass|',confpass); ReplaceLine(strLine,'|Sname|',confpass); SaveStringsToFile(dir2, strLine, false); end; procedure Patchinstaltcl(FileName: String); var Patch: String; strLine: TArrayOfString; dir:String; dir2:String; dir3:String; drive,drive2,dir4:string; i: Integer; p: Integer; begin dir := ExpandConstant('{app}'); dir3:=dir; dir2:=dir+'\'+FileName; LoadStringsFromFile(dir2, strLine); ReplaceLine(strLine, '|instdir|', UnixDir('')); for i := 0 to length(dir) do begin p := Pos('\',dir3); if p > 0 then begin dir4 := copy(dir3, 1, p) + '\' + copy(dir3, p+1, length(dir)); p:=-1; end end; drive := copy(Dir4, 1, 1); drive:=LowerCase(drive); drive2 := drive + copy(dir4, 2, length(dir4)); ReplaceLine(strLine, '|instdir1|', drive2); SaveStringsToFile(dir2, strLine, false); end; procedure PatchCygwin(FileName: String); var strLine: TArrayOfString; dir,InstallDir, InstallDrive: String; begin InstallDir := ExpandConstant('{app}'); dir:= InstallDir +'\'+ FileName; InstallDrive := copy(InstallDir, 1, 1); LoadStringsFromFile(dir, strLine); ReplaceLine(strLine, '|dir|', InstallDir); ReplaceLine(strLine, '|driv|', InstallDrive); SaveStringsToFile(dir, strLine, false); end; procedure InitializeWizard(); begin UserPage := CreateInputQueryPage(wpUserInfo, 'Personal Information', 'Continuacion', 'Please specify your password and password confirmation, then click Next.'); UserPage.Add('Password', True); UserPage.Add('confirmar Password:', True); UserPage2 := CreateInputQueryPage(wpUserInfo, 'Personal Information', 'Who are you?', 'Please specify your name and email, then click Next.'); UserPage2.Add('Name:', False); UserPage2.Add('Last Name:', False); UserPage2.Add('Email:', False); UserPage2.Add('System Name:', False); end;