Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Script for copying Files at the end of install : Inno Setup

Tags:

inno-setup

I explain my project : my setup will be delivered with 2 licence files beside him who they must not be include inside the concerned setup. Like this :

Folder/
----Setup.exe
----CanBTL.dat
----CanBTP.dat

And i want, if that's sure they are here, to copy this files in a folder who will be build with Setup.exe. So i'm trying to make this code :

I edit my script : EDIT :

[Code]
function CheckForFile(CurPageID: Integer): Boolean;
begin
if (CurPageID = wpFinished) and (FileExists('CanBTL.dat' + 'CanBTP.dat')) then 
  begin
     FileCopy(ExpandConstant('CanBTL.dat' + 'CanBTP.dat'), ExpandConstant('{cf}\Folder\'), false); 
  end;
end;

The goal is to copy the two .dat file next to the setup in a folder created by the setup.exe

It compile, but seems to make nothing. My files are not copied.

I'm still a beginner to the section code in Inno Setup so if anyone can help me?

Thanks

like image 447
Algorys Avatar asked Dec 20 '22 07:12

Algorys


1 Answers

Ok. No need of code section, that's working fine using external flags and the {src} constant to say current directory :

Source: "{src}\CanBTL.dat"; DestDir: "{cf}\Folder"; Flags: external;
Source: "{src}\CanBTP.dat"; DestDir: "{cf}\Folder"; Flags: external;

Thanks TLama

like image 178
Algorys Avatar answered Jan 19 '23 04:01

Algorys