Reputation: 1
this script I made checks if the folder contains the exe, otherwise it skips to the next if
However, I can't pass its path, which is inside if(FileExists(ExpandConstant) , to the defaultdirname so that it is installed correctly
If anyone knows how to help me.
[setup] DefaultDirName=
[code]
function InitializeSetup(): Boolean;
begin
if (FileExists(ExpandConstant('C:\mygame\game\install.exe'))) then
begin
Result := true;
end
else if (FileExists(ExpandConstant('D:\mygame\game\install.exe'))) then
begin
Result := true;
end
else
begin
Result := false;
end
end;`
I tried using string, but I was unsuccessful, I can only do something using boolean and passing its destination manually to dirname
Upvotes: 0
Views: 19