Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 27th September 2013, 15:01   #1
stass
Senior Member
 
Join Date: Nov 2012
Posts: 146
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 is offline   Reply With Quote
Old 27th September 2013, 15:50   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
You need the system plugin to call Windows functions...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 28th September 2013, 07:41   #3
stass
Senior Member
 
Join Date: Nov 2012
Posts: 146
Try this:
Quote:
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.
stass is offline   Reply With Quote
Old 29th September 2013, 03:23   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
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?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 30th September 2013, 06:13   #5
stass
Senior Member
 
Join Date: Nov 2012
Posts: 146
Anders
I am interested - how to use the function URLDownloadToFile.
Is it so difficult to help ?..
stass is offline   Reply With Quote
Old 30th September 2013, 17:20   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
What is wrong with nsisDL and InetC?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 1st October 2013, 06:09   #7
stass
Senior Member
 
Join Date: Nov 2012
Posts: 146
https://www.virustotal.com/ru/file/5...e4e8/analysis/

WS.Reputation.1 | Symantec

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

On nsisdl.dll not find any working links ...
stass is offline   Reply With Quote
Old 1st October 2013, 08:26   #8
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
NSIDdl is shipped with NSIS. If you did a full install, you already have it.
MSG is offline   Reply With Quote
Old 1st October 2013, 19:22   #9
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
INetC is no longer detected by Symantec and I submitted a false positive to TrendMicro, the problem should go away soon...

Quote:
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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 2nd October 2013, 05:59   #10
stass
Senior Member
 
Join Date: Nov 2012
Posts: 146
Anders
Thank you very much!
stass is offline   Reply With Quote
Old 5th February 2014, 17:41   #11
AjitPS
Junior Member
 
Join Date: Feb 2014
Posts: 4
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:
Quote:
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.
AjitPS is offline   Reply With Quote
Old 5th February 2014, 20:56   #12
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
There is no url there, just the string "url"...


Next time don't ask the same question in several threads, it is very rude.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 6th February 2014, 17:43   #13
AjitPS
Junior Member
 
Join Date: Feb 2014
Posts: 4
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:

Quote:
# 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.

Last edited by AjitPS; 6th February 2014 at 17:54. Reason: minor edit
AjitPS is offline   Reply With Quote
Old 6th February 2014, 19:15   #14
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
Do you have AntiVirus installed?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th February 2014, 09:25   #15
AjitPS
Junior Member
 
Join Date: Feb 2014
Posts: 4
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.
AjitPS is offline   Reply With Quote
Old 10th February 2014, 09:03   #16
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
What is the value of ${INSTALL_EXE_NAME}?

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

Stu
Afrow UK is offline   Reply With Quote
Old 20th February 2014, 17:07   #17
zedzedbeta5
Junior Member
 
Join Date: Sep 2012
Posts: 8
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.
zedzedbeta5 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump