Old 2nd December 2009, 07:23   #361
morty3
Junior Member
 
Join Date: Dec 2009
Posts: 2
Hi Takhir,

thanks for the quick reply. The first URL works with my script too, it is the second and third URL that don't work.
morty3 is offline   Reply With Quote
Old 2nd December 2009, 07:33   #362
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
Sorry
Please test last link (https) in a browser - my Mozilla displays "Download Java SE Development Kit 6u17 for Solaris x86, Multi-language" page, not exe. The same I get from inetc - 28 kB file, when renamed it is viewable in borwser as well.
Takhir is offline   Reply With Quote
Old 3rd December 2009, 08:04   #363
StephanB86
Junior Member
 
Join Date: Dec 2009
Posts: 15
Still got some problems using ftp::put

When using:
Works:
inetc::put /CAPTION "service pack upload" "ftp://user:pass@192.168.0.150:8021/5mb.bin" "c:\Dell\5mb.bin"

Fails:
inetc::put /CAPTION "service pack upload" "ftp://user:pass@192.168.0.150:8021/Application/5mb.bin" "c:\Dell\5mb.bin"

The only difference is the Directory on the FTP server. The directory exists. What else should I use?
StephanB86 is offline   Reply With Quote
Old 3rd December 2009, 12:33   #364
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
Please note that most of ftp servers work with paths relative to logged user home dir.
Takhir is offline   Reply With Quote
Old 3rd December 2009, 12:48   #365
StephanB86
Junior Member
 
Join Date: Dec 2009
Posts: 15
I know. But logging on with any other FTP client is placed in to root. Local FTP server that's running on a device with WinCE. For testing purposes it's running localy.
By running the working version it's placed in the root correctly. And I'm really sure that the directory exists
StephanB86 is offline   Reply With Quote
Old 3rd December 2009, 12:53   #366
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
To be sure it goes to FS root (if permitted) you can use host//path
Takhir is offline   Reply With Quote
Old 3rd December 2009, 13:07   #367
StephanB86
Junior Member
 
Join Date: Dec 2009
Posts: 15
That does the trick! Thanks a lot!
StephanB86 is offline   Reply With Quote
Old 4th December 2009, 10:34   #368
StephanB86
Junior Member
 
Join Date: Dec 2009
Posts: 15
Creating dirs ain't possible with this?
StephanB86 is offline   Reply With Quote
Old 4th December 2009, 16:40   #369
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
It should. If current user has permissions.
Takhir is offline   Reply With Quote
Old 7th December 2009, 07:53   #370
StephanB86
Junior Member
 
Join Date: Dec 2009
Posts: 15
Current user gots al the permissions he need. I get the Reget error. Any example?
Or just like:
inetc::put /CAPTION "service pack upload" "ftp://user:pass@192.168.0.150:8021//Application/NewDir/5mb.bin" "c:\Dell\5mb.bin"
StephanB86 is offline   Reply With Quote
Old 7th December 2009, 17:12   #371
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
This work for me
code:

;--------------------------------
; General Attributes

Name "Inetc ftp mkdir Test"
OutFile "ftp_mkdir.exe"


;--------------------------------
;Interface Settings

!include "MUI.nsh"
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"


;--------------------------------
;Installer Sections

Section "Dummy Section" SecDummy

; use your own URL and login@pwd. Password hidden from user with /popup "ALIAS"

inetc:ut /caption "service pack upload" /popup "" "ftp://takhir:somepwd@localhost/subdir/inetc.dll" "$EXEDIR\inetc.dll"
Pop $0
MessageBox MB_OK "Upload Status: $0"

SectionEnd


Sorry, CLI output is in Russian, but it is not difficult to understand
code:
>dir /S /W
Том в устройстве C имеет метку OS
Содержимое папки C:\Users\takhir\Documents\wftpd\shared
[.] [..] [subdir]
0 файлов 0 байт
Содержимое папки C:\Users\takhir\Documents\wftpd\shared\subdir
[.] [..] inetc.dll
1 файлов 20_480 байт
Всего файлов:
1 файлов 20_480 байт
5 папок 130_276_462_592 байт свободно

Takhir is offline   Reply With Quote
Old 8th December 2009, 08:31   #372
StephanB86
Junior Member
 
Join Date: Dec 2009
Posts: 15
It's not working for me. User got the permission to read/edit/create/execute.
code:

