InnoTools Downloader not working with Inno 5.5

别等时光非礼了梦想. 提交于 2019-12-05 07:15:52

Except replacing all PChar type occurrences with PAnsiChar you will need to replace all occurrences of string type with AnsiString in the it_download.iss file. The next problem is the URL you're trying to get. The size of a file differs from expectation, because you are downloading a HTML document instead of the binary file on which that site redirects. So, if you have your ITD ready for Unicode, change the URL in your script to a direct binary URL. Note, that I didn't used HTTPS because ITD doesn't currently support SSL. A code proof may look like this:

[Code]
const
  GitSetupURL = 'http://msysgit.googlecode.com/files/Git-1.8.4-preview20130916.exe';

procedure InitializeWizard;
var
  Name: string;
  Size: Integer;
begin
  Name := ExpandConstant('{tmp}\GitInstaller.exe');

  ITD_Init;  
  if ITD_DownloadFile(GitSetupURL, Name) = ITDERR_SUCCESS then
  begin
    if FileSize(Name, Size) then
      MsgBox(Name + #13#10 + 'Size: ' + IntToStr(Size) + ' B',
        mbInformation, MB_OK)
    else
      MsgBox('FileSize function failed!', mbError, MB_OK);
  end;
end;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!