freeswitch_fusionpbx.iss 30 KB

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