我不确定这是否是正确的方法,但您可以使用 [code] 部分和 BeforeInstall Flags
像这样
[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;
//Check if this file is ok to install
MsgBox(CurrentFileName , mbInformation, MB_OK);
end;
然后使用 CurrentFileName 来确定文件是否可以安装,如果结果为假,我不确定它是否会退出安装程序,或者跳过单个文件。
您还可以使用 [Types]/[Components] 部分来确定将安装哪些文件,但我不知道是否有办法自动选择它。