【发布时间】:2017-10-16 16:20:31
【问题描述】:
我正在尝试创建一个也具有“手动下载”链接的下载器,但该链接似乎没有显示。
我尝试按照this post 的说明进行操作,但似乎无法成功。
我在此处复制脚本,以防有人指出我可能遗漏的内容 - 抱歉,我是 NSIS 脚本方面的菜鸟。
!include "MUI2.nsh"
!define NAME "instfileslink"
Name "${NAME}"
OutFile "${NAME}.exe"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW MyInstFilesShow
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Var hCtl_test_Link1
Section
Section
inetc::get /caption "Downloading package" "http://speedtest.ftp.otenet.gr/files/test100Mb.db" "test100Mb.db" /end
Pop $R0
StrCmp $R0 "OK" 0 dlfailed
Quit
dlfailed:
DetailPrint "Download failed: $R0"
Abort
SectionEnd
Function fnLinkClicked
ExecShell "open" "http://speedtest.ftp.otenet.gr/files/test100Mb.db"
FunctionEnd
Function MyInstFilesShow
${NSD_CreateLink} 120u 175u 100% 10u "Download manually"
Pop $hCtl_test_Link1
${NSD_OnClick} $hCtl_test_Link1 fnLinkClicked
FunctionEnd
【问题讨论】:
-
@idleberg,减少代码。
-
INetC 位实际上对答案很重要。
-
@Anders,重新添加了 inetc 位。
标签: nsis