首页 > 解决方案 > Inno Setup 无法从 Google Drive 下载大文件

问题描述

这是我的 Inno 设置代码。我要下载的“Scripts.rar”文件大约为 1 GB。如果我放置一个 25MB 的文件,它就可以工作。使用这个文件,它只是继续安装离线文件,跳过大“Scripts.rar”的下载。

我需要使用此设置下载非常大的文件。它们大约有 20 个文件,每个文件的大小为 1-3GB。InnoSetup 给我带来了巨大的限制。

#pragma include __INCLUDE__ + ";" + ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir")
#pragma include __INCLUDE__ + ";" + "c:\lib\InnoDownloadPlugin"
#include <idp.iss>

[Code]
      idpAddFile('https://drive.google.com/uc?export=download&confirm=hoYh&id=1UnIIBtjhDqtNuSKyeF5ce0grVlTnIIyz', ExpandConstant('{tmp}\Scripts.rar'));
      //Download after "Ready" wizard page 
      idpDownloadAfter(wpReady);
    end;

[files]
Source: "C:\Users\Dedric\Desktop\New folder (3)\GTA Compton Compiler\UnRAR.exe"; DestDir: "{tmp}"; Flags: deleteafterinstall
; NOTE: Don't use "Flags: ignoreversion" on any shared system files


[Run]
Filename: "{tmp}\UnRAR.exe"; Parameters: "x ""{tmp}\Scripts.rar"" ""{code:GetDirPath}"""
Filename: "{code:GetDirPath}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

标签: downloadinno-setupinnodbpascal

解决方案


当您尝试手动下载文件时,浏览器如下所示:

谷歌

它指出:

Google 云端硬盘无法扫描此文件中的病毒。

Scripts.rar (311M) 太大,Google 无法扫描病毒。你还想下载这个文件吗?

这就是它不会下载的原因。它需要用户交互同意下载文件而不执行病毒扫描。

如果有任何方法可以解决这个问题,那将是 Google Drive 的问题。但忽略显示警告可能违反他们的政策。这不是 Inno Setup 问题。

更新

在互联网上快速搜索发现这篇文章说:

右键单击仍然下载,然后单击检查元素

关联

它还说:

添加"https://drive.google.com"前面"/uc?"

所以你的链接变成:

https://drive.google.com/uc?export=download&confirm=z8LQ&id=1UnIIBtjhDqtNuSKyeF5ce0grVlTnIIyz

在您的脚本中使用该链接。


推荐阅读