Op deze website gebruiken we cookies om content en advertenties te personaliseren, om functies voor social media te bieden en om ons websiteverkeer te analyseren. Ook delen we informatie over uw gebruik van onze site met onze partners voor social media, adverteren en analyse. Deze partners kunnen deze gegevens combineren met andere informatie die u aan ze heeft verstrekt of die ze hebben verzameld op basis van uw gebruik van hun services. Meer informatie.

Akkoord

Vraag & Antwoord

Anders (software)

Inno Setup Compiler

Ik ben bezig met het maken van een setup met behulp van Inno Setup 5. Hierbij moet na de installatie van alle bestanden een aantal van hen worden aangepast voor de locatie waarop geïnstaleerd wordt. Mijn probleem is dat dit niet gebeurd. Dat terwijl ik de code van de source heb overgenomen van de software waar ik mijn software op baseer. [code:1:d87775f954][Files] Source: "D:\wampserver\{app}\Apache2\*.*"; DestDir: "{app}\Apache2"; Flags: ignoreversion recursesubdirs Source: "D:\wampserver\{app}\logs\*.*"; DestDir: "{app}\logs"; Flags: ignoreversion recursesubdirs Source: "D:\wampserver\{app}\mysql\*.*"; DestDir: "{app}\mysql"; Flags: ignoreversion recursesubdirs Source: "D:\wampserver\{app}\php\*.*"; DestDir: "{app}\php"; Flags: ignoreversion recursesubdirs Source: "D:\wampserver\{app}\scripts\*.*"; DestDir: "{app}\scripts"; Flags: ignoreversion recursesubdirs Source: "D:\wampserver\{app}\tmp\*.*"; DestDir: "{app}\tmp"; Flags: ignoreversion recursesubdirs Source: "D:\wampserver\{app}\www\*.*"; DestDir: "{app}\www"; Flags: ignoreversion recursesubdirs Source: "D:\wampserver\{app}\closewamp.bat"; DestDir: "{app}"; Flags: uninsneveruninstall ignoreversion Source: "D:\wampserver\{app}\add_console.install"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\barimage.bmp"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\images.bmp"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\install_mysql_service.bat"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\install_services.install"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\install_services_auto.install"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\launch_wampserver.bat"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\license.txt"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\mywampini10.patch"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\uninstall_services.bat"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\wamp5.chm"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\wampserver.exe"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\wampserver.ins"; DestDir: "{app}"; Flags: ignoreversion Source: "D:\wampserver\{app}\wampserver.ico"; DestDir: "{app}"; Flags: ignoreversion; AfterInstall: myinifiles('{app}')[/code:1:d87775f954]en dit stuk, dat begint met code tussen [ en ], maar dan protesteert phpbb, vandaar[code:1:d87775f954]procedure myinifiles(FileName: String); var dr: Boolean; var docroot : String; var DestFile: String; var SrcFile: String; var SrcContent: String; var DestFile2: String; var SrcFile2: String; var SrcContent2: String; var DestFile3: String; var SrcFile3: String; var SrcContent3: String; var Winpath: String; var DestFile4: String; var SrcFile4: String; var SrcContent4: String; var DestFile5: String; var SrcFile5: String; var SrcContent5: String; var DestFile6: String; var SrcFile6: String; var SrcContent6: String; var SrcFileaddcons : String; var SrcFile7 : String; var SrcContent7 : String; var indexfile: String; var indexfilenew: String; var Srcindex: String; var mywapini_patch_10: String; var phpdllcopy: String; var browser: String; begin Winpath := ExpandConstant('{win}'); docroot := FileName+'\www'; dr := BrowseForFolder('Please choose a directory for your DocumentRoot. If you are not sure, just leave the default directory :', docroot, True); if CompareText(docroot,FileName+'\www') = 0 then begin end else begin StringChange (docroot, '\','/'); end browser := 'explorer.exe'; dr := GetOpenFileName('Please choose your default browser. If you are not sure, just click Open :', browser, Winpath,'exe files (*.exe)|*.exe|All files (*.*)|*.*' ,'exe'); StringChange (docroot, '\','/'); StringChange (FileName, '\','/'); DestFile := FileName+'/apache2/conf/httpd.conf'; SrcFile := FileName+'/apache2/conf/install.conf'; LoadStringFromFile (SrcFile, SrcContent); StringChange (SrcContent, 'INSServerRoot','ServerRoot "'+FileName+'/apache2"'); StringChange (SrcContent, 'INSLoadModule','LoadModule php5_module "'+FileName+'/php/php5apache2.dll"'); StringChange (SrcContent, 'INSDocumentRoot','DocumentRoot "'+docroot+'"'); StringChange (SrcContent, 'INSStartDir','<Directory "'+docroot+'">'); StringChange (SrcContent, 'INSUserDir','UserDir "'+FileName+'/Apache2/users/"'); StringChange (SrcContent, 'INSAliasIcons','Alias /icons/ "'+FileName+'/Apache2/icons/"'); StringChange (SrcContent, 'INSDirIcons','<Directory "'+FileName+'/Apache2/icons">'); StringChange (SrcContent, 'INSAliasManual','Alias /manual/ "'+FileName+'/Apache2/htdocs/manual/"'); StringChange (SrcContent, 'INSDirManual','<Directory "'+FileName+'/Apache2/htdocs/manual">'); StringChange (SrcContent, 'INSScriptAlias',' ScriptAlias /cgi-bin/ "'+FileName+'/Apache2/cgi-bin/"'); StringChange (SrcContent, 'INSDirCgibin','<Directory "'+FileName+'/apache2/cgi-bin">'); StringChange (SrcContent, 'ROOTPATH', FileName); SaveStringToFile(DestFile,SrcContent, True); DeleteFile(SrcFile); DestFile2 := FileName+'/apache2/bin/php.ini'; SrcFile2 := FileName+'/apache2/bin/install.ini'; LoadStringFromFile (SrcFile2, SrcContent2); StringChange (SrcContent2, 'INSextension_dir','extension_dir = "'+FileName+'/php/ext/"'); StringChange (SrcContent2, 'INSsession','session.save_path = "'+FileName+'/tmp"'); StringChange (SrcContent2, 'INStmpdir','upload_tmp_dir = "'+FileName+'/tmp"'); StringChange (SrcContent2, 'INStmpeacdir','eaccelerator.cache_dir = "'+FileName+'/tmp/eaccelerator"'); StringChange (SrcContent2, 'INSlogfile','error_log = '+FileName+'/logs/php_error.log'); if not FileExists (DestFile2) then //begin //if MsgBox('File '+DestFile2+' already exists, do you want to overwrite it?',mbConfirmation,MB_YESNO) = IDYES then //begin //DeleteFile (DestFile2); //SaveStringToFile(DestFile2,SrcContent2, True); //DeleteFile(SrcFile2); //end //end //else begin SaveStringToFile(DestFile2,SrcContent2, True); DeleteFile(SrcFile2); end else begin LoadStringFromFile (DestFile2, SrcContent2); StringChange (SrcContent2, '"eaccelerator.dll"','eaccelerator.dll'); SaveStringToFile(DestFile2,SrcContent2, False); end DestFile3 := Filename+'/mysql/my.ini'; SrcFile3 := Filename+'/mysql/my.install'; LoadStringFromFile (SrcFile3, SrcContent3); StringChange (SrcContent3, 'INSbasdir','basedir='+FileName+'/mysql'); StringChange (SrcContent3, 'INSdatadir','datadir='+FileName+'/mysql/data'); StringChange (SrcContent3, 'INSlogfile','log-error='+FileName+'/logs/mysql_error.log'); //if not FileExists (DestFile3) then //begin //if MsgBox('File '+DestFile3+' already exists, do you want to overwrite it?',mbConfirmation,MB_YESNO) = IDYES then //begin //DeleteFile (DestFile3); //SaveStringToFile(DestFile3,SrcContent3, True); //DeleteFile(SrcFile3); //end //end //else //begin SaveStringToFile(DestFile3,SrcContent3, False); DeleteFile(SrcFile3); //end //refresh_php_ext.php script LoadStringFromFile (FileName+'/scripts/refresh_php_ext.php', SrcContent4); StringChange (SrcContent4, 'ROOTPATH', FileName); SaveStringToFile(FileName+'/scripts/refresh_php_ext.php',SrcContent4, False); //add_alias.php script LoadStringFromFile (FileName+'/scripts/add_alias.php', SrcContent4); StringChange (SrcContent4, 'ROOTPATH', FileName); SaveStringToFile(FileName+'/scripts/add_alias.php',SrcContent4, False); //delete_alias.php script LoadStringFromFile (FileName+'/scripts/delete_alias.php', SrcContent4); StringChange (SrcContent4, 'ROOTPATH', FileName); SaveStringToFile(FileName+'/scripts/delete_alias.php',SrcContent4, False); //wampserver.ini DestFile4 := FileName+'/wampserver.ini'; SrcFile4 := FileName+'/wampserver.ins'; SrcFileaddcons := FileName+'/add_console.install'; mywapini_patch_10 := FileName+'/mywampini10.patch'; begin LoadStringFromFile (SrcFile4, SrcContent4); StringChange (SrcContent4, 'INSwww','Type: item; Caption: "www directory"; Action: shellexecute; FileName: "'+docroot+'"; Glyph: 2'); StringChange (SrcContent4, 'explorer.exe',browser); StringChange (SrcContent4, 'INShttpd','Type: item; Caption: "httpd.conf"; Glyph: 6; Action: run; FileName: "notepad.exe"; parameters:"'+FileName+'/apache2/conf/httpd.conf"'); StringChange (SrcContent4, 'INSphpini','Type: item; Caption: "php.ini"; Glyph: 6; Action: run; FileName: "notepad.exe"; parameters: "'+FileName+'/apache2/bin/php.ini"'); StringChange (SrcContent4, 'INSmyini','Type: item; Caption: "my.ini"; Glyph: 6; Action: run; FileName: "notepad.exe"; parameters: "'+FileName+'/mysql/my.ini"'); StringChange (SrcContent4, 'INSai','Action: run; FileName: "'+FileName+'/Apache2/bin/Apache.exe"; Parameters: "-n wampapache -k install"; ShowCmd: hidden; Flags: waituntilterminated'); StringChange (SrcContent4, 'INSar','Action: run; FileName: "'+FileName+'/Apache2/bin/Apache.exe"; Parameters: "-n wampapache -k uninstall"; ShowCmd: hidden; Flags: waituntilterminated'); StringChange (SrcContent4, 'INSmi','Action: run; FileName: "'+FileName+'/install_mysql_service.bat"; Parameters: ""; ShowCmd: hidden; Flags: waituntilterminated'); StringChange (SrcContent4, 'INSmr','Action: run; FileName: "'+FileName+'/MySQL/bin/mysqld-nt.exe"; Parameters: "--remove wampmysqld"; ShowCmd: hidden; Flags: waituntilterminated'); StringChange (SrcContent4, 'INShelp','Type: item; Caption: "Help File"; Action: shellexecute; Filename: "'+FileName+'/wamp5.chm";'); StringChange (SrcContent4, 'INScons','Type: item; Caption: "MySQL console"; Action: run; FileName: "'+FileName+'/mysql/bin/mysql.exe";Parameters: "-u root -p"; Glyph: 0'); StringChange (SrcContent4, 'INSlogapache', 'Type: item; Caption: "Apache error log"; Glyph: 6; Action: run; FileName: "notepad.exe"; parameters:"'+FileName+'/logs/apache_error.log"'); StringChange (SrcContent4, 'INSlogmysql', 'Type: item; Caption: "mysql error log"; Glyph: 6; Action: run; FileName: "notepad.exe"; parameters: "'+FileName+'/logs/mysql_error.log"'); StringChange (SrcContent4, 'INSlogphp', 'Type: item; Caption: "php error log"; Glyph: 6; Action: run; FileName: "notepad.exe"; parameters: "'+FileName+'/logs/php_error.log"'); StringChange (SrcContent4, 'ROOTPATH', FileName); SaveStringToFile(DestFile4,SrcContent4, False); end; DeleteFile(SrcFile4); DeleteFile(SrcFileaddcons); DestFile5 := FileName+'/install_services.bat'; SrcFile5 := FileName+'/install_services.install'; LoadStringFromFile (SrcFile5, SrcContent5); StringChange (FileName, '/','\'); StringChange (SrcContent5, 'Myinstmysql','.\mysql\bin\mysqld-nt.exe --install-manual wampmysqld --defaults-file="'+FileName+'\mysql\my.ini"'); StringChange (FileName, '\','/'); if FileExists (DestFile5) then DeleteFile (DestFile5); SaveStringToFile(DestFile5,SrcContent5, False); DeleteFile(SrcFile5); DestFile6 := FileName+'/install_services_auto.bat'; SrcFile6 := FileName+'/install_services_auto.install'; LoadStringFromFile (SrcFile6, SrcContent6); StringChange (FileName, '/','\'); StringChange (SrcContent6, 'Myinstmysql','.\mysql\bin\mysqld-nt.exe --install wampmysqld --defaults-file="'+FileName+'\mysql\my.ini"'); StringChange (FileName, '\','/'); if FileExists (DestFile6) then DeleteFile (DestFile6); SaveStringToFile(DestFile6,SrcContent6, False); DeleteFile(SrcFile6); LoadStringFromFile (FileName+'/install_mysql_service.bat', SrcContent4); StringChange (FileName, '/','\'); StringChange (SrcContent4, 'ROOTPATH', FileName); StringChange (FileName, '\','/'); SaveStringToFile(FileName+'/install_mysql_service.bat',SrcContent4, False); SrcFile7 := FileName+'/www/phpmyadmin/config.inc.php'; LoadStringFromFile (SrcFile7, SrcContent7); StringChange (SrcContent7, '$cfg[''PmaAbsoluteUri''] = '''';','$cfg[''PmaAbsoluteUri''] = ''localhost/phpmyadmin/'';'); DeleteFile (SrcFile7); SaveStringToFile(SrcFile7,SrcContent7, False); indexfile := FileName+'/www/index.php'; indexfilenew := FileName+'/www/index.new.install'; if FileExists (indexfile) then begin if MsgBox('Would you like to install the new WAMP5 homepage? (this will overwrite exisiting index.php file)',mbConfirmation,MB_YESNO) = IDYES then begin DeleteFile (indexfile); LoadStringFromFile (indexfilenew, Srcindex); SaveStringToFile(indexfile,Srcindex, False); end end else begin LoadStringFromFile (indexfilenew, Srcindex); SaveStringToFile(indexfile,Srcindex, False); end DeleteFile (indexfilenew); phpdllcopy := 'fdftk.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'fribidi.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'gds32.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'libeay32.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'libmhash.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'libmysql.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'msql.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'libmysqli.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'ntwdblib.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'php5activescript.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'php5isapi.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'php5nsapi.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'ssleay32.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'yaz.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'libmcrypt.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); phpdllcopy := 'php5ts.dll'; filecopy (FileName+'/php/'+phpdllcopy, FileName+'/Apache2/bin/'+phpdllcopy, False); end;[/code:1:d87775f954]Wat kan ik hieraan doen?

ANNErd