环境: Inno安装程序6.2.1,Windows 7( Win 10上的相同问题)
我使用了几乎相同的脚本作为开发人员的示例代码(它起作用了)。由于某种原因,我的脚本似乎无法下载。
错误:源文件"C:\Users\ADMINI~1\AppData\Local\Temp\is-MBBKM.tmp\version.txt“不存在。
我尝试将下载位置从temp直接更改为userappdata,但却出现了相同的错误。我还试着删除postinstall代码,但没有区别。
实际上,我所看到的代码和代码示例之间唯一的区别是url。(Sourceforge最近更改为https,但项目收到了临时的http回滚。)最多可下载3个文件&这三个文件都可以使用Inno 5与第三方下载程序插件一起下载。我无法获得使用相同的url的inno 6脚本的一个下载。
[Setup]
PrivilegesRequired=lowest
[Files]
Source: "{tmp}\version"; DestDir: "{userappdata}\wire"; Flags: external ignoreversion; Components: connect [Code]
var
DownloadPage: TDownloadWizardPage;
function OnDownloadProgress(const Url, FileName: String; const Progress, ProgressMax: Int64): Boolean;
begin
if Progress = ProgressMax then
Log(Format('Successfully downloaded file to {tmp}: %s', [FileName]));
Result := True;
end;
procedure InitializeWizard;
begin
DownloadPage := CreateDownloadPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc), @OnDownloadProgress);
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID = wpReady then begin
DownloadPage.Clear
DownloadPage.Add('http://yyy.sourceforge.net/SecurityUpdates/version', 'version.txt', '');
DownloadPage.Show;
try
try
DownloadPage.Download; // This downloads the files to {tmp}
Result := True;
except
SuppressibleMsgBox(AddPeriod(GetExceptionMessage), mbCriticalError, MB_OK, IDOK);
Result := False;
end;
finally
DownloadPage.Hide;
end;
end else
Result := True;
end;编辑url & filename
发布于 2022-10-16 07:17:54
要下载的文件的Url不正确。只需在浏览器中检查它,我就会得到错误404:

https://stackoverflow.com/questions/74084318
复制相似问题