inetc::put /caption "service pack upload" /popup "" "ftp://myuser:mypass@192.168.0.150:8021//Application/Test//inetc.dll" "C:\DELL\5mb.bin"
Pop $0
MessageBox MB_OK "Upload Status: $0"


Returns: Upload Status: Reget Error

*For testing I created a 5mb.bin*

With CLI and ftp open it's possible. Also tried several attempts using extra slashes.
StephanB86 is offline   Reply With Quote
Old 2nd February 2010, 08:50   #373
skuallpa
Junior Member
 
Join Date: Jun 2009
Posts: 30
Hello,

I have a problem with the unicode build of inetc. I am trying to send post values to a script on my website.

This is my command line:

code:
inetc:ost "t=i&v=2" /SILENT /TIMEOUT 2500 "https://www.mywebsite.com/myscript.php" "$TEMP\BD-827364682984.txt" /END


Bot nothing is send, as if the connexion could not be established.

Thanks in advance for your help
skuallpa is offline   Reply With Quote
Old 2nd February 2010, 16:18   #374
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
I see one bug in code for UNICODE - POST message size should be defined in bytes, not in characters. But probably content-type header should be also changed to
code:
Content-Type: text/html; charset=utf-16
Or this should be 16LE ?
BTW does ANSI version works with your request?
Takhir is offline   Reply With Quote
Old 4th February 2010, 16:47   #375
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
Idea to send Unicode string in http body is very attractive, but my experiments with Unicode POSTs were dissapointing. An it looks like browser sends form data as multibyte even if form was downloaded in page with utf encoding. So I just added body string convertion to multibyte, this worked in my tests. Please test attached dll.
Takhir is offline   Reply With Quote
Old 5th February 2010, 08:07   #376
skuallpa
Junior Member
 
Join Date: Jun 2009
Posts: 30
Hello Takhir,

I have just tested the dll that you have attached and all work well. The problem is corrected (post values are sent correctly)

Thanks a lot for your work!

Regards

Website : http://www.timelapse-photo.com
skuallpa is offline   Reply With Quote
Old 25th February 2010, 09:26   #377
robod
Junior Member
 
Join Date: Feb 2010
Posts: 3
Zdravstvuj Takhir :-),

I'm wondering if you could help me with this.

I've got a php script which allows me to upload a file (just a normal HTML form with upload). I'd like to post data to that script and upload a file.

So, the question is - is it possible to use inetc:ost to upload a file?
I guess I can use the TEXT2POST field, but I would have to MIME encode the file as a text and I'm worried that it will not be long enough.

If it's not possible, have you (or anyone else) got a better idea how to do it? Alternatively, would you be able to enhance inetc, so it's possible?

I can't use put as it's a IIS server and I can't enable webdav (to allow put).

Thanks,

Rob
robod is offline   Reply With Quote
Old 25th February 2010, 16:17   #378
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
I don't have ready solution for this Code sample may help, but I am not sure if I'll can find time for big changes in plug-in right now. I found one MS code sample, but it not sends file name to server while for normal (html form) uploads I can easy get file name in php...
Takhir is offline   Reply With Quote
Old 2nd March 2010, 19:09   #379
SinusPi
Junior Member
 
Join Date: Mar 2010
Posts: 4
I added the capability of using files as POST data, so as not to be limited by the NSIS variable size.

Usage: /FILE "filename" among inetc::post options. The 'content' parameter still needed, so it amounts to
inetc::post "blah" /FILE "filename" .....

Attached: source file with the modification, and a .dll with it compiled in. Non-Unicode, I somehow couldn't get those settings to compile, but didn't have time to figure it out at all.
SinusPi is offline   Reply With Quote
Old 3rd March 2010, 10:38   #380
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
I like simple solutions
Few minor improvements and testing required, but idea looks good. Inet samples use HttpSendRequestEx() and InternetWriteFile(), but your approach may work as well - need to test this at least on 1MB files. And IMHO some corrections required: POST body size should be file size, not strlen() in this case (jpeg file may have a lot of zeroes); additional error handling for file IO required (part of file may be locked... in theory ); first parameter may be used as file name, /FILE option this case will be without parameter. And may be good to think about MIME-encoding of file to be sent, and about content headers like Content-Disposition: form-data; name="ImageData"; filename="somefile.jpg" Content-Type: image/jpeg - this sends file name I wrote above (sample from http://pics.livejournal.com/doc/prot...ata.simple.bml ).
But any case this looks good, thanks for your help, SinusPi!

Last edited by Takhir; 3rd March 2010 at 11:01.
Takhir is offline   Reply With Quote
Old 12th March 2010, 11:13   #381
robod
Junior Member
 
Join Date: Feb 2010
Posts: 3
Hi there,

Not sure if it helps, but here is how can this be implemented. The example is using python and wget, but shows the necessary steps that are involved in posting a file:
http://www.noah.org/wiki/WGET_CGI_Post
(www.noah.org/wiki/WGET_CGI_Post)

And this is what the post request looks like when uploading a file in FireFox:

Content-Type: multipart/form-data; boundary=---------------------------188752843329869
Content-Length: 76298

-----------------------------188752843329869
Content-Disposition: form-data; name="file"; filename="HttpAnalysisPluginSP14.zip"
Content-Type: application/x-zip-compressed

<The base64 encoded data go here>

-----------------------------188752843329869
Content-Disposition: form-data; name="submit" Submit
-----------------------------188752843329869--
robod is offline   Reply With Quote
Old 13th April 2010, 15:10   #382
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 304
Hello..
I need also to use the POST request with /FILE support (to skip NSIS string limitations)
Where can we get this updated version of inetc?
Is it available yet?

BTW, thanks for the plugin

Olivier
Wizou is offline   Reply With Quote
Old 11th May 2010, 14:15   #383
robbertdam
Junior Member
 
Join Date: Jul 2009
Posts: 8
Download fails

Hi, great plugin. I use it in my installer to download & install the .NET framework when it is not yet installed. It works perfect 99% of the time.

However, once in a while a customer calls that it does not work. When they retry it does work. I'm not entirely sure but the problems seems to occus when my installer is executed immediately from Firefox. I've tried to reproduce it on a virtual machine, and it occurs exactly one time. After that it keeps working fine.

Is this a known issue? If not, I'm happy to help to debug this issue. Is there a way to get logs or anything?

Thanks,
Robbert Dam
robbertdam is offline   Reply With Quote
Old 14th July 2010, 18:56   #384
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
/FILE option now available in inetc. This is not classic file post implementation, but this work and file content is available as http input. File name (tail of TEXT2POST parameter) added to HTTP headers as Filename: header. Samples included into new package. Please test before using .
Also please note new sample on wiki page http://nsis.sourceforge.net/Inetc_plug-in from Edward Marshall & Jonathan Beddoes - how to restore installer window after silent calls from .onGUIInit
Takhir is offline   Reply With Quote
Old 15th July 2010, 02:04   #385
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 304
Thanks for the addition, Takhir! We will check that out and get back to you if any problem..
Wizou is offline   Reply With Quote
Old 14th September 2010, 08:36   #386
punkomat
Junior Member
 
Join Date: Jun 2009
Posts: 10
Progress bar size

How can I make the download progress bar have the same size with the global installer progress bar ? (I'm using MUI)
Now it's kind of goofy looking:

punkomat is offline   Reply With Quote
Old 14th September 2010, 10:19   #387
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You'll need to modify the plug-in.

Stu
Afrow UK is offline   Reply With Quote
Old 14th September 2010, 11:08   #388
punkomat
Junior Member
 
Join Date: Jun 2009
Posts: 10
Thanks, I took your suggestion. If anyone needs this, just modify inetc.rc and rebuild:

code:
IDD_DIALOG3 DIALOG DISCARDABLE 0, 0, 300, 62
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Progress1",IDC_PROGRESS1,"msctls_progress32",0x0,0,23,
300,11
CTEXT "",IDC_STATIC1,0,8,266,11
PUSHBUTTON "Cancel",IDCANCEL,213,41,80,16
END



When recompiling with a newer Visual Studio, make sure you link against libcmt.lib and not msvcrt.lib as by default, otherwise you will require msvcrXY.dll at runtime depending on your VS version. The statically linked plugin is a tad larger, but works everywhere.
punkomat is offline   Reply With Quote
Old 14th September 2010, 11:24   #389
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
Probably better if the plugin conformed to the UI at hand.. I'm guessing your adjustments would break its working with a Classic interface (or UMUI, XPUI, etc.) / other font sizes (inherent dialog unit<>pixel changes.. original plugin suffers from this as well).

I used the WndSubClass plugin to handle some of that.. lot more trouble than it's worth, though
Animaether is offline   Reply With Quote
Old 14th September 2010, 11:47   #390
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
@punkomat: also make sure you tell VS not to embed a manifest otherwise (I believe) the CRT dependency remains.
@Animaether: that mod should work fine because it's in dialog units not pixels.

Stu
Afrow UK is offline   Reply With Quote
Old 14th September 2010, 12:15   #391
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
Doesn't it presume the parent dialog being 300 units wide, though?
Animaether is offline   Reply With Quote
Old 14th September 2010, 12:40   #392
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Ah sorry yes that is true.

Stu
Afrow UK is offline   Reply With Quote
Old 20th December 2010, 06:59   #393
sevenalive
Junior Member
 
Join Date: Dec 2010
Posts: 2
Url parts error

I have a weird error using this plugin: I get a Url Parts error when downloading a certain file. The other files are fine, I tried deleting and reuploading the file, I tried a different file with same filename, so it's a url issue. It only occurs on XP (which I test in a VM). On my native Win7 OS, it works fine.

code:
!insertmacro DownloadFile "http://sevenupdate.com/apps/SevenUpdate/SevenUpdate.Helper.exe" "$INSTDIR\SevenUpdate.Helper.exe"


Here is my complete script: http://code.google.com/p/sevenupdate...evenUpdate.nsi
sevenalive is offline   Reply With Quote
Old 20th December 2010, 10:58   #394
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
may be too many quotas? what about inetc::get ${SOURCE} ${DEST} /END ?
Also options should stay before url/file pairs inetc::get /TIMEOUT=30000 /NOPROXY "${SOURCE}" "${DEST}" /END
Takhir is offline   Reply With Quote
Old 20th December 2010, 17:45   #395
rhlobo
Junior Member
 
Join Date: Dec 2010
Posts: 1
Url Parts error

Quote:
Originally Posted by sevenalive View Post
I have a weird error using this plugin: I get a Url Parts error when downloading a certain file. The other files are fine, I tried deleting and reuploading the file, I tried a different file with same filename, so it's a url issue. It only occurs on XP (which I test in a VM). On my native Win7 OS, it works fine.
I am having a similar issue. Did you found out the origin of the problem??
rhlobo is offline   Reply With Quote
Old 21st December 2010, 00:51   #396
sevenalive
Junior Member
 
Join Date: Dec 2010
Posts: 2
No not yet, I am sure it's related to the plugin and XP because Win7 it works fine. Also I already tried moving the params before the urls, gives me File Open Error instead.
sevenalive is offline   Reply With Quote
Old 21st December 2010, 07:49   #397
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
Verify that your "$INSTDIR exists when you start download to this folder.
Takhir is offline   Reply With Quote
Old 28th January 2011, 16:39   #398
bsmith1
Junior Member
 
Join Date: Jan 2011
Posts: 2
/BANNER with SilentInstall

Hello,

I use NSIS to run a Java program, so I run it in SilentInstall.
However, before it runs, I check if java.exe is present, if not I download the JRE using Inetc::get.

My issue is that in "SilentInstall silent" mode, the /BANNER or /POPUP do not show the downloading progress windows.
I know this was done on purpose since it is supposed to be "silent", however is there an option or a way to implement that the progress windows shows up, like a /NOSILENT option?

That would be great!
Thanks
bsmith1 is offline   Reply With Quote
Old 28th January 2011, 23:59   #399
Wizou
Senior Member
 
Join Date: Aug 2007
Location: Paris, France
Posts: 304
Quote:
Originally Posted by bsmith1 View Post
Hello,

I use NSIS to run a Java program, so I run it in SilentInstall.
However, before it runs, I check if java.exe is present, if not I download the JRE using Inetc::get.

My issue is that in "SilentInstall silent" mode, the /BANNER or /POPUP do not show the downloading progress windows.
I know this was done on purpose since it is supposed to be "silent", however is there an option or a way to implement that the progress windows shows up, like a /NOSILENT option?

That would be great!
Thanks
You could embed in your silent NSIS launcher another not-silent NSIS installer that would take care of the download part.
Wizou is offline   Reply With Quote
Old 30th January 2011, 11:34   #400
bsmith1
Junior Member
 
Join Date: Jan 2011
Posts: 2
Quote:
Originally Posted by Wizou View Post
You could embed in your silent NSIS launcher another not-silent NSIS installer that would take care of the download part.
Thank you Wizou for this workaround. I will give it a try.

Cheers
bsmith1 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