I'm not sure if this is the right way to do this, but you can use the [code] section and BeforeInstall flags
So
[Files]
Source: "MYPROG.EXE"; DestDir: "{app}"; BeforeInstall: MyBeforeInstall('{app}')
Source: "MYFILE.EXE"; DestDir: "{app}"; BeforeInstall: MyBeforeInstall('{app}')
Source: "MYDB.MDB"; DestDir: "{app}"; BeforeInstall: MyBeforeInstall('{app}')
[Code]
function MyBeforeInstall(InstallPath): Boolean;
begin
Result:= FALSE;
MsgBox(CurrentFileName , mbInformation, MB_OK);
end;
Then use CurrentFileName to determine if the file can be installed, I'm not sure if it will just exit the installer if the result is false, or skip a separate file.
You can also use the [Types] / [Components] section to determine which files will be installed, but I don’t know if there is a way to automatically select this.
source
share