2
0

freeswitch_1.0.4.iss 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819
  1. ; Script generated by the Inno Setup Script Wizard.
  2. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
  3. [Setup]
  4. ; NOTE: The value of AppId uniquely identifies this application.
  5. ; Do not use the same AppId value in installers for other applications.
  6. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
  7. ;AppId={{088C2C50-0D5F-4276-8771-FF54CAA14E70}
  8. AppName=FreeSWITCH
  9. AppVerName=FreeSWITCH 1.0.4
  10. AppPublisher=FreeSWITCH
  11. AppPublisherURL=http://www.freeswitch.org
  12. AppSupportURL=http://www.freeswitch.org
  13. AppUpdatesURL=http://www.freeswitch.org
  14. DefaultDirName=C:\FreeSWITCH
  15. DefaultGroupName=FreeSWITCH
  16. ;LicenseFile=C:\source\wamp\license.txt
  17. OutputBaseFilename=freeswitch-1.0.4
  18. SetupIconFile=freeswitch.ico
  19. Compression=lzma
  20. SolidCompression=true
  21. AppCopyright=Anthony Minessale II
  22. AllowUNCPath=false
  23. OutputDir=Output
  24. [Languages]
  25. Name: english; MessagesFile: compiler:Default.isl
  26. [Tasks]
  27. Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
  28. Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
  29. [Files]
  30. ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
  31. Source: freeswitch.ico; DestDir: {app}; Components: FreeSWITCH
  32. Source: vcredist_x86.exe; Components: FreeSWITCH; DestDir: {tmp}
  33. Source: freepbx.ico; DestDir: {app}; Components: FreePBX_WAMP
  34. Source: expsound.bat; DestDir: {app}; Components: FreeSWITCH
  35. Source: FreePBX.url; DestDir: {app}; Components: FreePBX_WAMP
  36. Source: create_freepbx.sql; DestDir: {app}; Components: FreePBX_WAMP
  37. Source: create_freepbx.bat; DestDir: {app}; Components: FreePBX_WAMP
  38. Source: G:\freeswitch-1.0.4\Release\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist; Components: FreeSWITCH
  39. Source: G:\freeswitch-1.0.4\Release_CLR\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist; Components: FreeSWITCH
  40. Source: G:\freeswitch_dev\contrib\jmesquita\fsgui\bin\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist; Components: fsgui
  41. Source: G:\wamp_source\close\*.*; DestDir: {app}\wamp\; Flags: ignoreversion recursesubdirs; AfterInstall: close(); Components: FreePBX_WAMP
  42. Source: G:\wamp_source\wamp\*.*; DestDir: {app}\wamp\; Flags: ignoreversion recursesubdirs onlyifdoesntexist; Components: FreePBX_WAMP
  43. Source: G:\wamp_source\wamp\license.txt; DestDir: {app}\wamp\; AfterInstall: install(); Components: FreePBX_WAMP
  44. Source: G:\freeswitch_dev\Release\php_ESL.dll; DestDir: {app}\wamp\bin\php\php5.3.0\ext; Flags: ignoreversion recursesubdirs; Components: FreePBX_WAMP
  45. Source: G:\freepbx-v3-dev\*; DestDir: {app}\wamp\www\freepbx-v3; Flags: ignoreversion recursesubdirs onlyifdoesntexist createallsubdirs; Components: FreePBX_WAMP
  46. Source: G:\freepbx-v3-dev\INSTALL.TXT; DestDir: {app}\wamp\www\freepbx-v3; AfterInstall: fix_freepbx_paths(); Components: FreePBX_WAMP
  47. ; These two files are required for TLS/SSL support
  48. Source: C:\OpenSSL\libeay32.dll; DestDir: {app}
  49. Source: C:\OpenSSL\ssleay32.dll; DestDir: {app}
  50. [Icons]
  51. Name: {group}\FreeSWITCH; Filename: {app}\FreeSwitch.exe; Components: FreeSWITCH; IconFilename: {app}\freeswitch.ico; IconIndex: 0; WorkingDir: {app}
  52. Name: {commondesktop}\FreeSWITCH; Filename: {app}\FreeSwitch.exe; Tasks: desktopicon; Components: FreeSWITCH; IconFilename: {app}\freeswitch.ico; IconIndex: 0; WorkingDir: {app}
  53. Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\FreeSWITCH; Filename: {app}\FreeSwitch.exe; Tasks: quicklaunchicon; Components: FreeSWITCH; IconFilename: {app}\freeswitch.ico; IconIndex: 0; WorkingDir: {app}
  54. Name: {commondesktop}\fsgui; Filename: {app}\fsgui.exe; Tasks: desktopicon; Components: fsgui; IconFilename: {app}\freeswitch.ico; IconIndex: 0; WorkingDir: {app}\plugins
  55. Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\fsgui; Filename: {app}\fsgui.exe; Tasks: quicklaunchicon; Components: fsgui; IconFilename: {app}\freeswitch.ico; IconIndex: 0; WorkingDir: {app}\plugins
  56. Name: {commondesktop}\FreePBX.url; Filename: {app}\FreePBX.url; Tasks: desktopicon; Components: FreePBX_WAMP; IconFilename: {app}\freepbx.ico; IconIndex: 0
  57. Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\FreePBX.url; Filename: {app}\FreePBX.url; Tasks: quicklaunchicon; Components: FreePBX_WAMP; IconFilename: {app}\freepbx.ico; IconIndex: 0
  58. Name: {group}\start WampServer; Filename: {app}\wamp\wampmanager.exe; WorkingDir: {app}\wamp; Components: FreePBX_WAMP; Flags: runminimized
  59. Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\WampServer; Filename: {app}\wamp\wampmanager.exe; Tasks: quicklaunchicon; Components: FreePBX_WAMP
  60. Name: {commondesktop}\WampServer; Filename: {app}\wamp\wampmanager.exe; Tasks: desktopicon; Components: FreePBX_WAMP
  61. [Run]
  62. Filename: {tmp}\vcredist_x86.exe; Description: Microsoft Visual C++ 2008 Redistributable Package (x86); Components: FreeSWITCH; Parameters: /q
  63. Filename: {app}\wamp\uninstall_services.bat; Components: FreePBX_WAMP; Flags: runhidden
  64. Filename: {app}\wamp\install_services.bat; Components: FreePBX_WAMP; Flags: runhidden
  65. Filename: {app}\wamp\wampmanager.exe; Description: Launch WampServer 2 now; Components: FreePBX_WAMP; Flags: shellexec postinstall skipifsilent runhidden
  66. Filename: {app}\freeswitch.exe; Description: Launch FreeSWITCH now; Flags: shellexec postinstall skipifsilent; Components: FreeSWITCH
  67. Filename: {app}\create_freepbx.bat; Description: Create FreePBX MySQL user; Flags: runhidden; Components: FreePBX_WAMP; Parameters: {app}; WorkingDir: {app}
  68. Filename: {app}\expsound.bat; Parameters: {tmp} {app} freeswitch-sounds-en-us-callie-8000-1.0.11.tar.gz; Components: sound_files_8khz; WorkingDir: {tmp}
  69. Filename: {app}\expsound.bat; Parameters: {tmp} {app} freeswitch-sounds-music-8000-1.0.8.tar.gz; Components: sound_files_8khz; WorkingDir: {tmp}; Tasks: ; Languages:
  70. Filename: {app}\expsound.bat; Parameters: {tmp} {app} freeswitch-sounds-en-us-callie-16000-1.0.11.tar.gz; Components: sound_files_16khz; WorkingDir: {tmp}; Tasks: ; Languages:
  71. Filename: {app}\expsound.bat; Parameters: {tmp} {app} freeswitch-sounds-music-16000-1.0.8.tar.gz; Components: sound_files_16khz; WorkingDir: {tmp}; Tasks: ; Languages:
  72. Filename: {app}\expsound.bat; Parameters: {tmp} {app} freeswitch-sounds-en-us-callie-32000-1.0.11.tar.gz; Components: sound_files_32khz; WorkingDir: {tmp}; Tasks: ; Languages:
  73. Filename: {app}\expsound.bat; Parameters: {tmp} {app} freeswitch-sounds-music-32000-1.0.8.tar.gz; Components: sound_files_32khz; WorkingDir: {tmp}; Tasks: ; Languages:
  74. Filename: {app}\expsound.bat; Parameters: {tmp} {app} freeswitch-sounds-en-us-callie-48000-1.0.11.tar.gz; Components: sound_files_48khz; WorkingDir: {tmp}; Tasks: ; Languages:
  75. Filename: {app}\expsound.bat; Parameters: {tmp} {app} freeswitch-sounds-music-48000-1.0.8.tar.gz; Components: sound_files_48khz; WorkingDir: {tmp}; Tasks: ; Languages:
  76. [UninstallDelete]
  77. Type: filesandordirs; Name: {app}\sounds
  78. Type: files; Name: {app}\wamp\*.*
  79. Type: filesandordirs; Name: {app}\wamp\apps
  80. Type: filesandordirs; Name: {app}\wamp\bin\apache
  81. Type: filesandordirs; Name: {app}\wamp\bin\php
  82. Type: filesandordirs; Name: {app}\wamp\help
  83. Type: filesandordirs; Name: {app}\wamp\lang
  84. Type: filesandordirs; Name: {app}\wamp\logs
  85. Type: filesandordirs; Name: {app}\wamp\scripts
  86. Type: filesandordirs; Name: {app}\wamp\tmp
  87. Type: filesandordirs; Name: {app}
  88. [UninstallRun]
  89. Filename: {app}\wamp\uninstall_services.bat; Components: FreePBX_WAMP; Flags: runhidden
  90. Filename: {app}\freeswitch.exe; Flags: runhidden; Parameters: -stop; WorkingDir: {app}
  91. [_ISToolDownload]
  92. Source: http://files.freeswitch.org/releases/sounds/freeswitch-sounds-en-us-callie-8000-1.0.11.tar.gz; DestDir: {tmp}; DestName: freeswitch-sounds-en-us-callie-8000-1.0.11.tar.gz; Components: sound_files_8khz
  93. Source: http://files.freeswitch.org/releases/sounds/freeswitch-sounds-en-us-callie-16000-1.0.11.tar.gz; DestDir: {tmp}; DestName: freeswitch-sounds-en-us-callie-16000-1.0.11.tar.gz; Components: sound_files_16khz
  94. Source: http://files.freeswitch.org/releases/sounds/freeswitch-sounds-en-us-callie-32000-1.0.11.tar.gz; DestDir: {tmp}; DestName: freeswitch-sounds-en-us-callie-32000-1.0.11.tar.gz; Components: sound_files_32khz
  95. Source: http://files.freeswitch.org/releases/sounds/freeswitch-sounds-en-us-callie-48000-1.0.11.tar.gz; DestDir: {tmp}; DestName: freeswitch-sounds-en-us-callie-48000-1.0.11.tar.gz; Components: sound_files_48khz
  96. Source: http://files.freeswitch.org/releases/sounds/freeswitch-sounds-music-8000-1.0.8.tar.gz; DestDir: {tmp}; DestName: freeswitch-sounds-music-8000-1.0.8.tar.gz; Components: sound_files_8khz
  97. Source: http://files.freeswitch.org/releases/sounds/freeswitch-sounds-music-16000-1.0.8.tar.gz; DestDir: {tmp}; DestName: freeswitch-sounds-music-16000-1.0.8.tar.gz; Components: sound_files_16khz
  98. Source: http://files.freeswitch.org/releases/sounds/freeswitch-sounds-music-32000-1.0.8.tar.gz; DestDir: {tmp}; DestName: freeswitch-sounds-music-32000-1.0.8.tar.gz; Components: sound_files_32khz
  99. Source: http://files.freeswitch.org/releases/sounds/freeswitch-sounds-music-48000-1.0.8.tar.gz; DestDir: {tmp}; DestName: freeswitch-sounds-music-48000-1.0.8.tar.gz; Components: sound_files_48khz
  100. Source: http://files.freeswitch.org/downloads/win32/7za.exe; DestDir: {tmp}; DestName: 7za.exe; Components: sound_files_8khz
  101. [Components]
  102. Name: FreeSWITCH; Description: FreeSWITCH core components; Flags: fixed; Types: custom compact full; Languages:
  103. Name: FreePBX_WAMP; Description: FreePBX interface along with Apache, Mysql and PHP; Types: custom full
  104. Name: fsgui; Description: fsgui (Joao Mesquita's QT based console); Types: custom full
  105. Name: sound_files_8khz; Description: sound files 8khz (G711); ExtraDiskSpaceRequired: 21000000; Types: custom compact full; Languages:
  106. Name: sound_files_16khz; Description: sound files 16khz (G722); ExtraDiskSpaceRequired: 42000000; Types: custom full; Languages:
  107. Name: sound_files_32khz; Description: sound files 32khz (CELT); ExtraDiskSpaceRequired: 82000000; Types: custom full; Languages:
  108. Name: sound_files_48khz; Description: sound files 48khz (CELT); ExtraDiskSpaceRequired: 119000000; Types: custom full; Languages:
  109. [Code]
  110. //variables globales
  111. var phpVersion: String;
  112. var apacheVersion: String;
  113. var path: String;
  114. var pathWithSlashes: String;
  115. var page: TInputQueryWizardPage;
  116. var email: String;
  117. var smtp: String;
  118. //-----------------------------------------------
  119. procedure expand_sound();
  120. var execFile: String;
  121. var myResult: Integer;
  122. var temppath: String;
  123. begin
  124. temppath := ExpandConstant('{tmp}');
  125. execFile := temppath+'\7za.exe';
  126. Exec(execFile, '',temppath+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
  127. end;
  128. procedure fix_freepbx_paths();
  129. var srcFile: String;
  130. var destFile: String;
  131. var srcContents: String;
  132. var fspath: String;
  133. var fspathWithSlashes: String;
  134. begin
  135. fspath := ExpandConstant('{app}');
  136. fspathWithSlashes := fspath;
  137. StringChange (fspathWithSlashes, '\','/');
  138. destFile := fspathWithSlashes+'/wamp/www/freepbx-v3/freepbx/config/telephony.php';
  139. //srcFile := fspathWithSlashes+'/wamp/www/freepbx-v3/freepbx/config/telephony.php.install';
  140. //if not FileExists (destFile) then
  141. //begin
  142. LoadStringFromFile (destFile, srcContents);
  143. StringChange (srcContents, '/opt/freeswitch', fspathWithSlashes);
  144. StringChange (srcContents, '/usr/local/freeswitch', fspathWithSlashes);
  145. SaveStringToFile(destFile,srcContents, False);
  146. //end
  147. //DeleteFile(SrcFile);
  148. end;
  149. //procedure qui ferme les eteind les services et ferme wampmanager.exe (si ils existent)
  150. procedure close();
  151. var batFile: String;
  152. var myResult: Integer;
  153. begin
  154. path := ExpandConstant('{app}') + '\wamp';
  155. batFile := path+'\closewamp.bat';
  156. Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
  157. end;
  158. //----------------------------------------------
  159. //procedure qui adapte WAMP aux choix effectués lors de l'installation
  160. procedure install();
  161. var srcFile: String;
  162. var destFile: String;
  163. var srcContents: String;
  164. var browser: String;
  165. var winPath: String;
  166. var mysqlVersion: String;
  167. var wampserverVersion: String;
  168. var phpmyadminVersion: String;
  169. //var sqlitemanagerVersion: String;
  170. var tmp: String;
  171. var phpDllCopy: String;
  172. begin
  173. //version des applis, à modifier pour chaque version de WampServer 2
  174. apacheVersion := '2.2.11';
  175. phpVersion := '5.3.0' ;
  176. mysqlVersion := '5.1.36';
  177. wampserverVersion := '2.0';
  178. phpmyadminVersion := '3.2.0.1';
  179. //sqlitemanagerVersion := '1.2.0';
  180. path := ExpandConstant('{app}') + '\wamp';
  181. winPath := ExpandConstant('{win}');
  182. pathWithSlashes := path;
  183. StringChange (pathWithSlashes, '\','/');
  184. //----------------------------------------------
  185. // renommage du fichier c:/windows/php.ini
  186. //----------------------------------------------
  187. if FileExists ('c:/windows/php.ini') then
  188. begin
  189. if MsgBox('A previous php.ini file has been detected in your Windows directory. Do you want WampServer2 to rename it to php_old.ini to avoid conflicts?',mbConfirmation,MB_YESNO) = IDYES then
  190. begin
  191. RenameFile('c:/windows/php.ini','c:/windows/php_old.ini');
  192. end
  193. end
  194. //----------------------------------------------
  195. // Fichier install_services.bat
  196. //----------------------------------------------
  197. destFile := pathWithSlashes+'/install_services.bat';
  198. srcFile := pathWithSlashes+'/install_services.bat.install';
  199. if not FileExists (pathWithSlashes+'/wampmanager.conf') then
  200. begin
  201. LoadStringFromFile (srcFile, srcContents);
  202. //version de apache et mysql
  203. StringChange (srcContents, 'WAMPMYSQLVERSION', mysqlVersion);
  204. StringChange (srcContents, 'WAMPAPACHEVERSION', apacheVersion);
  205. SaveStringToFile(destFile,srcContents, False);
  206. end
  207. else
  208. begin
  209. //dans le cas d'une upgrade on détruit le fichier pour qu'il ne soit pas executé
  210. DeleteFile(destFile);
  211. end
  212. DeleteFile(SrcFile);
  213. //----------------------------------------------
  214. // Fichier install_services_auto.bat
  215. //----------------------------------------------
  216. destFile := pathWithSlashes+'/install_services_auto.bat';
  217. srcFile := pathWithSlashes+'/install_services_auto.bat.install';
  218. if not FileExists (pathWithSlashes+'/wampmanager.conf') then
  219. begin
  220. LoadStringFromFile (srcFile, srcContents);
  221. //version de apache et mysql
  222. StringChange (srcContents, 'WAMPMYSQLVERSION', mysqlVersion);
  223. StringChange (srcContents, 'WAMPAPACHEVERSION', apacheVersion);
  224. SaveStringToFile(destFile,srcContents, False);
  225. end
  226. else
  227. begin
  228. //dans le cas d'une upgrade on détruit le fichier pour qu'il ne soit pas executé
  229. DeleteFile(destFile);
  230. end
  231. DeleteFile(SrcFile);
  232. //----------------------------------------------
  233. // Fichier uninstall_services_auto.bat
  234. //----------------------------------------------
  235. destFile := pathWithSlashes+'/uninstall_services.bat';
  236. srcFile := pathWithSlashes+'/uninstall_services.bat.install';
  237. if not FileExists (pathWithSlashes+'/wampmanager.conf') then
  238. begin
  239. LoadStringFromFile (srcFile, srcContents);
  240. //version de apache et mysql
  241. StringChange (srcContents, 'WAMPMYSQLVERSION', mysqlVersion);
  242. StringChange (srcContents, 'WAMPAPACHEVERSION', apacheVersion);
  243. SaveStringToFile(destFile,srcContents, False);
  244. end
  245. else
  246. begin
  247. //dans le cas d'une upgrade on détruit le fichier pour qu'il ne soit pas executé
  248. DeleteFile(destFile);
  249. end
  250. DeleteFile(SrcFile);
  251. //----------------------------------------------
  252. // Fichier wampmanager.conf
  253. //----------------------------------------------
  254. destFile := pathWithSlashes+'/wampmanager.conf';
  255. srcFile := pathWithSlashes+'/wampmanager.conf.install';
  256. if not FileExists (destFile) then
  257. begin
  258. LoadStringFromFile (srcFile, srcContents);
  259. //installDir et versions
  260. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  261. StringChange (srcContents, 'WAMPSERVERVERSION', wampserverVersion);
  262. StringChange (srcContents, 'WAMPPHPVERSION', phpVersion);
  263. StringChange (srcContents, 'WAMPMYSQLVERSION', mysqlVersion);
  264. StringChange (srcContents, 'WAMPAPACHEVERSION', apacheVersion);
  265. StringChange (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion);
  266. // StringChange (srcContents, 'WAMPSQLITEMANAGERVERSION', sqlitemanagerVersion);
  267. //navigateur
  268. browser := 'explorer.exe';
  269. if FileExists ('C:/Program Files/Mozilla Firefox/firefox.exe') then
  270. begin
  271. if MsgBox('Firefox has been detected on your computer. Would you like to use it as the default browser with WampServer2?',mbConfirmation,MB_YESNO) = IDYES then
  272. begin
  273. browser := 'C:/Program Files/Mozilla Firefox/firefox.exe';
  274. end
  275. end
  276. if browser = 'explorer.exe' then
  277. begin
  278. GetOpenFileName('Please choose your default browser. If you are not sure, just click Open :', browser, winPath,'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
  279. end
  280. StringChange (srcContents, 'WAMPBROWSER', browser);
  281. SaveStringToFile(destFile,srcContents, False);
  282. end
  283. else
  284. begin
  285. // changement de wampserverVersion et WampserverVersion pour les upgrades
  286. end
  287. DeleteFile(SrcFile);
  288. //----------------------------------------------
  289. // Fichier wampmanager.ini
  290. //----------------------------------------------
  291. destFile := pathWithSlashes+'/wampmanager.ini';
  292. srcFile := pathWithSlashes+'/wampmanager.ini.install';
  293. if not FileExists (destFile) then
  294. begin
  295. LoadStringFromFile (srcFile, srcContents);
  296. //installDir et versions
  297. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  298. StringChange (srcContents, 'WAMPPHPVERSION', phpVersion);
  299. SaveStringToFile(destFile,srcContents, False);
  300. end
  301. DeleteFile(SrcFile);
  302. //----------------------------------------------
  303. // Fichier wampmanager.tpl
  304. //----------------------------------------------
  305. destFile := pathWithSlashes+'/wampmanager.tpl';
  306. srcFile := pathWithSlashes+'/wampmanager.tpl.install';
  307. if not FileExists (destFile) then
  308. begin
  309. LoadStringFromFile (srcFile, srcContents);
  310. SaveStringToFile(destFile,srcContents, False);
  311. end
  312. DeleteFile(SrcFile);
  313. //----------------------------------------------
  314. // Fichier alias phpmyadmin
  315. //----------------------------------------------
  316. destFile := pathWithSlashes+'/alias/phpmyadmin.conf';
  317. srcFile := pathWithSlashes+'/alias/phpmyadmin.conf.install';
  318. if not FileExists (destFile) then
  319. begin
  320. LoadStringFromFile (srcFile, srcContents);
  321. //installDir et version de phpmyadmin
  322. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  323. StringChange (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion);
  324. SaveStringToFile(destFile,srcContents, False);
  325. end
  326. else
  327. begin
  328. LoadStringFromFile (srcFile, srcContents);
  329. //installDir et version de phpmyadmin
  330. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  331. StringChange (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion);
  332. SaveStringToFile(destFile,srcContents, False);
  333. //mise à jour de la version de phpmyadmin
  334. tmp := GetIniString('apps','phpmyadminVersion',phpmyadminVersion,pathWithSlashes+'/wampmanager.conf');
  335. if not CompareText(tmp,phpmyadminVersion) = 0 then
  336. begin
  337. SetIniString('apps','phpmyadminVersion',phpmyadminVersion,pathWithSlashes+'/wampmanager.conf');
  338. LoadStringFromFile (destFile, srcContents);
  339. StringChange (srcContents, tmp, phpmyadminVersion);
  340. SaveStringToFile(destFile,srcContents, False);
  341. end
  342. end
  343. DeleteFile(SrcFile);
  344. //----------------------------------------------
  345. // Fichier de configuration de phpmyadmin
  346. //----------------------------------------------
  347. destFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php';
  348. srcFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php.install';
  349. if not FileExists (destFile) then
  350. begin
  351. // si un fichier existe pour une version precedente de phpmyadmin, on le recupere
  352. if FileExists (pathWithSlashes+'/apps/phpmyadmin'+tmp+'/config.inc.php') then
  353. begin
  354. LoadStringFromFile (pathWithSlashes+'/apps/phpmyadmin'+tmp+'/config.inc.php', srcContents);
  355. SaveStringToFile(destFile,srcContents, False);
  356. end
  357. else
  358. begin
  359. // sinon on prends le fichier par defaut
  360. LoadStringFromFile (srcFile, srcContents);
  361. SaveStringToFile(destFile,srcContents, False);
  362. end
  363. end
  364. DeleteFile(SrcFile);
  365. //----------------------------------------------
  366. // Fichier httpd.conf
  367. //----------------------------------------------
  368. destFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/conf/httpd.conf';
  369. srcFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/conf/httpd.conf.install';
  370. if not FileExists (destFile) then
  371. begin
  372. LoadStringFromFile (srcFile, srcContents);
  373. //installDir et version de php
  374. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  375. StringChange (srcContents, 'WAMPPHPVERSION', phpVersion);
  376. SaveStringToFile(destFile,srcContents, False);
  377. end
  378. DeleteFile(SrcFile);
  379. //----------------------------------------------
  380. // Fichier my.ini
  381. //----------------------------------------------
  382. destFile := pathWithSlashes+'/bin/mysql/mysql'+mysqlVersion+'/my.ini';
  383. srcFile := pathWithSlashes+'/bin/mysql/mysql'+mysqlVersion+'/my.ini.install';
  384. if not FileExists (destFile) then
  385. begin
  386. LoadStringFromFile (srcFile, srcContents);
  387. //installDir et version de php
  388. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  389. SaveStringToFile(destFile,srcContents, False);
  390. end
  391. DeleteFile(SrcFile);
  392. //----------------------------------------------
  393. // Fichier index.php
  394. //----------------------------------------------
  395. destFile := pathWithSlashes+'/www/index.php';
  396. srcFile := pathWithSlashes+'/www/index.php.install';
  397. if not FileExists (destFile) then
  398. begin
  399. LoadStringFromFile (srcFile, srcContents);
  400. SaveStringToFile(destFile,srcContents, False);
  401. end
  402. else
  403. begin
  404. if MsgBox('Would you like to install the new WampServer 2 homepage? (this will overwrite exisiting index.php file)',mbConfirmation,MB_YESNO) = IDYES then
  405. begin
  406. DeleteFile (destFile);
  407. LoadStringFromFile (srcFile, srcContents);
  408. SaveStringToFile(destFile,srcContents, False);
  409. end
  410. end
  411. DeleteFile(SrcFile);
  412. //----------------------------------------------
  413. // Fichier php.ini
  414. //----------------------------------------------
  415. destFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini';
  416. if not FileExists (destFile) then
  417. begin
  418. page := CreateInputQueryPage(wpInstalling,
  419. 'PHP mail parameters', '',
  420. 'Please specify the SMTP server and the adresse mail to be used by PHP when using the function mail(). If you are not sure, just leave the default values.');
  421. page.Add('SMTP:', False);
  422. page.Add('Email:', False);
  423. // Valeurs par defaut
  424. page.Values[0] := 'localhost';
  425. page.Values[1] := 'you@yourdomain';
  426. SaveStringToFile(pathWithSlashes+'/mailtag','tag', False);
  427. end
  428. //----------------------------------------------
  429. // copie des dll de php vers apache
  430. //----------------------------------------------
  431. phpDllCopy := 'fdftk.dll';
  432. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  433. phpDllCopy := 'fribidi.dll';
  434. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  435. phpDllCopy := 'gds32.dll';
  436. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  437. phpDllCopy := 'libeay32.dll';
  438. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  439. phpDllCopy := 'libmhash.dll';
  440. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  441. phpDllCopy := 'libmysql.dll';
  442. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  443. phpDllCopy := 'msql.dll';
  444. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  445. phpDllCopy := 'libmysqli.dll';
  446. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  447. phpDllCopy := 'ntwdblib.dll';
  448. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  449. phpDllCopy := 'php5activescript.dll';
  450. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  451. phpDllCopy := 'php5isapi.dll';
  452. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  453. phpDllCopy := 'php5nsapi.dll';
  454. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  455. phpDllCopy := 'ssleay32.dll';
  456. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  457. phpDllCopy := 'yaz.dll';
  458. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  459. phpDllCopy := 'libmcrypt.dll';
  460. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  461. phpDllCopy := 'php5ts.dll';
  462. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  463. end;
  464. //-----------------------------------------------------------
  465. // gestion des fichiers php.ini
  466. procedure CurPageChanged(CurPageID: Integer);
  467. var destFile: String;
  468. var srcFile: String;
  469. var srcContents: String;
  470. begin
  471. if CurPageID = 14 then
  472. begin
  473. if FileExists (pathWithSlashes+'/mailtag') then
  474. begin
  475. smtp := page.Values[0];
  476. email := page.Values[1];
  477. DeleteFile(pathWithSlashes+'/mailtag');
  478. end
  479. destFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini';
  480. srcFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini.install';
  481. LoadStringFromFile (srcFile, srcContents);
  482. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  483. StringChange (srcContents, 'WAMPSMTP', smtp);
  484. StringChange (srcContents, 'WAMPEMAIL', email);
  485. //----------------------------------------------
  486. // fichier php.ini dans php
  487. //----------------------------------------------
  488. if not FileExists (destFile) then
  489. begin
  490. SaveStringToFile(destFile,srcContents, False);
  491. end
  492. //----------------------------------------------
  493. // fichier phpForApache.ini dans php
  494. //----------------------------------------------
  495. destFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/phpForApache.ini';
  496. if not FileExists (destFile) then
  497. begin
  498. SaveStringToFile(destFile,srcContents, False);
  499. end
  500. //----------------------------------------------
  501. // fichier php.ini dans apache
  502. //----------------------------------------------
  503. destFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/php.ini';
  504. if not FileExists (destFile) then
  505. begin
  506. SaveStringToFile(destFile,srcContents, False);
  507. end
  508. end
  509. DeleteFile(SrcFile);
  510. //MsgBox(tmp,mbConfirmation,MB_YESNO);
  511. end;
  512. //-----------------------------------------------
  513. //procedure lancée à la fin de l'installation, elle supprime les fichiers d'installation
  514. procedure DeinitializeSetup();
  515. begin
  516. DeleteFile(path+'\install_services.bat');
  517. DeleteFile(path+'\install_services_auto.bat');
  518. DeleteFile(path+'\expsound.bat');
  519. DeleteFile(path+'..\create_freepbx.bat');
  520. end;
  521. //-----------------------------------------------
  522. //procedure lancée au début de l'installation, elle alerte sur les upgrades de WampServer
  523. //function InitializeSetup(): Boolean;
  524. //begin
  525. // Result := MsgBox('Important Information:' #13#13 'Please do not try to upgrade from WAMP5 1.x.' #13 ' If you have WAMP5 1.x installed, save your data, uninstall WAMP5 ' #13 'and delete the wamp folder before installing this new release. ' #13#13 'Do you want to continue install?', mbConfirmation, MB_YESNO) = idYes;
  526. //end;
  527. // Function generated by ISTool.
  528. function NextButtonClick(CurPage: Integer): Boolean;
  529. begin
  530. Result := istool_download(CurPage);
  531. end;