bkb 0 Posted February 26 If anyone knows, could you tell me how to assign 2 paths to this directive? I declared this path here at the beginning, but it only receives 1 [setup] DefaultDirName=C:\mygame\TEST [code] function InitializeSetup(): Boolean; begin if (FileExists(ExpandConstant('C:\mygame\TEST\install.exe'))) then begin Result := true; end else if (FileExists(ExpandConstant('D:\mygame\TEST\install.exe'))) then begin Result := true; end else begin Result := false; end end; Share this post Link to post
Lars Fosdal 1835 Posted February 26 function InitializeSetup(): Boolean; begin Result := FileExists(ExpandConstant('C:\mygame\TEST\install.exe')) or FileExists(ExpandConstant('D:\mygame\TEST\install.exe')); end; Not sure what you mean by "assign 2 paths to this directive". Share this post Link to post
bkb 0 Posted February 26 6 hours ago, Lars Fosdal said: Não tenho certeza do que você quer dizer com "atribuir 2 caminhos a esta diretiva". I'm trying to send the path stored in (FileExists(ExpandConstant) to DefaultDirName The script I made is like this, if the first if is not found, it checks the next one but I just can't send the path to the DefaultDirName Share this post Link to post
Cristian Peța 111 Posted February 27 (edited) 18 hours ago, bkb said: [setup] DefaultDirName=C:\mygame\TEST This is about Inno Setup? And you pascal code is not about Delphi but Inno Setup script? BTW here we are in: Home\Delphi Questions and Answers\General Help\ Edited February 27 by Cristian Peța Share this post Link to post
Cristian Peța 111 Posted February 27 I think it should work with #if. Not tested. But you really want to install in that path? [Setup] #if FileExists('C:\mygame\TEST\install.exe') DefaultDirName=C:\mygame\TEST #else DefaultDirName=D:\mygame\TEST #endif Share this post Link to post