; WinBinder setup configuration for Inno Setup [Files] Source: readme.txt; DestDir: {app}; Flags: ignoreversion isreadme Source: docs\*.*; DestDir: {app}\docs; Flags: ignoreversion; Excludes: copy of*.* Source: phpcode\*.*; DestDir: {app}\phpcode; Flags: recursesubdirs ignoreversion createallsubdirs; Excludes: copy of*.*,*.a,*.bak,*.dep,*.err,*.lib,*.lnk,*.o,*.obj,*.res,*.tws,*.xrf,tp*.bat; Components: WinBinder/Examples Source: csource\*.*; DestDir: {app}\csource; Flags: recursesubdirs ignoreversion createallsubdirs; Components: WinBinder/Source; Excludes: copy of*.*,*.a,*.bak,*.dep,*.err,*.lib,*.lnk,*.o,*.obj,*.res,*.tws,*.xrf,tp*.bat Source: tools\*.*; DestDir: {app}\tools; Flags: recursesubdirs ignoreversion; Components: WinBinder/Examples WinBinder/Source; Excludes: copy of*.*,wb_setup_log.txt,*.a,*.bak,*.dep,*.err,*.lib,*.lnk,*.o,*.obj,*.res,*.tws,*.xrf,tp*.bat Source: binaries\php4\*.*; DestDir: {app}\binaries\php4; Components: PHP/PHP_4; Excludes: copy of*.*,*.dll,*.a,*.bak,*.dep,*.err,*.lib,*.lnk,*.o,*.obj,*.res,*.tws,*.xrf,tp*.bat Source: binaries\php4\php4ts.dll; DestDir: {app}\binaries\php4; Components: PHP/PHP_4 Source: binaries\php4\ext\php_winbinder.dll; DestDir: {app}\binaries\php4\ext; Components: PHP/PHP_4 Source: binaries\php4\ext\php_sqlite.dll; DestDir: {app}\binaries\php4\ext; Components: PHP/PHP_4/AddLib4 Source: binaries\php4\ext\freeImage.dll; DestDir: {app}\binaries\php4\ext; Components: PHP/PHP_4/AddLib4 Source: binaries\php51\*.*; DestDir: {app}\binaries\php51; Components: PHP/PHP_5; Excludes: copy of*.*,*.exe,*.dll,*.a,*.bak,*.dep,*.err,*.lib,*.lnk,*.o,*.obj,*.res,*.tws,*.xrf,tp*.bat Source: binaries\php51\ext\php_winbinder.dll; DestDir: {app}\binaries\php51\ext; Components: PHP/PHP_5 Source: binaries\php51\ext\freeImage.dll; DestDir: {app}\binaries\php51\ext; Flags: external; Components: PHP/PHP_5 Source: compiler:..\..\Util\Info-zip\unzip.exe; DestDir: {tmp}; Components: PHP/PHP_5; AfterInstall: UnzipFiles('5') Source: compiler:\Download DLL\isxdl.dll; DestDir: {tmp}; Flags: dontcopy [Icons] Name: {group}\Welcome to WinBinder; Filename: {app}\binaries\php4\php-win.exe; Parameters: """{app}\phpcode\examples\welcome.phpw"""; Components: PHP/PHP_4; WorkingDir: {app}\phpcode\examples; IconFilename: {app}\phpcode\resources\hyper.ico Name: {group}\Welcome to WinBinder; Filename: {app}\binaries\php51\php-win.exe; Parameters: """{app}\phpcode\examples\welcome.phpw"""; Components: PHP/PHP_5 and not PHP/PHP_4; WorkingDir: {app}\phpcode\examples; IconFilename: {app}\phpcode\resources\hyper.ico Name: {group}\WinBinder Manual; Filename: {app}\docs\winbinder.chm Name: {group}\Readme; Filename: {app}\readme.txt Name: {group}\Uninstall; Filename: {uninstallexe} Name: {group}\Docs\License; Filename: {app}\docs\license.txt Name: {group}\Docs\Release notes; Filename: {app}\docs\release_notes.txt Name: {group}\Docs\Changelog; Filename: {app}\docs\changelog.txt Name: {userdesktop}\Welcome to WinBinder; Filename: {app}\binaries\php4\php-win.exe; Parameters: """{app}\phpcode\examples\welcome.phpw"""; Components: PHP/PHP_4; WorkingDir: {app}\phpcode\examples; IconFilename: {app}\phpcode\resources\hyper.ico Name: {userdesktop}\Welcome to WinBinder; Filename: {app}\binaries\php51\php-win.exe; Parameters: """{app}\phpcode\examples\welcome.phpw"""; Components: PHP/PHP_5 and not PHP/PHP_4; WorkingDir: {app}\phpcode\examples; IconFilename: {app}\phpcode\resources\hyper.ico [Setup] OutputDir=C:\@desenv\WinBinder\@Privado\Arquivo OutputBaseFilename=winbinder_setup VersionInfoCompany=Hypervisual VersionInfoDescription=WinBinder AppCopyright=Copyright © 2004-2005 Hypervisual - see LICENSE.TXT for details AppName=WinBinder LicenseFile=C:\@desenv\WinBinder\docs\license.txt RestartIfNeededByRun=false DefaultGroupName=WinBinder ShowLanguageDialog=no DefaultDirName={sd}\WinBinder MinVersion=4.1.1998,5.0.2195 UsePreviousAppDir=true UninstallDisplayName= AppComments= AppID={{EF0FB390-6815-4BC3-A070-C7525D5625C4} UninstallFilesDir={app}\uninstall AppMutex=winbinder-app EnableDirDoesntExistWarning=false FlatComponentsList=false DisableStartupPrompt=false AlwaysShowComponentsList=true DirExistsWarning=auto ChangesAssociations=true MergeDuplicateFiles=false SourceDir=C:\@desenv\WinBinder UseSetupLdr=true AppVerName=WinBinder version 0.44.171 VersionInfoVersion=0.44.171 SolidCompression=true Compression=lzma/max InternalCompressLevel=normal AppPublisher=Hypervisual AppPublisherURL=http://hypervisual.com/ AppSupportURL=http://hypervisual.com/winbinder/ AppUpdatesURL=http://hypervisual.com/winbinder/ [Run] Filename: {app}\binaries\PHP4\php-win.exe; Parameters: """{app}\phpcode\examples\welcome.phpw"""; Flags: nowait postinstall; Description: Run Welcome application; WorkingDir: {app}\phpcode; Components: PHP/PHP_4 Filename: {app}\binaries\PHP51\php-win.exe; Components: PHP/PHP_5 and not PHP/PHP_4; Parameters: """{app}\phpcode\examples\welcome.phpw"""; Flags: nowait postinstall; Description: Run Welcome application; WorkingDir: {app}\phpcode [Components] Name: WinBinder; Description: WinBinder; Types: Complete Default Update_WB Name: WinBinder/Examples; Description: Help and examples; Types: Complete Default Update_WB Name: WinBinder/Source; Description: C source code and tools; Types: Complete Default Update_WB Name: PHP; Description: PHP; Types: Complete Default Update_PHP Name: PHP/PHP_4; Description: PHP 4; Types: Complete Default Update_PHP Name: PHP/PHP_4/AddLib4; Description: Additional libraries (SQLite, FreeImage); Types: Complete Default Update_PHP Name: PHP/PHP_5; Description: PHP 5 (download); ExtraDiskSpaceRequired: 3600000; Types: Complete Update_PHP Name: PHP/PHP_5/AddLib5; Description: Additional libraries (MySQL, FreeImage); Types: Complete Update_PHP [Types] Name: Default; Description: Default installation Name: Update_WB; Description: Update an existing WinBinder installation Name: Update_PHP; Description: Update PHP version only Name: Complete; Description: Complete installation Name: Custom_install; Description: Custom; Flags: iscustom [Registry] Root: HKCR; SubKey: .phpw; ValueType: string; ValueData: WinBinder script; Flags: uninsdeletekey Root: HKCR; SubKey: WinBinder script file; ValueType: string; ValueData: WinBinder script; Flags: uninsdeletekey Root: HKCR; SubKey: WinBinder script\Shell\Open\Command; ValueType: string; ValueData: """{app}\binaries\php4\php-win.exe"" ""%1"""; Flags: uninsdeletevalue; Components: PHP/PHP_4 Root: HKCR; Subkey: WinBinder script\DefaultIcon; ValueType: string; ValueData: {app}\binaries\php4\php-win.exe,0; Flags: uninsdeletevalue; Components: PHP/PHP_4 Root: HKCR; SubKey: WinBinder script\Shell\Open\Command; ValueType: string; ValueData: """{app}\binaries\php51\php-win.exe"" ""%1"""; Flags: uninsdeletevalue; Components: PHP/PHP_5 Root: HKCR; Subkey: WinBinder script\DefaultIcon; ValueType: string; ValueData: {app}\binaries\php51\php-win.exe,0; Flags: uninsdeletevalue; Components: PHP/PHP_5 Root: HKCU; Subkey: Software\WinBinder; ValueType: string; ValueName: InstallDir; ValueData: {app}; Flags: uninsdeletekeyifempty uninsdeletevalue [LangOptions] DialogFontName=Tahoma DialogFontSize=8 [Tasks] [INI] ;Filename: {app}\binaries\PHP4\php.ini; Section: PHP; Key: extension; String: php_sqlite.dll; Components: PHP/PHP_4/AddLib4 ;Filename: {app}\binaries\PHP51\php.ini; Section: PHP; Key: extension; String: php_mysql.dll; Components: PHP/PHP_5/AddLib5 [UninstallDelete] Name: {app}\binaries; Type: filesandordirs; Components: [_ISTool] LogFile=C:\@desenv\WinBinder\tools\inno_setup\wb_setup_log.txt LogFileAppend=false [Code] // Isxdl functions (from isxdl.iss) function isxdl_Download(hWnd: Integer; URL, Filename: PChar): Integer; external 'isxdl_Download@files:isxdl.dll stdcall'; procedure isxdl_AddFile(URL, Filename: PChar); external 'isxdl_AddFile@files:isxdl.dll stdcall'; procedure isxdl_AddFileSize(URL, Filename: PChar; Size: Cardinal); external 'isxdl_AddFileSize@files:isxdl.dll stdcall'; function isxdl_DownloadFiles(hWnd: Integer): Integer; external 'isxdl_DownloadFiles@files:isxdl.dll stdcall'; procedure isxdl_ClearFiles; external 'isxdl_ClearFiles@files:isxdl.dll stdcall'; function isxdl_IsConnected: Integer; external 'isxdl_IsConnected@files:isxdl.dll stdcall'; function isxdl_SetOption(Option, Value: PChar): Integer; external 'isxdl_SetOption@files:isxdl.dll stdcall'; function isxdl_GetFileName(URL: PChar): PChar; external 'isxdl_GetFileName@files:isxdl.dll stdcall'; // Constants and global variables const php5file = 'php5_minimal.zip'; php5exts = 'php5_libs.zip'; var ServerPage: TInputOptionWizardPage; nCode: Integer; unzippgm: String; cmd: String; ServerURL: String; CRLF: String; // Unzip files procedure GoUnzip(source: String; targetdir: String); begin source := ExpandConstant('{tmp}\' + source); if not FileExists(unzippgm) then MsgBox('Could not find file ' + unzippgm, mbError, MB_OK) else if not FileExists(source) then MsgBox('Could not find file ' + source, mbError, MB_OK) else begin cmd := '-o -qq "' + source + '" -d "' + targetdir + '"'; if Exec(unzippgm, cmd, '', SW_HIDE, ewWaitUntilIdle, nCode) = false then begin MsgBox('Could not run', mbError, MB_OK); end; end; end; procedure UnzipFiles(Ver: String); var sComp: String; begin sComp := WizardSelectedComponents(false); unzippgm := ExpandConstant('{tmp}\unzip.exe'); if Pos('php_5', sComp) > 0 then GoUnzip(php5file, ExpandConstant('{app}\binaries\php51')); if Pos('addlib5', sComp) > 0 then GoUnzip(php5exts, ExpandConstant('{app}\binaries\php51\ext')); end; // Build server selection page procedure BuildSelectionPage(); begin // Create the page ServerPage := CreateInputOptionPage(wpSelectComponents, 'Setup - WinBinder', 'Select a server to download the additional files you requested.', 'Choose one of the options below:', True, True); // Add items ServerPage.Add('Voxel (USA)'); ServerPage.Add('Internap (USA)'); ServerPage.Add('DreamHost (USA)'); ServerPage.Add('Mesh Solutions (Germany)'); ServerPage.Add('OVH (France)'); ServerPage.Add('HEAnet (Ireland)'); ServerPage.Add('University of Kent (Ireland)'); ServerPage.Add('BelNet (Switzerland)'); ServerPage.Add('Puzzle (Switzerland)'); ServerPage.Add('OptusNet (Australia)'); // Set initial values ServerPage.SelectedValueIndex := 0; end; procedure GetSelectedServer(); begin // Read values into variables case ServerPage.SelectedValueIndex of 0: ServerURL := 'voxel'; 1: ServerURL := 'internap'; 2: ServerURL := 'http://hypervisual.com/winbinder/files/'; 3: ServerURL := 'mesh'; 4: ServerURL := 'ovh'; 5: ServerURL := 'heanet'; 6: ServerURL := 'kent'; 7: ServerURL := 'belnet'; 8: ServerURL := 'puzzle'; 9: ServerURL := 'optusnet'; end; if(Pos('http://', ServerURL) = 0) then begin ServerURL := 'http://' + ServerURL + '.dl.sourceforge.net/sourceforge/winbinder/'; end; end; // Download files function NextButtonClick(CurPage: Integer): Boolean; var hWnd: Integer; sComp: String; sFileName: String; begin Result := true; hWnd := StrToInt(ExpandConstant('{wizardhwnd}')); sComp := WizardSelectedComponents(false); isxdl_ClearFiles; // Builds the server selection page if CurPage = wpSelectComponents then begin if (Pos('php_5', sComp) > 0) or (Pos('addlib_5', sComp) > 0) then begin BuildSelectionPage(); end; end; if CurPage = wpReady then begin if (Pos('php_5', sComp) > 0) or (Pos('addlib_5', sComp) > 0) then begin GetSelectedServer(); isxdl_SetOption('description', 'Server: ' + ServerURL + CRLF + 'Please wait, downloading...'); end; if Pos('php_5', sComp) > 0 then begin sFileName := ExpandConstant('{tmp}\' + php5file); isxdl_AddFile(ServerURL + php5file, sFileName); end; if Pos('addlib5', sComp) > 0 then begin sFileName := ExpandConstant('{tmp}\' + php5exts); isxdl_AddFile(ServerURL + php5exts, sFileName); // The code below avoids including files twice in the setup ExtractTemporaryFile('FreeImage.dll'); end; if False then begin // For debugging set to True; For release set to False FileCopy('C:\@download\php5_minimal.zip', ExpandConstant('{tmp}\php5_minimal.zip'), False); FileCopy('C:\@download\php5_libs.zip', ExpandConstant('{tmp}\php5_libs.zip'), False); end else begin if isxdl_DownloadFiles(hWnd) = 0 then begin MsgBox('Download failed. Please review your setup options or try again later.', mbError, MB_OK); Result := false; end; end; end; end; function InitializeSetup: Boolean; begin CRLF := Chr(13) + Chr(10); isxdl_SetOption('title','Setup - WinBinder'); isxdl_SetOption('label','Download PHP runtime files'); isxdl_SetOption('resume','true'); Result := true; end;