Old 31st July 2007, 12:09   #281
empezar
Senior Member
 
empezar's Avatar
 
Join Date: Sep 2003
Posts: 123
after further testing, I can say that I only get the "installation aborted" message when the download actually fails. I tried changing the download url to something that doesn't exist, and now everytime I press the [x] button, I get the wrong message ("are you trying to install nquake offline?").

so apparently, inetc only returns "Cancelled" if the download was successful AND cancelled?

Bored with the real world? Try QuakeWorld!
empezar is offline   Reply With Quote
Old 23rd August 2007, 17:13   #282
DgtHorse
Junior Member
 
Join Date: May 2004
Posts: 4
URL Parts Error

My installer works fine on my machine but as soon as i run it on another machine it seems to download and at the end get a URL Parts error. i am using inetc get command with the /END prefixed and still getting it.

All i am downloading is the ASP.NET Ajax framework with the following command

inetc::get /caption "Downloading AJAX ASP.NET Framework 1.0" /canceltext "Cancel Download" "http://download.microsoft.com/download/5/4/6/5462bcbd-e738-45fa-84ca-fa02b0c4e1c2/ASPAJAXExtSetup.msi" "$INSTDIR\ajax.msi" /TIMEOUT 5000 /END

I do not know why it works on one and the other machine gets the URL Parts Error, anyone mind to shed some light on this?

TIA
DgtHorse is offline   Reply With Quote
Old 23rd August 2007, 17:32   #283
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Does $INSTDIR exist?

Stu
Afrow UK is offline   Reply With Quote
Old 23rd August 2007, 18:16   #284
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Move /TIMEOUT 5000 to the beginning of command line.
Takhir is offline   Reply With Quote
Old 23rd August 2007, 18:51   #285
DgtHorse
Junior Member
 
Join Date: May 2004
Posts: 4
aha! That did the trick!
Hmm, the fact that it worked on one machine and didn't in the other really did not strike me as writing the command erroneously :P
DgtHorse is offline   Reply With Quote
Old 26th August 2007, 03:13   #286
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
What is the OS on the two machines?
Backland is offline   Reply With Quote
Old 27th August 2007, 18:30   #287
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
InetLoad frequently crashes on Windows Vista while downloading from an FTP server. Did you test the Vista compatibility?
Joost Verburg is offline   Reply With Quote
Old 27th August 2007, 18:38   #288
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
I tested InetLoad on Vista. Do you know any addition requirements for NSIS plug-ins on this OS? And please attach test script if you can reproduce crash. Might be good to compare situation with Inetc that not includes 'crashable' NSISdl code fragment. Thanks.
Takhir is offline   Reply With Quote
Old 30th August 2007, 08:38   #289
MrBlunden
Junior Member
 
Join Date: Aug 2007
Posts: 4
InetLoad is great!
I have a problem though: I'm using InetLoad to post installation status to a server.

When I call it before the first custom page (MUI) it makes the installer run in the background.

This is really bad cause when a user downloads my installation and the installer doesn't go to the front of the page, the user wouldn't know it's running.

Any way to solve this?
MrBlunden is offline   Reply With Quote
Old 30th August 2007, 08:59   #290
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
If new process (installer) creates any window during a short period of time, OS gives this window focus and sets it foreground. In your situation window appear too late (silent http request delay from .oninit function?). If you don't want to use InetLoad popup/banner, use one of NSIS banner plug-ins to catch foreground position. You can also try to use SetForegroundWindow call to move installer foreground, but this is not efficient in most OSes (InetLoad do this in silent mode for some reasons), see example in the attached script how to do this.
Attached Files
File Type: nsi oninit.nsi (515 Bytes, 644 views)
Takhir is offline   Reply With Quote
Old 30th August 2007, 09:06   #291
MrBlunden
Junior Member
 
Join Date: Aug 2007
Posts: 4
Takhir, thanks for you quick response.

Tried your code - Now after the post the installer flickers (windows xp) on the taskbar. No way to make the posting not steal focus?
MrBlunden is offline   Reply With Quote
Old 30th August 2007, 09:14   #292
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
The only good way I know is to create new window when process starts. Try to use InetLoad' own (/popup, /banner) or another banner.
Yes, on XP and later SetForeground causes flickering only.
Takhir is offline   Reply With Quote
Old 22nd October 2007, 19:09   #293
empezar
Senior Member
 
empezar's Avatar
 
Join Date: Sep 2003
Posts: 123
would it be possible to get some speed information on the /banner window?

i want to have customized download texts (i.e. not "downloading <filename>" but rather "downloading <file description"), but /banner makes the download speed text go away

Bored with the real world? Try QuakeWorld!
empezar is offline   Reply With Quote
Old 29th October 2007, 06:02   #294
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Sorry, I am overloaded with urgent job, but for now you can create your version of plug-in with this output in the /banner window static field by copying code from /popup output timer function (C experience required).
Takhir is offline   Reply With Quote
Old 23rd January 2008, 15:44   #295
{_trueparuex^}
Senior Member
 
{_trueparuex^}'s Avatar
 
Join Date: Dec 2005
Location: Glow
Posts: 285
Small suggestion. Use the INTERNET_FLAG_NO_CACHE_WRITE flag in HttpOpenRequest() to disable writing in the IE cache. At the moment all downloaded files goes into to the cache as well.

I tried this my self and it seems to work so far.

