Skip to content
⌘ NSIS Forum Archive

How to download a file from the Internet without the use of plug-ins ??

17 posts

stass#

How to download a file from the Internet without the use of plug-ins ??

How to download a file from the Internet without the use of plug-ins ?
Is it possible to use this function URLDownloadToFile () ? How to do it?
stass#
Try this:
OutFile "URLDownloadToFile_test.exe"
; http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
Section
StrCpy $1 "http://rarlab.com/rar/wrar500.exe"
StrCpy $2 "C:\Downloads\wrar500.exe"
System::Call 'urlmon.dll::URLDownloadToFile(i0,i$1,i$2, i0, i0)'
SectionEnd
But it is not working ... Please tell me how to solve the problem.
Anders#
You wanted to do it without plugins and then you post some code where you are using a plugin!

Why not use one of the downloader plugins?
stass#
Anders
I am interested - how to use the function URLDownloadToFile.
Is it so difficult to help ?..
stass#


WS.Reputation.1 | Symantec

I understand - triggering false. But you can not work ....

On nsisdl.dll not find any working links ...
Anders#
INetC is no longer detected by Symantec and I submitted a false positive to TrendMicro, the problem should go away soon...

StrCpy $1 "http://o.aolcdn.com/os/winamp/forums/images/buttons/reply.gif"
StrCpy $2 "$temp\reply.gif"
System::Call 'urlmon::URLDownloadToFile(i0,tr1,tr2, i0, i0)i.r0'
DetailPrint HRESULT=$0 ; 0 means success (probably), read MSDN for more info
AjitPS#
Hello,
I am new to using the NSIS installer.
My NSIS script creates the installer without any issues but a software download that it tries to do via the nsisdl plugin fails. This happens at the beginning of the installation process. The rest of the process works fine. I can download this external software (.exe) via the URL if I use it in my web browser but not within the NSIS installer.

I use the statement:
nsisdl::download url "${INSTALL_EXE_NAME}"
This was working until 2 days ago but keeps failing now. I tried replacing the plugin with the inetc plugin but even that does not work.

This is a repeat post because I need an answer to this soon. If anyone has information about the proper syntax for using the nsisdl plugin or has experienced this before while attempting to download from a url, please do let me know.
Thanks.
Anders#
There is no url there, just the string "url"...


Next time don't ask the same question in several threads, it is very rude.
AjitPS#edited
Re: Using nsisdl to download from url

Hello,
First of all, sorry for posting the question in multiple places. Won't happen again.

Secondly, the code I showed in my earlier post was an example. My actual script has a valid url (where the string "url" is shown in the earlier example) and the $INSTALL_EXE_NAME is the name of the location where to put it (the .exe).

Some part of the script is shown below:

# default section
Section "Installer Section"

setShellVarContext current

; ** Ask the user if they want to install the package **
MessageBox MB_YESNO "In order for this code to work, the following needs to be downloaded. Choose Yes or No. " IDYES true IDNO false
true:
; Download the package
nsisdl::download http://exampleURL/exampleApp1-win.exe "${INSTALL_EXE_NAME}"

Pop $R0
StrCmp $R0 "success" +3
MessageBox MB_OK "Download Failed - Please install it manually"
Goto next
However, the software download fails immediately. The url above is again a generic example. Downloading from the actual URL (in my script) works perfectly if I go to the URL in my browser. However, it is no longer working in NSIS. It used to work until 3 days ago since when it keeps failing. I also tried to use the inetc plugin instead of nsisdl but that failed too.

Kindly let me know what you think.
Thanks.
AjitPS#
Hi Anders,
Yes, I have Norton AntiVirus installed. However, the installation from the url used to work without problems (with the AntiVirus) until 4 days ago.
Now, it fails immediately after clicking "Yes" to the installation, shown in the script I mentioned above.
Afrow UK#
What is the value of ${INSTALL_EXE_NAME}?

What error does inetc report (check the value on the stack)?

Stu
zedzedbeta5#
For the OS's that support it:

nsExec::ExecToStack `"powershell.exe" -inputformat none -Command "$wc=New-Object system.Net.WebClient;$wc.downloadFile('http://someurl.com/file.exe','$INSTDIR\file.exe')"`

Use the plugins, they work well.