NSIS 下载超时
NSIS Downloading timeout
我已经构建了一个 NSIS,它已经运行了几个月,
突然出现了 JRE 下载失败的问题,我已经测试了下载 link 是好的,如果有人可以帮助部分代码如下,请提出可能的解决方案:
!define JRE_URL "javadl.sun.com/webapps/download/AutoDL?BundleId=69476"
Function GetJRE
MessageBox MB_OK "${PRODUCT_NAME} uses Java ${JRE_VERSION}, it will now \
be downloaded and installed"
StrCpy "$TEMP\Java Runtime Environment.exe"
nsisdl::download /TIMEOUT=30000 ${JRE_URL}
Pop $R0 ;Get the return value
StrCmp $R0 "success" +3
MessageBox MB_OK "Download failed: $R0"
Quit
ExecWait
Delete
FunctionEnd
Function DetectJRE
Push [=11=]
Push
; for 64-bit registry
SetRegView 64
ReadRegStr HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
;MessageBox MB_OK "JRE CurrentVersion "
;StrCmp ${JRE_VERSION} Done
StrCpy [=11=] 1 0
StrCpy 1 2
StrCpy "[=11=]"
;MessageBox MB_OK "JR CurrentVersion $JR_VERSION"
;MessageBox MB_OK "JR CurrentVersion "
IntCmp 16 Done JavaVerNotCorrect JavaVerNotCorrect # if not JRE 1.6,download from the web
JavaVerNotCorrect:
Call GetJRE
Done:
Pop
Pop [=11=]
FunctionEnd
nsisDl 使用自定义 HTTP 库。请改用 INetC,它使用与 Internet Explorer 相同的 HTTP 库。
我已经构建了一个 NSIS,它已经运行了几个月, 突然出现了 JRE 下载失败的问题,我已经测试了下载 link 是好的,如果有人可以帮助部分代码如下,请提出可能的解决方案:
!define JRE_URL "javadl.sun.com/webapps/download/AutoDL?BundleId=69476"
Function GetJRE
MessageBox MB_OK "${PRODUCT_NAME} uses Java ${JRE_VERSION}, it will now \
be downloaded and installed"
StrCpy "$TEMP\Java Runtime Environment.exe"
nsisdl::download /TIMEOUT=30000 ${JRE_URL}
Pop $R0 ;Get the return value
StrCmp $R0 "success" +3
MessageBox MB_OK "Download failed: $R0"
Quit
ExecWait
Delete
FunctionEnd
Function DetectJRE
Push [=11=]
Push
; for 64-bit registry
SetRegView 64
ReadRegStr HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
;MessageBox MB_OK "JRE CurrentVersion "
;StrCmp ${JRE_VERSION} Done
StrCpy [=11=] 1 0
StrCpy 1 2
StrCpy "[=11=]"
;MessageBox MB_OK "JR CurrentVersion $JR_VERSION"
;MessageBox MB_OK "JR CurrentVersion "
IntCmp 16 Done JavaVerNotCorrect JavaVerNotCorrect # if not JRE 1.6,download from the web
JavaVerNotCorrect:
Call GetJRE
Done:
Pop
Pop [=11=]
FunctionEnd
nsisDl 使用自定义 HTTP 库。请改用 INetC,它使用与 Internet Explorer 相同的 HTTP 库。