I’m creating an installer to download a file and exec it with NSIS. It shows connecting… for a while and finally a “download failed …” message box, here are my scripts:
!include "LogicLib.nsh"
; Name of the installer executable
OutFile "MyInstaller.exe"
; Define the temporary file path
; Define the URL of the offline installer
Section
; Set the URL to download the file from
StrCpy $0 https://7-zip.org/a/7z2408-x64.exe
; Set the path where the file will be saved
StrCpy $1 $Temp7z.exe
; Use the NSISdl plugin to download the file
NSISdl::download $0 $1 Pop $0
; Get the return value
; Check if the download was successful
StrCmp $0 "success" 0 +3
ExecWait '"$1"'
Goto end
; If download failed, display an error message
MessageBox MB_OK "Download failed: $0"
end:
; End the section
SectionEnd