My update has to figure out if two known files exist in the directory the user has specified. If not I want to let him know, that there are no files at this path. Up to now, this was a CustomMessage
in all of my .isl Files.
Now I want to show him the complete path he entered with the files.
Up to now the message looks like this:
File1, File2 or both could not be found at the selected location....
What I now want is this:
%1, %2 or both could not be found...
For %1
and %2
I want to pass in the complete specified paths, but I cannot see how to do this. ExpandConstant
does not have any arguments, and up to now I've found nothing about how to pass parameters to a custom message.
To clarify things, here's the code:
function NextButtonClick(CurPageID: Integer): Boolean;
var
ResultCode: Integer;
ServerData : String;
UseDatabase : String;
Language : String;
ResultCode : Integer;
ExePath : String;
ConfigFilePath : String;
begin
Result := True;
if CurPageID = wpSelectDir then begin
if DirExists(ExpandConstant('{app}')) then begin
MsgBox(ExpandConstant('{app}'),mbInformation,MB_OK);
UpdatePath := ExpandConstant('{app}');
ExePath := UpdatePath+'\File1.exe';
ConfigFilePath := UpdatePath+'\File2.exe.config';
if FileExists(UpdatePath+'\File1.exe') and FileExists(UpdatePath+'\File2.exe.config') then begin
RegPath := UpdatePath;
UpdatePath := RegPath + '\Update-' + ExpandConstant('{#MyAppVersion}');
ConfigPath := RegPath + '\File2.exe.config';
DBPage.Values[0] := ExtractServerAddr(GetServerData(ConfigPath));
DBPage.Values[1] := ExtractServerPort(GetServerData(ConfigPath));
end else begin
MsgBox(ExpandConstant('{cm:DirPageFileNotFound,ExePath,ConfigFilePath}'),mbInformation,MB_OK);
Result := False;
end;
end else begin
MsgBox(ExpandConstant('{cm:DirPageDirectoryNotFound}'),mbInformation,MB_OK);
Result := False;
end;