freeswitch_freepbx.iss 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  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 16456
  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_freepbx
  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: freepbx.ico; DestDir: {app}; Components: FreePBX_WAMP
  39. Source: expsound.bat; DestDir: {app}; Components: FreeSWITCH
  40. Source: FreePBX.url; DestDir: {app}; Components: FreePBX_WAMP
  41. Source: create_freepbx.sql; DestDir: {app}; Components: FreePBX_WAMP
  42. Source: create_freepbx.bat; DestDir: {app}; Components: FreePBX_WAMP
  43. ; 32 bit release
  44. Source: {#FreeSWITCH_32bit}\*.exe; DestDir: {app}; Flags: ignoreversion onlyifdoesntexist 32bit; Components: FreeSWITCH; Check: not Is64BitInstallMode
  45. Source: {#FreeSWITCH_32bit}\*.dll; DestDir: {app}; Flags: ignoreversion onlyifdoesntexist 32bit; Components: FreeSWITCH; Check: not Is64BitInstallMode
  46. Source: {#FreeSWITCH_32bit}\*.lib; DestDir: {app}; Flags: ignoreversion onlyifdoesntexist 32bit; Components: FreeSWITCH; Check: not Is64BitInstallMode
  47. Source: {#FreeSWITCH_32bit}\mod\*; DestDir: {app}\mod; Flags: ignoreversion onlyifdoesntexist 32bit; Components: FreeSWITCH; Check: not Is64BitInstallMode
  48. Source: ..\..\..\Release_CLR\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist 32bit; Components: FreeSWITCH; Check: not Is64BitInstallMode
  49. ; 64 bit release
  50. Source: {#FreeSWITCH_64bit}\*.exe; DestDir: {app}; Flags: ignoreversion onlyifdoesntexist 64bit; Components: FreeSWITCH; Check: Is64BitInstallMode
  51. Source: {#FreeSWITCH_64bit}\*.dll; DestDir: {app}; Flags: ignoreversion onlyifdoesntexist 64bit; Components: FreeSWITCH; Check: Is64BitInstallMode
  52. Source: {#FreeSWITCH_64bit}\*.lib; DestDir: {app}; Flags: ignoreversion onlyifdoesntexist 64bit; Components: FreeSWITCH; Check: Is64BitInstallMode
  53. Source: {#FreeSWITCH_64bit}\mod\*; DestDir: {app}\mod; Flags: ignoreversion onlyifdoesntexist 64bit; Components: FreeSWITCH; Check: Is64BitInstallMode
  54. Source: ..\..\..\x64\Release_CLR\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist 64bit; Components: FreeSWITCH; Check: Is64BitInstallMode
  55. ; shared by 32 and 64 bit install
  56. Source: {#FreeSWITCH_32bit}\conf\*; DestDir: {app}\conf; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist; Components: FreeSWITCH
  57. Source: ..\..\..\contrib\jmesquita\fsgui\bin\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs onlyifdoesntexist; Components: fsgui
  58. ; WAMP
  59. Source: G:\wamp_source\close\*.*; DestDir: {app}\wamp\; Flags: ignoreversion recursesubdirs; AfterInstall: close(); Components: FreePBX_WAMP; Tasks:
  60. Source: G:\wamp_source\wamp\*.*; DestDir: {app}\wamp\; Flags: ignoreversion recursesubdirs onlyifdoesntexist; Components: FreePBX_WAMP
  61. Source: G:\wamp_source\wamp\license.txt; DestDir: {app}\wamp\; AfterInstall: install_pbx(); Components: FreePBX_WAMP
  62. Source: {#FreeSWITCH_32bit}\php_ESL.dll; DestDir: {app}\wamp\bin\php\php5.3.0\ext; Flags: ignoreversion recursesubdirs; Components: FreePBX_WAMP
  63. ; FreePBX w/ svn folders
  64. Source: G:\freepbx-v3-dev\*; DestDir: {app}\wamp\www\freepbx-v3; Flags: ignoreversion recursesubdirs onlyifdoesntexist createallsubdirs; Components: FreePBX_WAMP
  65. Source: G:\freepbx-v3-dev\INSTALL.TXT; DestDir: {app}\wamp\www\freepbx-v3; AfterInstall: fix_freepbx_paths(); Components: FreePBX_WAMP
  66. ; These two files are required for TLS/SSL support
  67. ; 32 bit version
  68. Source: C:\OpenSSL\libeay32.dll; DestDir: {app}; Check: not Is64BitInstallMode; Flags: 32bit
  69. Source: C:\OpenSSL\ssleay32.dll; DestDir: {app}; Check: not Is64BitInstallMode; Flags: 32bit
  70. ; 64 bit version
  71. Source: C:\OpenSSL64\libeay32.dll; DestDir: {app}; Check: Is64BitInstallMode; Flags: 64bit
  72. Source: C:\OpenSSL64\ssleay32.dll; DestDir: {app}; Check: Is64BitInstallMode; Flags: 64bit
  73. [Dirs]
  74. Name: {app}\log
  75. Name: {app}\db
  76. Name: {app}\scripts
  77. Name: {app}\htdocs
  78. Name: {app}\grammar
  79. Name: {app}\backup
  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}\FreePBX.url; Filename: {app}\FreePBX.url; Tasks: desktopicon; Components: FreePBX_WAMP; IconFilename: {app}\freepbx.ico; IconIndex: 0
  87. Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\FreePBX.url; Filename: {app}\FreePBX.url; Tasks: quicklaunchicon; Components: FreePBX_WAMP; IconFilename: {app}\freepbx.ico; IconIndex: 0
  88. Name: {group}\start WampServer; Filename: {app}\wamp\wampmanager.exe; WorkingDir: {app}\wamp; Components: FreePBX_WAMP; Flags: runminimized
  89. Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\WampServer; Filename: {app}\wamp\wampmanager.exe; Tasks: quicklaunchicon; Components: FreePBX_WAMP
  90. Name: {commondesktop}\WampServer; Filename: {app}\wamp\wampmanager.exe; Tasks: desktopicon; Components: FreePBX_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: FreePBX_WAMP; Flags: runhidden
  95. Filename: {app}\wamp\install_services.bat; Components: FreePBX_WAMP; Flags: runhidden
  96. Filename: {app}\wamp\wampmanager.exe; Description: Launch WampServer 2 now; Components: FreePBX_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_freepbx.bat; Description: Create FreePBX MySQL user; Flags: runhidden; Components: FreePBX_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: FreePBX_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 sound_files_16khz sound_files_32khz sound_files_48khz
  132. [Components]
  133. Name: FreeSWITCH; Description: FreeSWITCH core components; Flags: fixed; Types: custom compact full; Languages:
  134. Name: FreePBX_WAMP; Description: FreePBX 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. procedure fix_freepbx_paths();
  160. var srcFile: String;
  161. var destFile: String;
  162. var srcContents: String;
  163. var fspath: String;
  164. var fspathWithSlashes: String;
  165. begin
  166. fspath := ExpandConstant('{app}');
  167. fspathWithSlashes := fspath;
  168. StringChange (fspathWithSlashes, '\','/');
  169. destFile := fspathWithSlashes+'/wamp/www/freepbx-v3/modules/freeswitch/config/freeswitch.php';
  170. //destFile := fspathWithSlashes+'/wamp/www/freepbx-v3/freepbx/config/telephony.php';
  171. //srcFile := fspathWithSlashes+'/wamp/www/freepbx-v3/freepbx/config/telephony.php.install';
  172. //if not FileExists (destFile) then
  173. //begin
  174. LoadStringFromFile (destFile, srcContents);
  175. StringChange (srcContents, '/opt/freeswitch', fspathWithSlashes);
  176. StringChange (srcContents, '/usr/local/freeswitch', fspathWithSlashes);
  177. SaveStringToFile(destFile,srcContents, False);
  178. //end
  179. //DeleteFile(SrcFile);
  180. end;
  181. //-----------------------------------------------
  182. //procedure qui ferme les eteind les services et ferme wampmanager.exe (si ils existent)
  183. procedure close();
  184. var batFile: String;
  185. var myResult: Integer;
  186. begin
  187. path := ExpandConstant('{app}') + '\wamp';
  188. batFile := path+'\closewamp.bat';
  189. Exec(batFile, '',path+'\', SW_HIDE, ewWaitUntilTerminated, myResult);
  190. end;
  191. //----------------------------------------------
  192. //procedure qui adapte WAMP aux choix effectués lors de l'installation
  193. procedure install_pbx();
  194. var srcFile: String;
  195. var destFile: String;
  196. var srcContents: String;
  197. var browser: String;
  198. var winPath: String;
  199. var mysqlVersion: String;
  200. var wampserverVersion: String;
  201. var phpmyadminVersion: String;
  202. //var sqlitemanagerVersion: String;
  203. var tmp: String;
  204. var phpDllCopy: String;
  205. begin
  206. //version des applis, à modifier pour chaque version de WampServer 2
  207. apacheVersion := '2.2.11';
  208. phpVersion := '5.3.0' ;
  209. mysqlVersion := '5.1.36';
  210. wampserverVersion := '2.0';
  211. phpmyadminVersion := '3.2.0.1';
  212. //sqlitemanagerVersion := '1.2.0';
  213. path := ExpandConstant('{app}') + '\wamp';
  214. winPath := ExpandConstant('{win}');
  215. pathWithSlashes := path;
  216. StringChange (pathWithSlashes, '\','/');
  217. //----------------------------------------------
  218. // renommage du fichier c:/windows/php.ini
  219. //----------------------------------------------
  220. if FileExists ('c:/windows/php.ini') then
  221. begin
  222. 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
  223. begin
  224. RenameFile('c:/windows/php.ini','c:/windows/php_old.ini');
  225. end
  226. end
  227. //----------------------------------------------
  228. // Fichier install_services.bat
  229. //----------------------------------------------
  230. destFile := pathWithSlashes+'/install_services.bat';
  231. srcFile := pathWithSlashes+'/install_services.bat.install';
  232. if not FileExists (pathWithSlashes+'/wampmanager.conf') then
  233. begin
  234. LoadStringFromFile (srcFile, srcContents);
  235. //version de apache et mysql
  236. StringChange (srcContents, 'WAMPMYSQLVERSION', mysqlVersion);
  237. StringChange (srcContents, 'WAMPAPACHEVERSION', apacheVersion);
  238. SaveStringToFile(destFile,srcContents, False);
  239. end
  240. else
  241. begin
  242. //dans le cas d'une upgrade on détruit le fichier pour qu'il ne soit pas executé
  243. DeleteFile(destFile);
  244. end
  245. DeleteFile(SrcFile);
  246. //----------------------------------------------
  247. // Fichier install_services_auto.bat
  248. //----------------------------------------------
  249. destFile := pathWithSlashes+'/install_services_auto.bat';
  250. srcFile := pathWithSlashes+'/install_services_auto.bat.install';
  251. if not FileExists (pathWithSlashes+'/wampmanager.conf') then
  252. begin
  253. LoadStringFromFile (srcFile, srcContents);
  254. //version de apache et mysql
  255. StringChange (srcContents, 'WAMPMYSQLVERSION', mysqlVersion);
  256. StringChange (srcContents, 'WAMPAPACHEVERSION', apacheVersion);
  257. SaveStringToFile(destFile,srcContents, False);
  258. end
  259. else
  260. begin
  261. //dans le cas d'une upgrade on détruit le fichier pour qu'il ne soit pas executé
  262. DeleteFile(destFile);
  263. end
  264. DeleteFile(SrcFile);
  265. //----------------------------------------------
  266. // Fichier uninstall_services_auto.bat
  267. //----------------------------------------------
  268. destFile := pathWithSlashes+'/uninstall_services.bat';
  269. srcFile := pathWithSlashes+'/uninstall_services.bat.install';
  270. if not FileExists (pathWithSlashes+'/wampmanager.conf') then
  271. begin
  272. LoadStringFromFile (srcFile, srcContents);
  273. //version de apache et mysql
  274. StringChange (srcContents, 'WAMPMYSQLVERSION', mysqlVersion);
  275. StringChange (srcContents, 'WAMPAPACHEVERSION', apacheVersion);
  276. SaveStringToFile(destFile,srcContents, False);
  277. end
  278. else
  279. begin
  280. //dans le cas d'une upgrade on détruit le fichier pour qu'il ne soit pas executé
  281. DeleteFile(destFile);
  282. end
  283. DeleteFile(SrcFile);
  284. //----------------------------------------------
  285. // Fichier wampmanager.conf
  286. //----------------------------------------------
  287. destFile := pathWithSlashes+'/wampmanager.conf';
  288. srcFile := pathWithSlashes+'/wampmanager.conf.install';
  289. if not FileExists (destFile) then
  290. begin
  291. LoadStringFromFile (srcFile, srcContents);
  292. //installDir et versions
  293. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  294. StringChange (srcContents, 'WAMPSERVERVERSION', wampserverVersion);
  295. StringChange (srcContents, 'WAMPPHPVERSION', phpVersion);
  296. StringChange (srcContents, 'WAMPMYSQLVERSION', mysqlVersion);
  297. StringChange (srcContents, 'WAMPAPACHEVERSION', apacheVersion);
  298. StringChange (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion);
  299. // StringChange (srcContents, 'WAMPSQLITEMANAGERVERSION', sqlitemanagerVersion);
  300. //navigateur
  301. browser := 'explorer.exe';
  302. if FileExists ('C:/Program Files/Mozilla Firefox/firefox.exe') then
  303. begin
  304. 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
  305. begin
  306. browser := 'C:/Program Files/Mozilla Firefox/firefox.exe';
  307. end
  308. end
  309. if browser = 'explorer.exe' then
  310. begin
  311. GetOpenFileName('Please choose your default browser. If you are not sure, just click Open :', browser, winPath,'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe');
  312. end
  313. StringChange (srcContents, 'WAMPBROWSER', browser);
  314. SaveStringToFile(destFile,srcContents, False);
  315. end
  316. else
  317. begin
  318. // changement de wampserverVersion et WampserverVersion pour les upgrades
  319. end
  320. DeleteFile(SrcFile);
  321. //----------------------------------------------
  322. // Fichier wampmanager.ini
  323. //----------------------------------------------
  324. destFile := pathWithSlashes+'/wampmanager.ini';
  325. srcFile := pathWithSlashes+'/wampmanager.ini.install';
  326. if not FileExists (destFile) then
  327. begin
  328. LoadStringFromFile (srcFile, srcContents);
  329. //installDir et versions
  330. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  331. StringChange (srcContents, 'WAMPPHPVERSION', phpVersion);
  332. SaveStringToFile(destFile,srcContents, False);
  333. end
  334. DeleteFile(SrcFile);
  335. //----------------------------------------------
  336. // Fichier wampmanager.tpl
  337. //----------------------------------------------
  338. destFile := pathWithSlashes+'/wampmanager.tpl';
  339. srcFile := pathWithSlashes+'/wampmanager.tpl.install';
  340. if not FileExists (destFile) then
  341. begin
  342. LoadStringFromFile (srcFile, srcContents);
  343. SaveStringToFile(destFile,srcContents, False);
  344. end
  345. DeleteFile(SrcFile);
  346. //----------------------------------------------
  347. // Fichier alias phpmyadmin
  348. //----------------------------------------------
  349. destFile := pathWithSlashes+'/alias/phpmyadmin.conf';
  350. srcFile := pathWithSlashes+'/alias/phpmyadmin.conf.install';
  351. if not FileExists (destFile) then
  352. begin
  353. LoadStringFromFile (srcFile, srcContents);
  354. //installDir et version de phpmyadmin
  355. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  356. StringChange (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion);
  357. SaveStringToFile(destFile,srcContents, False);
  358. end
  359. else
  360. begin
  361. LoadStringFromFile (srcFile, srcContents);
  362. //installDir et version de phpmyadmin
  363. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  364. StringChange (srcContents, 'WAMPPHPMYADMINVERSION', phpmyadminVersion);
  365. SaveStringToFile(destFile,srcContents, False);
  366. //mise à jour de la version de phpmyadmin
  367. tmp := GetIniString('apps','phpmyadminVersion',phpmyadminVersion,pathWithSlashes+'/wampmanager.conf');
  368. if not CompareText(tmp,phpmyadminVersion) = 0 then
  369. begin
  370. SetIniString('apps','phpmyadminVersion',phpmyadminVersion,pathWithSlashes+'/wampmanager.conf');
  371. LoadStringFromFile (destFile, srcContents);
  372. StringChange (srcContents, tmp, phpmyadminVersion);
  373. SaveStringToFile(destFile,srcContents, False);
  374. end
  375. end
  376. DeleteFile(SrcFile);
  377. //----------------------------------------------
  378. // Fichier de configuration de phpmyadmin
  379. //----------------------------------------------
  380. destFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php';
  381. srcFile := pathWithSlashes+'/apps/phpmyadmin'+phpmyadminVersion+'/config.inc.php.install';
  382. if not FileExists (destFile) then
  383. begin
  384. // si un fichier existe pour une version precedente de phpmyadmin, on le recupere
  385. if FileExists (pathWithSlashes+'/apps/phpmyadmin'+tmp+'/config.inc.php') then
  386. begin
  387. LoadStringFromFile (pathWithSlashes+'/apps/phpmyadmin'+tmp+'/config.inc.php', srcContents);
  388. SaveStringToFile(destFile,srcContents, False);
  389. end
  390. else
  391. begin
  392. // sinon on prends le fichier par defaut
  393. LoadStringFromFile (srcFile, srcContents);
  394. SaveStringToFile(destFile,srcContents, False);
  395. end
  396. end
  397. DeleteFile(SrcFile);
  398. //----------------------------------------------
  399. // Fichier httpd.conf
  400. //----------------------------------------------
  401. destFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/conf/httpd.conf';
  402. srcFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/conf/httpd.conf.install';
  403. if not FileExists (destFile) then
  404. begin
  405. LoadStringFromFile (srcFile, srcContents);
  406. //installDir et version de php
  407. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  408. StringChange (srcContents, 'WAMPPHPVERSION', phpVersion);
  409. SaveStringToFile(destFile,srcContents, False);
  410. end
  411. DeleteFile(SrcFile);
  412. //----------------------------------------------
  413. // Fichier my.ini
  414. //----------------------------------------------
  415. destFile := pathWithSlashes+'/bin/mysql/mysql'+mysqlVersion+'/my.ini';
  416. srcFile := pathWithSlashes+'/bin/mysql/mysql'+mysqlVersion+'/my.ini.install';
  417. if not FileExists (destFile) then
  418. begin
  419. LoadStringFromFile (srcFile, srcContents);
  420. //installDir et version de php
  421. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  422. SaveStringToFile(destFile,srcContents, False);
  423. end
  424. DeleteFile(SrcFile);
  425. //----------------------------------------------
  426. // Fichier index.php
  427. //----------------------------------------------
  428. destFile := pathWithSlashes+'/www/index.php';
  429. srcFile := pathWithSlashes+'/www/index.php.install';
  430. if not FileExists (destFile) then
  431. begin
  432. LoadStringFromFile (srcFile, srcContents);
  433. SaveStringToFile(destFile,srcContents, False);
  434. end
  435. else
  436. begin
  437. if MsgBox('Would you like to install the new WampServer 2 homepage? (this will overwrite exisiting index.php file)',mbConfirmation,MB_YESNO) = IDYES then
  438. begin
  439. DeleteFile (destFile);
  440. LoadStringFromFile (srcFile, srcContents);
  441. SaveStringToFile(destFile,srcContents, False);
  442. end
  443. end
  444. DeleteFile(SrcFile);
  445. //----------------------------------------------
  446. // Fichier php.ini
  447. //----------------------------------------------
  448. destFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini';
  449. if not FileExists (destFile) then
  450. begin
  451. page := CreateInputQueryPage(wpInstalling,
  452. 'PHP mail parameters', '',
  453. '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.');
  454. page.Add('SMTP:', False);
  455. page.Add('Email:', False);
  456. // Valeurs par defaut
  457. page.Values[0] := 'localhost';
  458. page.Values[1] := 'you@yourdomain';
  459. SaveStringToFile(pathWithSlashes+'/mailtag','tag', False);
  460. end
  461. //----------------------------------------------
  462. // copie des dll de php vers apache
  463. //----------------------------------------------
  464. phpDllCopy := 'fdftk.dll';
  465. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  466. phpDllCopy := 'fribidi.dll';
  467. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  468. phpDllCopy := 'gds32.dll';
  469. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  470. phpDllCopy := 'libeay32.dll';
  471. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  472. phpDllCopy := 'libmhash.dll';
  473. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  474. phpDllCopy := 'libmysql.dll';
  475. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  476. phpDllCopy := 'msql.dll';
  477. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  478. phpDllCopy := 'libmysqli.dll';
  479. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  480. phpDllCopy := 'ntwdblib.dll';
  481. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  482. phpDllCopy := 'php5activescript.dll';
  483. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  484. phpDllCopy := 'php5isapi.dll';
  485. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  486. phpDllCopy := 'php5nsapi.dll';
  487. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  488. phpDllCopy := 'ssleay32.dll';
  489. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  490. phpDllCopy := 'yaz.dll';
  491. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  492. phpDllCopy := 'libmcrypt.dll';
  493. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  494. phpDllCopy := 'php5ts.dll';
  495. filecopy (pathWithSlashes+'/bin/php/php'+phpVersion+'/'+phpDllCopy, pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/'+phpDllCopy, False);
  496. end;
  497. //-----------------------------------------------------------
  498. // gestion des fichiers php.ini
  499. procedure CurPageChanged(CurPageID: Integer);
  500. var destFile: String;
  501. var srcFile: String;
  502. var srcContents: String;
  503. begin
  504. if CurPageID = 14 then
  505. begin
  506. if FileExists (pathWithSlashes+'/mailtag') then
  507. begin
  508. smtp := page.Values[0];
  509. email := page.Values[1];
  510. DeleteFile(pathWithSlashes+'/mailtag');
  511. end
  512. destFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini';
  513. srcFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/php.ini.install';
  514. LoadStringFromFile (srcFile, srcContents);
  515. StringChange (srcContents, 'WAMPROOT', pathWithSlashes);
  516. StringChange (srcContents, 'WAMPSMTP', smtp);
  517. StringChange (srcContents, 'WAMPEMAIL', email);
  518. //----------------------------------------------
  519. // fichier php.ini dans php
  520. //----------------------------------------------
  521. if not FileExists (destFile) then
  522. begin
  523. SaveStringToFile(destFile,srcContents, False);
  524. end
  525. //----------------------------------------------
  526. // fichier phpForApache.ini dans php
  527. //----------------------------------------------
  528. destFile := pathWithSlashes+'/bin/php/php'+phpVersion+'/phpForApache.ini';
  529. if not FileExists (destFile) then
  530. begin
  531. SaveStringToFile(destFile,srcContents, False);
  532. end
  533. //----------------------------------------------
  534. // fichier php.ini dans apache
  535. //----------------------------------------------
  536. destFile := pathWithSlashes+'/bin/apache/apache'+apacheVersion+'/bin/php.ini';
  537. if not FileExists (destFile) then
  538. begin
  539. SaveStringToFile(destFile,srcContents, False);
  540. end
  541. end
  542. DeleteFile(SrcFile);
  543. //MsgBox(tmp,mbConfirmation,MB_YESNO);
  544. end;
  545. //-----------------------------------------------
  546. //procedure lancée à la fin de l'installation, elle supprime les fichiers d'installation
  547. procedure DeinitializeSetup();
  548. begin
  549. DeleteFile(path+'\install_services.bat');
  550. DeleteFile(path+'\install_services_auto.bat');
  551. DeleteFile(path+'\expsound.bat');
  552. DeleteFile(path+'..\create_freepbx.bat');
  553. end;
  554. //-----------------------------------------------
  555. //procedure lancée au début de l'installation, elle alerte sur les upgrades de WampServer
  556. //function InitializeSetup(): Boolean;
  557. //begin
  558. // 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;
  559. //end;
  560. // Function generated by ISTool.
  561. function NextButtonClick(CurPage: Integer): Boolean;
  562. begin
  563. Result := istool_download(CurPage);
  564. end;