download - 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
解决方案
当您尝试手动下载文件时,浏览器如下所示:
它指出:
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
在您的脚本中使用该链接。
推荐阅读
- regex - 如何优化正则表达式中的边界检查?
- ruby - 水豚有错误信息?
- r - 用 R 中的表格打印卡方统计量
- c - 动态分配结构数组
- discord - 如何允许我的 discordjs 机器人发送命令?
- android - 应用中心构建,错误:/usr/bin/jarsigner failed with return code: 1(仅在 Build Android App Bundle 开启时发生)
- mongodb - 使用第一个集合(短字符串)的 find 方法的返回对象,并在第二个集合的 find 方法中迭代每个对象。(长串)
- oauth-2.0 - 与谷歌表格 API 连接器一起使用时,我应该为 Yahoo Fantasy API 使用什么响应类型?
- javascript - NUXTJS:如何从客户端 javascript 更新 data() 变量
- html - 如何选择在css中一个接一个出现的元素?