because server is server and not URI. And URI is URI and not a server. You should separate URI's components as required by the function you chosen to use.
Read https://www.google.ru/search?client=opera&q=MSDN+FtpGetFile&sourceid=opera and determine what is expected in which variable.
Read http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax how to parse URL and extract server name and remote file name into different variables.
In the string ftp://user:password@192.168.1.1:21/XDIRECTORY/YDIRECTORY/ZDIRECTORY/filename
only 192.168.1.1
is a "server" - all the rest are different parts and are not the "server". You should extract those parts into proper separate variables and pass them to function as it is documented on MSDN.
GetFileFromFTP(server, '', '', 'upx2.exe', 'upx.exe')
- the last two parameters here i believe are wrong - they both should be fully-qualified names, including the paths.
Bonus: reformulation
procedure TForm1.btn1Click(Sender: TObject);
begin
if GetFileFromFTP(server, '', '', 'upx2.exe', 'upx.exe') then
begin
Caption := 'Install succesfull';
end
else
begin
Caption := 'Install NOT succesfull';
end;
is
procedure TForm1.btn1Click(Sender: TObject);
begin
Caption := 'Install was ' +
IfThen(
not GetFileFromFTP(server, '', '', 'upx2.exe', 'upx.exe'),
'NOT ')
+ 'succesfull.';
end;