| |
|
1 |
; Script generated by the Inno Setup Script Wizard. |
| |
|
2 |
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! |
| |
|
3 |
;developed by the Galileo University (www.galileo.edu) by Byron Haroldo Linares Roman bhlr@galileo.edu |
| |
|
4 |
|
| |
|
5 |
#define MyAppName "OpenACS" |
| |
|
6 |
#define MyAppVerName "OpenACSInstaller 1.0.1" |
| |
|
7 |
#define MyAppPublisher "OpenACS." |
| |
|
8 |
#define MyAppURL "http://localhost" |
| |
|
9 |
#define MyAppUrlName "openacs.url" |
| |
|
10 |
|
| |
|
11 |
[Setup] |
| |
|
12 |
AppName={#MyAppName} |
| |
|
13 |
AppVerName={#MyAppVerName} |
| |
|
14 |
AppPublisher={#MyAppPublisher} |
| |
|
15 |
AppPublisherURL={#MyAppURL} |
| |
|
16 |
AppSupportURL={#MyAppURL} |
| |
|
17 |
AppUpdatesURL={#MyAppURL} |
| |
|
18 |
DefaultDirName=C:\{#MyAppName} |
| |
|
19 |
DefaultGroupName={#MyAppName} |
| |
|
20 |
AllowNoIcons=yes |
| |
|
21 |
LicenseFile=license_en.txt |
| |
|
22 |
InfoBeforeFile=important.txt |
| |
|
23 |
InfoAfterFile=nota.txt |
| |
|
24 |
OutputDir=comp |
| |
|
25 |
OutputBaseFilename=setup |
| |
|
26 |
SetupIconFile=oacs.ico |
| |
|
27 |
Compression=lzma |
| |
|
28 |
SolidCompression=yes |
| |
|
29 |
WizardImageFile=logos.bmp |
| |
|
30 |
WizardSmallImageFile=oacs.bmp |
| |
|
31 |
[Languages] |
| |
|
32 |
Name: "eng"; MessagesFile: "compiler:Default.isl" |
| |
|
33 |
[Components] |
| |
|
34 |
|
| |
|
35 |
Name: "dotLRN"; Description: "dotLRN-Manual"; Types: full; Flags: exclusive; |
| |
|
36 |
Name: "openACS"; Description: "OpenACS-Manual"; Types: custom; Flags: exclusive; |
| |
|
37 |
Name: "dotLRNA"; Description: "dotLRN(Automatico)"; Types: full; Flags: exclusive; |
| |
|
38 |
Name: "openACSA"; Description: "OpenACS(Auntomatico)"; Types: custom; Flags: exclusive; |
| |
|
39 |
|
| |
|
40 |
Name: "Opencc"; Description: "OpenACS-core"; Types: full compact custom; Flags: fixed; |
| |
|
41 |
Name: "cyg"; Description: "Cygwin"; Types: full compact custom; Flags: fixed; |
| |
|
42 |
Name: "aol"; Description: "AOlserver"; Types: full compact custom; Flags: fixed; |
| |
|
43 |
Name: "codigo"; Description: "source code"; Types: full; |
| |
|
44 |
|
| |
|
45 |
[Files] |
| |
|
46 |
Source: "oacs-dotlrn\*"; DestDir: "{app}\oacs-dotlrn\"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: Opencc; |
| |
|
47 |
Source: "cygwin.zip"; DestDir: "{tmp}"; Flags: ignoreversion; Components: cyg; |
| |
|
48 |
Source: "AOLserver_4-0-beta-10_2003-08-04.zip"; DestDir: "{tmp}"; Flags: ignoreversion; Components: aol; |
| |
|
49 |
|
| |
|
50 |
Source: "tools\process.exe"; DestDir: "{tmp}" |
| |
|
51 |
Source: "tools\reg.exe"; DestDir: "{tmp}" |
| |
|
52 |
Source: "tools\reg.exe"; DestDir: "{app}\Oacs\bin" |
| |
|
53 |
Source: "tools\setx.exe"; DestDir: "{tmp}" |
| |
|
54 |
Source: "tools\unzip.exe"; DestDir: "{tmp}" |
| |
|
55 |
Source: "start.bat"; DestDir: "{app}" |
| |
|
56 |
Source: "stop.bat"; DestDir: "{app}" |
| |
|
57 |
|
| |
|
58 |
Source: "tcl\binstallw.tcl"; DestDir: "{app}\nsd4";AfterInstall: Patchinstaltcl('nsd4\binstallw.tcl'); |
| |
|
59 |
Source: "cygwin.bat"; DestDir: "{app}\Cygwin";AfterInstall: PatchCygwin('Cygwin\cygwin.bat'); |
| |
|
60 |
Source: "tcl\windows-procs.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-tcl\tcl" |
| |
|
61 |
Source: "tcl\apm-file-procs.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-tcl\tcl" |
| |
|
62 |
|
| |
|
63 |
Source: "install.xml"; DestDir: "{app}\oacs-dotlrn"; DestName: "install.xml"; Components: dotLRN; |
| |
|
64 |
Source: "install.xml"; DestDir: "{app}\oacs-dotlrn"; DestName: "install.xml"; Components: dotLRNA; |
| |
|
65 |
Source: "install.xml"; DestDir: "{app}\oacs-dotlrn"; DestName: "no-install.xml"; Components: openACS; |
| |
|
66 |
|
| |
|
67 |
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; |
| |
|
68 |
Source: "tcl\index-org.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer\installer"; DestName: "index.tcl"; Components: dotLRN; |
| |
|
69 |
Source: "tcl\installer.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer"; DestName: "installer.tcl"; Components: dotLRNA; |
| |
|
70 |
Source: "tcl\installer-org.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer"; DestName: "installer.tcl"; Components: dotLRN; |
| |
|
71 |
|
| |
|
72 |
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; |
| |
|
73 |
Source: "tcl\index-org.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer\installer"; DestName: "index.tcl"; Components: OpenACS; |
| |
|
74 |
Source: "tcl\installer.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer"; DestName: "installer.tcl"; Components: OpenACSA; |
| |
|
75 |
Source: "tcl\installer-org.tcl"; DestDir: "{app}\oacs-dotlrn\packages\acs-bootstrap-installer"; DestName: "installer.tcl"; Components: OpenACS; |
| |
|
76 |
|
| |
|
77 |
Source: "tcl\windows-procs.tcl"; DestDir: "{app}\tcl"; Components: codigo; |
| |
|
78 |
Source: "tcl\apm-file-procs.tcl"; DestDir: "{app}\tcl"; Components: codigo; |
| |
|
79 |
Source: "tcl\index.tcl"; DestDir: "{app}\tcl"; Components: codigo; |
| |
|
80 |
Source: "tcl\index-org.tcl"; DestDir: "{app}\tcl"; Components: codigo; |
| |
|
81 |
Source: "tcl\installer.tcl"; DestDir: "{app}\tcl"; Components: codigo; |
| |
|
82 |
Source: "tcl\installer-org.tcl"; DestDir: "{app}\tcl"; Components: codigo; |
| |
|
83 |
Source: "oacs.ico"; DestDir: "(app)"; Components: codigo; |
| |
|
84 |
Source: "oacs.bmp"; DestDir: "(app)"; Components: codigo; |
| |
|
85 |
Source: "logos.bmp"; DestDir: "(app)"; Components: codigo; |
| |
|
86 |
|
| |
|
87 |
|
| |
|
88 |
Source: "installer.iss"; DestDir: "{app}"; Components: codigo; |
| |
|
89 |
[INI] |
| |
|
90 |
Filename: "{app}\{#MyAppUrlName}"; Section: "InternetShortcut"; Key: "URL"; String: "{#MyAppURL}" |
| |
|
91 |
|
| |
|
92 |
[Dirs] |
| |
|
93 |
|
| |
|
94 |
Name: "/tmp" |
| |
|
95 |
Name: "{app}\Cygwin" |
| |
|
96 |
Name: "{app}\ZIP" |
| |
|
97 |
Name: "{app}\nsd4" |
| |
|
98 |
Name: "(app)\tcl" |
| |
|
99 |
|
| |
|
100 |
[Icons] |
| |
|
101 |
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{app}\{#MyAppUrlName}" |
| |
|
102 |
Name: "{group}\Start Server"; Filename: "{app}\start.bat" |
| |
|
103 |
Name: "{group}\Stop Server"; Filename: "{app}\stop.bat" |
| |
|
104 |
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" |
| |
|
105 |
|
| |
|
106 |
[Registry] |
| |
|
107 |
Root: HKLM; Subkey: "Software\Cygnus Solutions"; Flags: uninsdeletekeyifempty |
| |
|
108 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin"; Flags: uninsdeletekeyifempty |
| |
|
109 |
|
| |
|
110 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2"; Flags: uninsdeletekeyifempty |
| |
|
111 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2"; ValueType: string; ValueName: "cygdrive prefix"; ValueData: "/cygdrive" |
| |
|
112 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2"; ValueType: dword; ValueName: "cygdrive flags"; ValueData: "$22" |
| |
|
113 |
|
| |
|
114 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/"; Flags: uninsdeletekeyifempty |
| |
|
115 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/"; ValueType: string; ValueName: "native"; ValueData: "{code:UnixDir}/cygwin" |
| |
|
116 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/"; ValueType: dword; ValueName: "flags"; ValueData: "$a" |
| |
|
117 |
|
| |
|
118 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/bin"; Flags: uninsdeletekeyifempty |
| |
|
119 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/bin"; ValueType: string; ValueName: "native"; ValueData: "{code:UnixDir}/cygwin/bin" |
| |
|
120 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/bin"; ValueType: dword; ValueName: "flags"; ValueData: "$a" |
| |
|
121 |
|
| |
|
122 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/lib"; Flags: uninsdeletekeyifempty |
| |
|
123 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/lib"; ValueType: string; ValueName: "native"; ValueData: "{code:UnixDir}/cygwin/lib" |
| |
|
124 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\mounts v2\/usr/lib"; ValueType: dword; ValueName: "flags"; ValueData: "$a" |
| |
|
125 |
|
| |
|
126 |
Root: HKLM; Subkey: "Software\Cygnus Solutions\Cygwin\Program Options"; Flags: uninsdeletekeyifempty |
| |
|
127 |
|
| |
|
128 |
[Run] |
| |
|
129 |
; Extract the installed ZIP files. Unzip ignores the ones that doesn't exist |
| |
|
130 |
Filename: "{tmp}\unzip.exe"; StatusMsg: "Extracting CygWin (1-2 min)..."; Parameters: "-o {tmp}\cygwin.zip -d ""{app}"" "; Flags: runhidden |
| |
|
131 |
|
| |
|
132 |
; Setting global environment variables |
| |
|
133 |
;laurel |
| |
|
134 |
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 |
| |
|
135 |
Filename: "{tmp}\setx.exe"; StatusMsg: "Setting ENV Cygwin..."; Parameters: "CYGWIN server -m"; Flags: runhidden |
| |
|
136 |
Filename: "{tmp}\setx.exe"; StatusMsg: "Setting ENV Home..."; Parameters: "HOME ""{userappdata}"" -m"; Flags: runhidden |
| |
|
137 |
Filename: "{tmp}\setx.exe"; StatusMsg: "Setting ENV TmpDir..."; Parameters: "TMPDIR ""{code:EnvTmp}"" -m"; Flags: runhidden |
| |
|
138 |
|
| |
|
139 |
; Setup CygWin. |
| |
|
140 |
; |
| |
|
141 |
Filename: "{app}\cygwin\bin\chmod"; StatusMsg: "Setting Permissions..."; Parameters: "a+rx /bin -R"; Flags: runhidden |
| |
|
142 |
Filename: "{app}\cygwin\bin\bash"; StatusMsg: "Generating CygWin /etc/passwd..."; Parameters: " -c ""/bin/mkpasswd -l > /etc/passwd"" "; Flags: runhidden |
| |
|
143 |
Filename: "{app}\cygwin\bin\bash"; StatusMsg: "Generating CygWin /etc/group..."; Parameters: " -c ""/bin/mkgroup -l > /etc/group"" "; Flags: runhidden |
| |
|
144 |
Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Installing CygServer Service..."; Parameters: " -I cygserver -d ""by-CygServer"" -p /usr/sbin/cygserver"; Flags: runhidden |
| |
|
145 |
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 |
| |
|
146 |
Filename: "{sys}\net.exe"; StatusMsg: "Launching CygServer Service..."; Parameters: "start cygserver"; Flags: runhidden |
| |
|
147 |
|
| |
|
148 |
; Init the postgreSQL database |
| |
|
149 |
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 |
| |
|
150 |
Filename: "{app}\cygwin\bin\chmod"; StatusMsg: "Setting PostgreSQL Permissions..."; Parameters: "777 /var/postgresql/data -R"; Flags: runhidden |
| |
|
151 |
; Starting PostgreSQL service |
| |
|
152 |
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 |
| |
|
153 |
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 |
| |
|
154 |
Filename: "{sys}\net.exe"; StatusMsg: "Launching PostgreSQL Service (1 min)..."; Parameters: "start cygpostgres"; Flags: runhidden |
| |
|
155 |
; database |
| |
|
156 |
Filename: "{app}\cygwin\bin\psql"; StatusMsg: "Creating PostgreSQL User..."; Parameters: " -c ""CREATE USER oacss CREATEUSER CREATEDB password 'oacss';"" template1"; Flags: runhidden |
| |
|
157 |
Filename: "{app}\cygwin\bin\psql"; StatusMsg: "Creating PostgreSQL Database..."; Parameters: " -c ""CREATE DATABASE oacs ENCODING='UNICODE' OWNER oacss;"" template1"; Flags: runhidden |
| |
|
158 |
Filename: "{app}\cygwin\bin\createlang"; StatusMsg: "Creating PostgreSQL Language..."; Parameters: " -h localhost -U oacss plpgsql oacs"; Flags: runhidden |
| |
|
159 |
;aolserver |
| |
|
160 |
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 |
| |
|
161 |
; Setup AOLServer |
| |
|
162 |
|
| |
|
163 |
Filename: "{app}\nsd4\bin\nsd.exe"; StatusMsg: "Installing AOLServer Service..."; Parameters: " -I -t ""..\binstallw.tcl"" "; Flags: runhidden |
| |
|
164 |
Filename: "{app}\cygwin\bin\chmod"; StatusMsg: "Setting AOLServer Permissions..."; Parameters: " -R a+rw ""{code:UnixDir}/nsd4"; Flags: runhidden |
| |
|
165 |
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 |
| |
|
166 |
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 |
| |
|
167 |
Filename: "{sys}\net.exe"; StatusMsg: "Launching AOLServer Service (1-3 min)..."; Parameters: "start AOLserver-oacs-dotlrn"; Flags: runhidden |
| |
|
168 |
filename: "{app}\openacs.url"; StatusMsg: "installer"; Flags: shellexec |
| |
|
169 |
[UninstallRun] |
| |
|
170 |
Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Stopping Service AOLServer..."; Parameters: " -E AOLServer-oacs-dotlrn" |
| |
|
171 |
Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Removing Service AOLServer..."; Parameters: " -R AOLServer-oacs-dotlrn" |
| |
|
172 |
|
| |
|
173 |
Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Stopping Service PostgreSQL..."; Parameters: " -E cygpostgres" |
| |
|
174 |
Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Removing Service PostgreSQL..."; Parameters: " -R cygpostgres" |
| |
|
175 |
|
| |
|
176 |
Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Stopping Service CygServer..."; Parameters: " -E cygserver" |
| |
|
177 |
Filename: "{app}\cygwin\bin\cygrunsrv"; StatusMsg: "Removing Service CygServer..."; Parameters: " -R cygserver" |
| |
|
178 |
;net |
| |
|
179 |
Filename: "{sys}\net"; StatusMsg: "Stopping Service AOLServer via net..."; Parameters: " stop AOLServer-oacs-dotlrn" |
| |
|
180 |
Filename: "{sys}\net"; StatusMsg: "Stopping Service PostgreSQL via net..."; Parameters: " stop cygpostgres" |
| |
|
181 |
Filename: "{sys}\net"; StatusMsg: "Stopping Service CygServer via net..."; Parameters: " stop cygserver" |
| |
|
182 |
|
| |
|
183 |
Filename: "{app}\Oacs\bin\reg.exe"; StatusMsg: "Deleting Registry Settings..."; Parameters: "DELETE ""HKCU\Software\Cygnus Solutions"" /f" |
| |
|
184 |
Filename: "{app}\Oacs\bin\reg.exe"; StatusMsg: "Deleting Registry Settings..."; Parameters: "DELETE ""HKLM\Software\Cygnus Solutions"" /f" |
| |
|
185 |
|
| |
|
186 |
Filename: "{tmp}\chown"; Parameters: "-v -R Administrators {app}\cygwin\"; StatusMsg: "Setting Owner to Administrators..." |
| |
|
187 |
Filename: "{tmp}\subinacl.exe"; Parameters: "/subdirectories {app}\cygwin\* /grant=Everyone=F"; StatusMsg: "Setting Permissions for Everyone..." |
| |
|
188 |
|
| |
|
189 |
; Delete the entire directory |
| |
|
190 |
Filename: "{sys}\cmd"; Parameters: "/C ""rmdir /S /Q '{app}' """; StatusMsg: "Deleting (App) directory..." |
| |
|
191 |
Filename: "{sys}\cmd"; Parameters: "/C ""rmdir /S /Q '{group}' """; StatusMsg: "Deleting (Group)..." |
| |
|
192 |
[UninstallDelete] |
| |
|
193 |
Type: files; Name: "{app}\{#MyAppUrlName}" |
| |
|
194 |
Type: filesandordirs; Name: "{app}" |
| |
|
195 |
Type: filesandordirs; Name: "{group}" |
| |
|
196 |
|
| |
|
197 |
[Code] |
| |
|
198 |
|
| |
|
199 |
var |
| |
|
200 |
UserPage: TInputQueryWizardPage; |
| |
|
201 |
UserPage2: TInputQueryWizardPage; |
| |
|
202 |
Values: TArrayOfString; |
| |
|
203 |
Name: string; |
| |
|
204 |
Usname:string; |
| |
|
205 |
Last_NAME:string; |
| |
|
206 |
Email:string; |
| |
|
207 |
System_name:string; |
| |
|
208 |
pass:string; |
| |
|
209 |
confpass: string; |
| |
|
210 |
|
| |
|
211 |
|
| |
|
212 |
function Path(Default: String): String; |
| |
|
213 |
begin |
| |
|
214 |
Result := GetEnv('Path'); |
| |
|
215 |
|
| |
|
216 |
end; |
| |
|
217 |
|
| |
|
218 |
function UnixDir(Default: String): String; |
| |
|
219 |
var |
| |
|
220 |
i: Integer; |
| |
|
221 |
dir: String; |
| |
|
222 |
begin |
| |
|
223 |
dir := ExpandConstant('{app}'); |
| |
|
224 |
|
| |
|
225 |
for i := 1 to length(dir)do begin |
| |
|
226 |
if (StrGet(dir, i) = '\') then begin |
| |
|
227 |
StrSet('/', i, dir); |
| |
|
228 |
end; |
| |
|
229 |
end; |
| |
|
230 |
Result := dir; |
| |
|
231 |
end; |
| |
|
232 |
|
| |
|
233 |
|
| |
|
234 |
function EnvTmp(Default: String): String; |
| |
|
235 |
begin |
| |
|
236 |
Result := GetEnv('Tmp'); |
| |
|
237 |
end; |
| |
|
238 |
procedure msg(linea, def: string); |
| |
|
239 |
begin |
| |
|
240 |
MsgBox('parametro faltante'+linea+'se pondra'+def, mbInformation, MB_OK); |
| |
|
241 |
end; |
| |
|
242 |
|
| |
|
243 |
procedure parametros(); |
| |
|
244 |
begin |
| |
|
245 |
|
| |
|
246 |
Name:= UserPage2.Values[0]; |
| |
|
247 |
Last_NAME:= UserPage2.Values[1]; |
| |
|
248 |
Email:= UserPage2.Values[2]; |
| |
|
249 |
System_name:= UserPage2.Values[3]; |
| |
|
250 |
Usname:= Email; |
| |
|
251 |
pass:= UserPage.Values[0]; |
| |
|
252 |
confpass:= UserPage.Values[1]; |
| |
|
253 |
if (CompareStr(pass,confpass)<>0) then begin |
| |
|
254 |
MsgBox('Las contrase�as no coinsiden se pondra oacs como contrase�a temporal', mbInformation, MB_OK); |
| |
|
255 |
pass:='oacs'; |
| |
|
256 |
confpass:='oacs'; |
| |
|
257 |
end |
| |
|
258 |
if ((Name='')) then begin |
| |
|
259 |
msg('Name','oacs'); |
| |
|
260 |
Name:='oacs'; |
| |
|
261 |
end |
| |
|
262 |
if ((Last_NAME='')) then begin |
| |
|
263 |
msg('Lasr Name','oacs'); |
| |
|
264 |
Last_NAME:='oacs'; |
| |
|
265 |
end |
| |
|
266 |
if ((Email='')) then begin |
| |
|
267 |
msg('Email','oacs@temp.com'); |
| |
|
268 |
Last_NAME:='oacs@temp.com'; |
| |
|
269 |
end |
| |
|
270 |
if ((System_name='')) then begin |
| |
|
271 |
msg('System name','oacs'); |
| |
|
272 |
Last_NAME:='oacs'; |
| |
|
273 |
end |
| |
|
274 |
|
| |
|
275 |
end; |
| |
|
276 |
|
| |
|
277 |
function ReplaceLine(var strLine: TArrayOfString; strFind, strReplace: String): boolean ; |
| |
|
278 |
var |
| |
|
279 |
i, p: longint; |
| |
|
280 |
commentSize: longint; |
| |
|
281 |
arraySize: longint; |
| |
|
282 |
fileChanged: boolean; |
| |
|
283 |
strTemp: string; |
| |
|
284 |
|
| |
|
285 |
begin |
| |
|
286 |
|
| |
|
287 |
arraySize := GetArrayLength(strLine)-1; |
| |
|
288 |
for i := 0 to arraySize do begin |
| |
|
289 |
p := Pos(strFind,strLine[i]); |
| |
|
290 |
if p > 0 then begin |
| |
|
291 |
strTemp := copy(strLine[i], 1, p-1) + strReplace + copy(strLine[i], p+length(strFind), 99999); |
| |
|
292 |
strLine[i] := strTemp; |
| |
|
293 |
end |
| |
|
294 |
end; |
| |
|
295 |
end; |
| |
|
296 |
|
| |
|
297 |
procedure Patchindex(FileName: String); |
| |
|
298 |
var |
| |
|
299 |
Patch: String; |
| |
|
300 |
strLine: TArrayOfString; |
| |
|
301 |
que:boolean; |
| |
|
302 |
que2:boolean; |
| |
|
303 |
dir:String; |
| |
|
304 |
dir2:String; |
| |
|
305 |
begin |
| |
|
306 |
parametros(); |
| |
|
307 |
dir := ExpandConstant('{app}'); |
| |
|
308 |
dir2:=dir+'\'+FileName; |
| |
|
309 |
LoadStringsFromFile(dir2,strLine); |
| |
|
310 |
ReplaceLine(strLine,'|email|',Email); |
| |
|
311 |
ReplaceLine(strLine,'|name|',Name); |
| |
|
312 |
ReplaceLine(strLine,'|usname|',Usname); |
| |
|
313 |
ReplaceLine(strLine,'|LsName|',Last_NAME); |
| |
|
314 |
ReplaceLine(strLine,'|pass|',pass); |
| |
|
315 |
ReplaceLine(strLine,'|Cpass|',confpass); |
| |
|
316 |
ReplaceLine(strLine,'|Sname|',confpass); |
| |
|
317 |
SaveStringsToFile(dir2, strLine, false); |
| |
|
318 |
|
| |
|
319 |
end; |
| |
|
320 |
|
| |
|
321 |
procedure Patchinstaltcl(FileName: String); |
| |
|
322 |
var |
| |
|
323 |
Patch: String; |
| |
|
324 |
strLine: TArrayOfString; |
| |
|
325 |
dir:String; |
| |
|
326 |
dir2:String; |
| |
|
327 |
dir3:String; |
| |
|
328 |
drive,drive2,dir4:string; |
| |
|
329 |
i: Integer; |
| |
|
330 |
p: Integer; |
| |
|
331 |
begin |
| |
|
332 |
dir := ExpandConstant('{app}'); |
| |
|
333 |
dir3:=dir; |
| |
|
334 |
dir2:=dir+'\'+FileName; |
| |
|
335 |
LoadStringsFromFile(dir2, strLine); |
| |
|
336 |
ReplaceLine(strLine, '|instdir|', UnixDir('')); |
| |
|
337 |
for i := 0 to length(dir) do begin |
| |
|
338 |
p := Pos('\',dir3); |
| |
|
339 |
if p > 0 then begin |
| |
|
340 |
dir4 := copy(dir3, 1, p) + '\' + copy(dir3, p+1, length(dir)); |
| |
|
341 |
p:=-1; |
| |
|
342 |
end |
| |
|
343 |
end; |
| |
|
344 |
|
| |
|
345 |
drive := copy(Dir4, 1, 1); |
| |
|
346 |
drive:=LowerCase(drive); |
| |
|
347 |
drive2 := drive + copy(dir4, 2, length(dir4)); |
| |
|
348 |
ReplaceLine(strLine, '|instdir1|', drive2); |
| |
|
349 |
SaveStringsToFile(dir2, strLine, false); |
| |
|
350 |
end; |
| |
|
351 |
|
| |
|
352 |
procedure PatchCygwin(FileName: String); |
| |
|
353 |
var |
| |
|
354 |
strLine: TArrayOfString; |
| |
|
355 |
dir,InstallDir, InstallDrive: String; |
| |
|
356 |
begin |
| |
|
357 |
InstallDir := ExpandConstant('{app}'); |
| |
|
358 |
dir:= InstallDir +'\'+ FileName; |
| |
|
359 |
InstallDrive := copy(InstallDir, 1, 1); |
| |
|
360 |
LoadStringsFromFile(dir, strLine); |
| |
|
361 |
ReplaceLine(strLine, '|dir|', InstallDir); |
| |
|
362 |
ReplaceLine(strLine, '|driv|', InstallDrive); |
| |
|
363 |
SaveStringsToFile(dir, strLine, false); |
| |
|
364 |
end; |
| |
|
365 |
|
| |
|
366 |
procedure InitializeWizard(); |
| |
|
367 |
begin |
| |
|
368 |
|
| |
|
369 |
UserPage := CreateInputQueryPage(wpUserInfo, |
| |
|
370 |
'Personal Information', 'Continuacion', |
| |
|
371 |
'Please specify your password and password confirmation, then click Next.'); |
| |
|
372 |
UserPage.Add('Password', True); |
| |
|
373 |
UserPage.Add('confirmar Password:', True); |
| |
|
374 |
|
| |
|
375 |
|
| |
|
376 |
|
| |
|
377 |
UserPage2 := CreateInputQueryPage(wpUserInfo, |
| |
|
378 |
'Personal Information', 'Who are you?', |
| |
|
379 |
'Please specify your name and email, then click Next.'); |
| |
|
380 |
UserPage2.Add('Name:', False); |
| |
|
381 |
UserPage2.Add('Last Name:', False); |
| |
|
382 |
UserPage2.Add('Email:', False); |
| |
|
383 |
UserPage2.Add('System Name:', False); |
| |
|
384 |
|
| |
|
385 |
end; |
| |
|
386 |
|