I want to use Inno Setup to install a tool into Visual Studio.
My tool should be installed to an existing folder, with an existing file in the folder.
I know how to search this file. I use this code in Inno Setup:
function InitializeSetup: Boolean;
begin
// Alle Unterverzeichnisse durchsuchen
DirDepth := -1;
// suche nach der Datei im Programme-Ordner beginnen
SearchPath := ExpandConstant('{pf}');
// suche nach folgender Datei
SearchFile := 'main tool.exe';
SearchForFile;
// wenn Datei nicht gefunden Fehlermeldung und Setup beenden
if not FileFound then
MsgBox('Installierte Version konnte nicht ermittelt werden.', mbCriticalError, mb_OK)
else
Result := true;
end;
My problem is, the file "main tool.exe" could be in more than one folder. It could be in a folder like "aaa" or "bbb v1". My program must be installed in the folder "bbb v1", but the first name of this folder is always "bbb" and the "v1" could be different...
So, how can I search this folder in Inno Setup?