The guy with the ridiculous username. Thou shall call him PaR instead.
Visit My Website
{_trueparuex^} is offline   Reply With Quote
Old 25th January 2008, 09:04   #296
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Thanks! I'll add this to the next release.
BTW I prepared an dcompilled but not tested Unicode (TCHAR) version (because not sure that NSIS Unicode package will not damage current ANSI version), so if anybody want to test it - please send me private message (it's in Account on the page top).
Takhir is offline   Reply With Quote
Old 30th January 2008, 16:06   #297
{_trueparuex^}
Senior Member
 
{_trueparuex^}'s Avatar
 
Join Date: Dec 2005
Location: Glow
Posts: 285
Quote:
Originally posted by Takhir
Thanks! I'll add this to the next release.
There seems to be a problem with the resume ability while INTERNET_FLAG_NO_CACHE_WRITE is used. The MSDN page for InternetSetFilePointer() function state that...
Quote:
...subsequent calls to InternetReadFile might block or return pending if the data is not available from the cache and the server does not support random access.
On my tests resume didnt work on any of the servers that I tried. Either those servers didn't support "random access" (whatever that means ) or resume won't work at all while INTERNET_FLAG_NO_CACHE_WRITE is used. So I think it's better leave the cache writing on while resume is used.

The guy with the ridiculous username. Thou shall call him PaR instead.
Visit My Website
{_trueparuex^} is offline   Reply With Quote
Old 9th February 2008, 14:22   #298
{_trueparuex^}
Senior Member
 
{_trueparuex^}'s Avatar
 
Join Date: Dec 2005
Location: Glow
Posts: 285
From the InternetSetFilePointer() MSDN page "... This handle must not have been created with the INTERNET_FLAG_DONT_CACHE or INTERNET_FLAG_NO_CACHE_WRITE value set."

So using INTERNET_FLAG_NO_CACHE_WRITE breaks the resume for sure.

I realized that there's a small bug in the Inetc code. This statement is always true because InternetSetFilePointer() return type is DWORD.
code:
if(!InternetSetFilePointer(hFile, cnt, NULL, FILE_BEGIN, 0))

You should use something like this.
code:
if((int)InternetSetFilePointer(hFile, cnt, NULL, FILE_BEGIN, 0) == -1)

--

The IE cache writing still bothered me so I made a little research for alternative methods and I found this article.
http://www.clevercomponents.com/arti...5/resuming.asp

I implemented the range request method described in there to Inetc code. It works without the cache, but probably isn't reliable as the InternetSetFilePointer() method.
Attached Files
File Type: zip inetc.zip (22.0 KB, 621 views)

The guy with the ridiculous username. Thou shall call him PaR instead.
Visit My Website
{_trueparuex^} is offline   Reply With Quote
Old 9th February 2008, 18:31   #299
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Thank you very much {_trueparuex^}
I updated both inetc & inetload plug-ins. Also new feature in inetc: /question cancel_text (was requested here)
About no_cache_write using 'range request' - interesting idea for big files (like night movie downloads). Let's check reliability and if OK we'll add your code to inetc. Or you can write new multuthreaded super-fast downloader
Takhir is offline   Reply With Quote
Old 10th February 2008, 00:22   #300
{_trueparuex^}
Senior Member
 
{_trueparuex^}'s Avatar
 
Join Date: Dec 2005
Location: Glow
Posts: 285
Quote:
Originally posted by Takhir
Thank you very much {_trueparuex^}
I updated both inetc & inetload plug-ins. Also new feature in inetc: /question cancel_text (was requested here)
About no_cache_write using 'range request' - interesting idea for big files (like night movie downloads). Let's check reliability and if OK we'll add your code to inetc. Or you can write new multuthreaded super-fast downloader
No problem

...1500 megawatt Aperture Science heavy-duty super-threaded super loader. Seriously that's not a bad idea at all.


At least there shouldn't any difference on what servers the resume methods work...
http://support.microsoft.com/kb/168408

But InternetSetFilePointer() definitely is more flexible and handles exceptions way better.

The guy with the ridiculous username. Thou shall call him PaR instead.
Visit My Website
{_trueparuex^} is offline   Reply With Quote
Old 10th February 2008, 00:24   #301
{_trueparuex^}
Senior Member
 
{_trueparuex^}'s Avatar
 
Join Date: Dec 2005
Location: Glow
Posts: 285
There was bug in the content length / accept ranges check in my last file. So here's a new one.
Attached Files
File Type: zip inetc_range_request_mod.zip (22.0 KB, 600 views)

The guy with the ridiculous username. Thou shall call him PaR instead.
Visit My Website
{_trueparuex^} is offline   Reply With Quote
Old 15th February 2008, 08:46   #302
janekschwarz
Junior Member
 
Join Date: Feb 2008
Posts: 5
I think there is a bug in inetc::put. When I try to upload a file, the http header content-length is always 0. Here's an example:

======= Start =======
PUT / HTTP/1.1
Content-Type: octet-stream
Content-Length: 0
User-Agent: NSIS_Inetc (Mozilla)
Host: XXXXXXXX.de:8812
Connection: Keep-Alive
Cache-Control: no-cache

line1
line2
======= End =======

In the NSIS script I use this line:

inetc::put "http://docstore.interchange.de:8812/" "$EXEDIR\testfile" /END

When I upload the file with curl (curl -T testfile http://XXXXXXXX.de:8812) everything works as expected:

======= Start =======
PUT /testfile HTTP/1.1
User-Agent: curl/7.16.3 (i686-pc-cygwin) libcurl/7.16.3 OpenSSL/0.9.8g zlib/1.2.3 libssh2/0.15-CVS
Host: XXXXXXXX.de:8812
Accept: */*
Content-Length: 16
Expect: 100-continue

line1
line2
======= End =======

On XXXXXXXX.de:8812 runs netcat (nc -l -p 8812) which does nothing more than capturing everything that comes in on port 8812. Inetc and curl connect directly to the server (no proxies).


Is this a know problem? Unfortunately, I don't have Visual Studio available, so I can't dive in the code myself. But I'd love to help debugging it on the server side if needed.
janekschwarz is offline   Reply With Quote
Old 15th February 2008, 13:35   #303
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Thanks, janekschwarz. Bug was added in the Jan. 30, 2007 revision. Fixed now, please update your files.
Takhir is offline   Reply With Quote
Old 15th February 2008, 13:47   #304
janekschwarz
Junior Member
 
Join Date: Feb 2008
Posts: 5
Thank you for the quick answer. I'll download the new version and report back.
janekschwarz is offline   Reply With Quote
Old 18th February 2008, 16:30   #305
janekschwarz
Junior Member
 
Join Date: Feb 2008
Posts: 5
Takhir, thanks again for the fix. It works.

Another question: Does http authentication work with inetc::put? I tried something simple (http://user:passwd@XXXXXXXX.de/puttest/put.php) and always get an 401 error back. Curl authenticates successfully.
janekschwarz is offline   Reply With Quote
Old 19th February 2008, 08:29   #306
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Thanks, janekschwarz! I could reproduce this issue, probably this configuration was not tested earlier. Short googling gave me few similar questions, but no answers yet. Server accepts PUT request, receives file, but returns 401 in EndRequest() status header. Download from the same protected folder (.htaccess overridden) works correct. Any ideas?
Takhir is offline   Reply With Quote
Old 19th February 2008, 10:51   #307
janekschwarz
Junior Member
 
Join Date: Feb 2008
Posts: 5
I did an experiment. Authentication works if I set the Authorization header my self:

inetc::put /HEADER "Authorization: Basic PXVzZXI6cGFzc3dk" "http://XXXXXXXX.de/puttest/put.php" "$EXEDIR\testfile" /END

Maybe the trick is to send the Authorization headers preemptively.
janekschwarz is offline   Reply With Quote
Old 19th February 2008, 16:04   #308
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
And thank you again, janekschwarz!
I tested patch (internal base64 loginasswd encoding) and it worked fine. When (and if) sourceforge will work again I'll put new zip to server.
Attached Files
File Type: zip inetc.zip (36.5 KB, 589 views)
Takhir is offline   Reply With Quote
Old 21st February 2008, 09:13   #309
janekschwarz
Junior Member
 
Join Date: Feb 2008
Posts: 5
Hi, thank you for the fix.

I hate to admit it, but I found another problem: inetc::put through an authenticating proxy does not work. It gives up right after receiving the 407 status code from the proxy and does not ask for proxy credentials (example.nsi contained in the zip file does, so it works in principle).

Any ideas?
janekschwarz is offline   Reply With Quote
Old 22nd February 2008, 08:06   #310
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Unicode

I attached unicode version on inetc plug-in to this post - worked correct during my (short) testing. Wiki version has the same TCHAR decoration, so the only difference with archive code is path to exdll.h. I'll convert project to VS 2005 with additional Unicode configurations and put to wiki later (after some tests, and I hope you will help me). Version with log prints (for debugging) is temporary available here http://ineum.narod*****inetc.htm
Have fun
Attached Files
File Type: zip inetc_unicode.2008.02.22.zip (29.7 KB, 569 views)
Takhir is offline   Reply With Quote
Old 24th March 2008, 11:37   #311
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
By the way there is a slight issue when using inetc on the install files page. If you haven't clicked the show details button, then everything is fine (inetc disables it, fine). If however, you do click the show details button before downloading, inetc shows over the log window without hiding it.

Be nice if this code could go in the plug-in but this is how to sort it in NSIS script:
code:

!macro DownloadPre
FindWindow $R0 `#32770` `` $HWNDPARENT
GetDlgItem $R0 $R0 1016
System::Call user32::IsWindowVisible(iR0)i.R1
StrCmp $R1 0 +2
ShowWindow $R0 ${SW_HIDE}
!macroend
!define DownloadPre `!insertmacro DownloadPre`

!macro DownloadPost
StrCmp $R1 0 +2
ShowWindow $R0 ${SW_SHOW}
!macroend
!define DownloadPost `!insertmacro DownloadPost`

...

${DownloadPre}
inetc::get ...
${DownloadPost}


Just make sure you don't touch the $R0 and $R1 variables between DownloadPre and DownloadPost.

Stu
Afrow UK is offline   Reply With Quote
Old 24th March 2008, 12:06   #312
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Thanks, Stu, I'll try to add this feature to next release. Is 1016 unique value for this page-control?
This morning I uploaded inetc version with (I hope) finally fixed PUT issue if proxy or HTTP server authorization required (many thanks to janekschwarz). Problem was in proxy/server auth request that came back after all data were already sent (and progress bar reached right border). New version for HTTP PUT first tests connection using OPTIONS request. The only remaining 'difficult' situation is PUT to HTTPS if proxy/server authorization data to be requested from user (in password/login dialog) because OPTIONS request to HTTPS failed in my tests.
http://nsis.sourceforge.net/Inetc_plug-in
Takhir is offline   Reply With Quote
Old 24th March 2008, 13:51   #313
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Yes it is the id for the list view control.

Stu
Afrow UK is offline   Reply With Quote
Old 24th March 2008, 19:55   #314
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Also, is it just me or does it not re-enable the show details button?

Stu
Afrow UK is offline   Reply With Quote
Old 25th March 2008, 07:04   #315
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Inetc restores original button style after transfer complited. May be nothing to 'show' in your sample?
Attached Images
File Type: gif details.gif (11.1 KB, 523 views)
Takhir is offline   Reply With Quote
Old 3rd April 2008, 15:28   #316
l0k1
Junior Member
 
Join Date: Oct 2007
Posts: 24
If i use Inetc plugin in .OnInit function, installer never gets focus when launched.
Ex :

code:

!include "MUI2.nsh"
Name "test"
OutFile "Install.exe"
RequestExecutionLevel Admin

!InsertMacro MUI_PAGE_License $(license)
!InsertMacro MUI_PAGE_INSTFILES
Function .onInit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

HTTP:
InetC::Get /SILENT "http://www.google.com" "$TEMP\bug.txt" /END
Pop $0
StrCmp $0 "OK" OK
ERR:
messagebox mb_ok "Error : $0"
OK:

FunctionEnd
Section
SectionEnd



Another problem with close button :

I have a script with AutoClose = True and InetC command in .OnInstSuccess function

If a user click on the button before the page desappears then the execution of the script jump to a random location (always the same though).

Any help ?
thx
l0k1 is offline   Reply With Quote
Old 3rd April 2008, 15:52   #317
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
1. You can find related discussion on page 5 of this thread.
2. Any plug-in require installer running, may not work when on the exit step, so it's not a good idea to run inetc in .OnInstSuccess.
Takhir is offline   Reply With Quote
Old 30th April 2008, 11:00   #318
Vytautas
Major Dude
 
Vytautas's Avatar
 
Join Date: May 2003
Location: Victoria, Australia
Posts: 643
Send a message via ICQ to Vytautas
Is this a bug or am i doing something wrong?

I'm trying to download a file from https using authentication, the username dialog comes up fine and works as expected when wrong and right usernames are entered.

However is one clicks cancel on that dialog, inetc downloads the http error report and sets status to OK. Is there a way to detect if/when this happens?

Vytautas
Vytautas is offline   Reply With Quote
Old 30th April 2008, 12:54   #319
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
This is a bug. InternetErrorDlg() returns ERROR_SUCCESS 0 on Cancel click (I hoped this to be ERROR_CANCELLED 1223 as MSDN declares). Thanks, Vytautas, I'll put updated to server version as soon as sourceforge will be up (with 2 other small changes).
Takhir is offline   Reply With Quote
Old 30th April 2008, 23:50   #320
Vytautas
Major Dude
 
Vytautas's Avatar
 
Join Date: May 2003
Location: Victoria, Australia
Posts: 643
Send a message via ICQ to Vytautas
Thank you, thats much better now
Vytautas 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