我需要NSIS脚本从互联网上下载文件并执行它。我读过很多例子,但我还是不明白该怎么做。例如
NSISdl::download http://www.domain.com/file localfile.exe
Pop $R0 ;Get the return value
StrCmp $R0 "success" +3
MessageBox MB_OK "Download Failed: $R0"
Quit$R0包含有关安装过程的信息(“取消”或“成功”)。但我不明白"localfile.exe“是什么?我需要在程序的哪个部分(部分或函数)编写此代码?
发布于 2011-12-19 19:37:20
localfile.exe是您要保存下载内容的本地系统上的路径:
!include LogicLib.nsh
Section
NSISdl::download "http://cdn.sstatic.net/stackoverflow/img/sprites.png" "$pluginsdir\image.png"
Pop $0
${If} $0 == "success"
ExecShell "" '"$pluginsdir\image.png"' ;Open image in default application
${Else}
MessageBox mb_iconstop "Error: $0" ;Show cancel/error message
${EndIf}
SectionEndhttps://stackoverflow.com/questions/8560119
复制相似问题