呃!这个你自己按需要改一下应该可以的呀。
[Setup]
DefaultDirName={code:GetInstPath}
DisableDirPage=yes
[Code]
function GetInstPath: String;
begin
if FileExists('xxx.exe') then
Result := ExpandConstant('{pf}\xxxx')
else
if DirExists(ExpandConstant('{src}\yyyy')) then
Result := ExpandConstant('{src}');
end;