Old 15th January 2006, 21:51   #161
vbgunz
Senior Member
 
Join Date: Jun 2003
Posts: 284
Send a message via AIM to vbgunz
${varname},${TEMP1} are not variables. These are defines created during compile time. A variable is declared like so.
code:
Var varname
Var TEMP1

Those are variables...
vbgunz is offline   Reply With Quote
Old 15th January 2006, 22:16   #162
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Actually !define varname $R0 will work also, but unless you have !defined TEMP1 as a variable just like varname then you will get a compiler error.
${varname} -> $R0

-Stu
Afrow UK is offline   Reply With Quote
Old 16th January 2006, 07:18   #163
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Following code should work. I used state=value for php. You can use MessageBox to check out intermediate results
code:

Section
ReadINIStr $0 "register-ger.ini" "Field 1" "State"
#StrCpy $0 "test string" ; for test
InetLoad::load /post "state=$0" "http://www.mypostserver.com/post.php" "$EXEDIR\post_reply.htm"
Pop $0 # return value = exit code, "OK" means OK
MessageBox MB_OK "Post Status: $0"
SectionEnd


Server reply should appear in the post_reply.htm.
Takhir is offline   Reply With Quote
Old 16th January 2006, 17:58   #164
nickie12
Guest
 
Posts: n/a
Err, this is my code now:
code:
Var var1
Var var2
Var var3
Var var4
;--------------------------------
; General Attributes

!define TEMP1 $R0
!define TEMP2 $R0
!define TEMP3 $R0
!define TEMP4 $R0

Name "VIRUS-Member"
OutFile "register-ger.exe"

ReserveFile "${NSISDIR}\Plugins\InstallOptions.dll"
ReserveFile "register-ger.ini"

Page custom register-ger


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

Section "register"

ReadINIStr $var1 "register-ger.ini" "Field 1" "State"
ReadINIStr $var2 "register-ger.ini" "Field 3" "State"
ReadINIStr $var3 "register-ger.ini" "Field 6" "State"
ReadINIStr $var4 "register-ger.ini" "Field 5" "State"

InetLoad::load /post "login=$var1&password=$var2&cracker=$var3&beschuetzer=$var4&create=1" "http://ollernick.ol.funpic.de/registerforgame.php" "success.html"
Pop $0 # return value = exit code, "OK" if OK
MessageBox MB_OK "Registrationsstatus: $0"
SectionEnd

Function .onInit

;Extract InstallOptions INI files
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "register-ger.ini"


FunctionEnd

LangString TEXT_IO_TITLE ${LANG_GERMAN} "Registration"
LangString TEXT_IO_SUBTITLE ${LANG_GERMAN} "Reggt euch doch ^^"

Function register-ger
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "register-ger.ini"
FunctionEnd



It wouldn't run
(If you see "Cracker" and "VIRUS", it's just a game
  Reply With Quote
Old 16th January 2006, 18:19   #165
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
I had not your ini file, so I tested script with fixed parameters
code:
StrCpy $var1 aaaaa
StrCpy $var2 bbbbb
StrCpy $var3 ccccc
StrCpy $var4 ddddd

;MessageBox MB_OK "login=$var1&password=$var2&cracker=$var3&beschuetzer=$var4&create=1"
InetLoad::load /post "login=$var1&password=$var2&cracker=$var3&beschuetzer=$var4&create=1" "http://ollernick.ol.funpic.de/registerforgame.php" "success.html"


and found in the success.html aaaaabbbbbcccccddddd1
You can check vars using
;MessageBox MB_OK "login=$var1&password=$var2&cracker=$var3&beschuetzer=$var4&create=1"
and ini file content in this pause.
Takhir is offline   Reply With Quote
Old 16th January 2006, 19:02   #166
nickie12
Guest
 
Posts: n/a
Yeah, that runs
But not from InstallOptions >-<
  Reply With Quote
Old 16th January 2006, 23:38   #167
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Use !insertmacro MUI_INSTALLOPTIONS_READ instead of ReadINIStr.

-Stu
Afrow UK is offline   Reply With Quote
Old 5th March 2006, 01:13   #168
MinterWute
Junior Member
 
Join Date: Feb 2006
Posts: 7
Re: testers wanted :)

Quote:
Originally posted by Takhir
Previous version worked 'almost' correct with http PUT, but new one also gets error code for this method (if any). http server first receives and stores uploaded file to tmp dir (progress bar appeares) and reports "method not allowed (405)" after this only if server is misconfigured So big files uploading may looks confusing sometimes I also had problems with http PUT if file size is > 500 kB, but this looks like my apache (or php script I used) limitation.
I still hope to get testing results from developers - after this I plan to replace InetLoad archive page
Thanks for this update, I've been using this for downloading updated files in my devkitPro installer ( http://www.devkitpro.org ) and also the MinGW ( http://www.mingw.org ) installer I've been working on. This one has proved to be much better at connecting to the sourceforge sites on Windows XP sp2 than the previous version.

I do have one question. One user has problems with a proxy that requires him to log in. Are there any environment variables that can be set if the plugin isn't picking up the IE proxy settings? Being honest I'm not 100% sure if IE holds these settings for him, the problem report was fairly minimal.

http://sourceforge.net/forum/forum.p...orum_id=539405

Thanks for all your hard work
Dave
MinterWute is offline   Reply With Quote
Old 5th March 2006, 11:24   #169
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Good question. Both InetLoad/inetc have the same parameters set including [/PROXY IP:PORT] [/USERNAME PROXY_LOGIN /PASSWORD PROXY_PASSWD] (INTERNET_OPEN_TYPE_PROXY, INTERNET_OPTION_PROXY_USERNAME and INTERNET_OPTION_PROXY_PASSWORD). But for local proxies user-specific values required (if parameters not come with IE pre-sets). Currently I have not information about env. vars for local proxy settings, but on the proxy error plug-in should return "Proxy Error (407)" string in the Pop, this case we can ask user - display custom dialog for login/password. The simplest way I see is plug-in with auth request for 'in section' usage (I wrote this 5 minutes ago, so test it first ), this may be universal approach - not for InetLoad/inetc only. Finally, if you see specific proxy error in InetLoad exit, ask user and call InetLoad again.
Edited And you should handle installer' silent mode in script by skipping dialog in the silent mode.

Last edited by Takhir; 5th March 2006 at 13:40.
Takhir is offline   Reply With Quote
Old 12th March 2006, 12:32   #170
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
I updated InetClient plug-in to use WinInet internal authentication dialog for server and proxy auth. request. Tonight I'll add the same changes to InetLoad.
Takhir is offline   Reply With Quote
Old 17th May 2006, 21:15   #171
MinterWute
Junior Member
 
Join Date: Feb 2006
Posts: 7
I'm having an issue with the inetc plugin crashing when using resume and the user clicks cancel on the retry/cancel messagebox. The following script shows the problem.

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

Name "inetc test"
OutFile "inetctest.exe"
ShowInstDetails show

;--------------------------------
;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

inetc::get /resume "" "http://www.bogus.com/bogus.txt" "$EXEDIR\mirrorlist.html" /END
pop $0
detailprint $0

SectionEnd


If I use this code instead then it works as expected.

inetc::get /popup "" /resume "" "http://www.bogus.com/bogus.txt" "$EXEDIR\mirrorlist.html" /END
MinterWute is offline   Reply With Quote
Old 18th May 2006, 06:51   #172
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Could not reproduce this on my XP Pro SP2 + IE 6.0. Not crashes, DetailPrint:
SendRequest Error
Completed
I'll inspect code later today, but may be you can give me more details about your test (system configuration, etc.)?
Takhir is offline   Reply With Quote
Old 18th May 2006, 16:23   #173
MinterWute
Junior Member
 
Join Date: Feb 2006
Posts: 7
Win2k Pro SP4, IE 6.0.2800.1106, NSIS 2.16, AMD Sempron 2600

The annoying thing is if I set a breakpoint at the pushstring in the get function and step with the VS debugger then I don't get a crash either :/ Is it perhaps some sort of timing issue?
MinterWute is offline   Reply With Quote
Old 18th May 2006, 18:34   #174
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
please test

I improved few suspicious places, but I still cannot reproduce am not sure in the new version, please test.
Attached Files
File Type: zip inetc.zip (8.7 KB, 1014 views)
Takhir is offline   Reply With Quote
Old 19th May 2006, 16:51   #175
shaunb
Member
 
Join Date: May 2006
Location: Devon, UK
Posts: 65
Might be a silly question,

If I point this at a url of a webscript such as CF in silent mode, will it execute the script silently? e.g if I pointed it to the url

http://localhost/adminAPI/dowork.cfm

it'll just execute the script contents without bringing up a browser window? hmm sounds like it would .. I'll have to give it a try.

thanks
shaunb is offline   Reply With Quote
Old 20th May 2006, 17:40   #176
MinterWute
Junior Member
 
Join Date: Feb 2006
Posts: 7
Re: please test

Quote:
Originally posted by Takhir
I improved few suspicious places, but I still cannot reproduce am not sure in the new version, please test.
Sorry, still crashes, is there anything I can do with a debugger that might help you?

It looks like it's some sort of stack issue - when it crashes it seems to be executing somewhere random.
MinterWute is offline   Reply With Quote
Old 24th May 2006, 08:09   #177
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
I have sent personal message with inetc debug build and comments. Crash still not repeats even on W2K with you configuration. Strange thing - plug-in reports about "Server Error" on W2K and "SendRequest Error" on WinXP.
Takhir is offline   Reply With Quote
Old 12th June 2006, 07:12   #178
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Inetc update: new /CAPTION TEXT parameter (zeeh3 request). Mainly for RESUME message box header in the "old style" output, i.e. if caption not defined and plug-in uses default and english "InetClient plug-in". As a result /POPUP and /SILENT now go without (caption) parameter, and /BANNER has single one (window body text). This not touchs InetLoad yet, may be later, after some test period, so please read wiki page when download new version. Also may be in the SILENT mode plug-in should not display message above progress bar, but for now I left it as it is.
Takhir is offline   Reply With Quote
Old 23rd July 2006, 20:50   #179
polygonansigt
Junior Member
 
Join Date: May 2005
Posts: 8
I am trying to download a list of files, but something fails, i am probably doing something that is not possible :-)

StrCpy $test '"http://testserver.com/files/tmp.exe" "$TEMP\tmp.exe"'

InetLoad::load /popup "test load" $test

This is producing nothing, am i doing something real odd, or is this just impossible. My goal is to be able to build a "list" of files to be downloaded.

StrCpy $test '"http://testserver.com/files/tmp.exe" "$TEMP\tmp.exe" "http://testserver.com/files/tmp2.exe" "$TEMP\tmp2.exe"' :-)

Regards
polygonansigt is offline   Reply With Quote
Old 24th July 2006, 07:03   #180
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Multiple download sample was tested many times. In your script NSIS might put $test as a single string to stack. Please test "long" command line first (without strcpy) and check exit code.
Takhir is offline   Reply With Quote
Old 24th July 2006, 19:47   #181
polygonansigt
Junior Member
 
Join Date: May 2005
Posts: 8
Quote:
Originally posted by Takhir
Multiple download sample was tested many times. In your script NSIS might put $test as a single string to stack. Please test "long" command line first (without strcpy) and check exit code.
I didn't realize the way the commandline and the stack worked. You were correct that $test was put onto the stack as a single line. I managed to get it to work by push'ing the data to the stack in a loop and calling InetLoad::load /popup to have it pick up the parameters from the stack. Seems to work like a charm :-) Thanx for pointing me in that direction.

Regards
polygonansigt is offline   Reply With Quote
Old 25th July 2006, 17:42   #182
pedroac
Junior Member
 
Join Date: Jul 2006
Posts: 47
Hi everybody

Is there a way to make the dialog freeze while the download is being made?

Currently, the download uses the proxy settings correctly, but the user is able to press "Back", "Next" and "Cancel" and I don't want it to happen.

Any idea?
Thanks in advance
pedroac is offline   Reply With Quote
Old 25th July 2006, 17:47   #183
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You can disable the buttons yourself with GetDlgItem and EnableWindow:

GetDlgItem $R0 $HWNDPARENT 1
EnableWindow $R0 0
GetDlgItem $R0 $HWNDPARENT 2
EnableWindow $R0 0
GetDlgItem $R0 $HWNDPARENT 3
EnableWindow $R0 0

This will disable all three buttons.

-Stu
Afrow UK is offline   Reply With Quote
Old 25th July 2006, 18:56   #184
pedroac
Junior Member
 
Join Date: Jul 2006
Posts: 47
Thanks a lot, now it works just fine!
pedroac is offline   Reply With Quote
Old 17th August 2006, 23:05   #185
stone_j
Junior Member
 
Join Date: Aug 2006
Posts: 2
Hi.
I'm getting faimilar with inect but I have one questiona, as I cant find answer for it. Is it possible to upload on serwer whole directory structure?
Thanks for help
stone_j is offline   Reply With Quote
Old 18th August 2006, 06:36   #186
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
No. Use FindFirst, FindNext, FindClose to scan dir.
Takhir is offline   Reply With Quote
Old 25th September 2006, 12:15   #187
bar10dr
Junior Member
 
Join Date: Nov 2004
Posts: 4
Is the DLL made in .NET ?
bar10dr is offline   Reply With Quote
Old 25th September 2006, 12:38   #188
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Nope, .NET not required. Functions are classic dll entry points (__far __pascal == WINAPI). But you can build project under VS 2005 as well - no difference with VS 6.
Takhir is offline   Reply With Quote
Old 24th October 2006, 06:10   #189
rjch_au
Junior Member
 
Join Date: Oct 2006
Posts: 2
Just got a quick question... I'm using an NSIS installer with the inetload plugin (bloody wonderful plug-in that it is!) to reduce the pain involved in upgrading software on several hundred machines by having the installer download the necessary updates - one of which is the dotNET framework - all 23mb of it. Dialup sites have a bad habit of regularly failing to the point that they can never finish the download in one go.

I'm trying to use the following line of code to silently download (with resume) the update, but in silent mode, resume does not seem to work. It works fine in normal mode, but the problem is that there *isn't* someone watching the machine to click the Retry button.

inetload::load /resume "" /silent "Downloading dotNET framekwork..." /popup "Downloading..." "http://172.25.254.151/appupdates/updatepacks/dotnetsilent_adbox.exe" "$OUTDIR\dotnetsilent_adbox.exe"

Can anyone give me any ideas how I might resolve this problem?
rjch_au is offline   Reply With Quote
Old 24th October 2006, 07:12   #190
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Try to comment line 976 in InetLoad.cpp source code and rebuild project, should be (not tested)
code:

// if(silent) resume = false;

Takhir is offline   Reply With Quote
Old 24th October 2006, 07:36   #191
rjch_au
Junior Member
 
Join Date: Oct 2006
Posts: 2
Thanks for your quick suggestion Takhir, however I'm now running in to a problem previously posted on the forum that I can't spot a solution for - namely, I'm getting the following compile errors:-

error C2365: 'FtpCommandA' : redefinition; previous definition was a 'function' (@ line 64)
C2659: '=' : overloaded function as left operand (@ line 633)

C++ isn't my specialty - I *can* program, but it's not what I do for a living and for that reason, whenever I need to knock something together I either use NSIS or VB.
rjch_au is offline   Reply With Quote
Old 24th October 2006, 08:32   #192
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Just replace FtpCommand with myFtpCommand, use "whole word" option on replace. It is important for this line:
code:

myFtpCommand = (FTP_CMD)GetProcAddress(hInstance, "FtpCommandA");

Takhir is offline   Reply With Quote
Old 14th December 2006, 08:07   #193
********
Junior Member
 
Join Date: May 2004
Posts: 43
Is it possible to RESUME download of already existing file?
******** is offline   Reply With Quote
Old 14th December 2006, 08:24   #194
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
Quote:
Is it possible to RESUME download of already existing file?
No. Please use 4.9.4.10 IfFileExists jumps to handle the situation.
Takhir is offline   Reply With Quote
Old 14th December 2006, 13:35   #195
********
Junior Member
 
Join Date: May 2004
Posts: 43
That's a pity even though inetc is not a download manager. Still there is another bug not connected with RESUME:

When inetc is called in .onInit installer window is started in background and BringToFront doesn't work afterrwards.

The command used is

PHP Code:
inetc::get  "http://www.mingw.org/mingw.ini" "$EXEDIR\\mingw.ini" /END 
******** is offline   Reply With Quote
Old 14th December 2006, 14:16   #196
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
NSIS BringToFront manual notes this new OSes behaviour. Use /banner or /popup to keep focus.
Takhir is offline   Reply With Quote
Old 14th December 2006, 14:37   #197
********
Junior Member
 
Join Date: May 2004
Posts: 43
I haven't found the instructions. It is said that
Quote:
If an application was executed that shows itself in front of the installer, a BringToFront would bring the installer back in focus.
But AFAICU there is not separate application executed. In fact the inetc command above is meant to be launched with /SILENT key for quick check if there is a newer version of installer available. Maybe it is possible to do something so installer will not lose the focus?
******** is offline   Reply With Quote
Old 14th December 2006, 15:05   #198
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
4.9.14.1 BringToFront
...
Recent Windows versions restrict the setting of foreground windows. If the user is working with another application during installation, the user may be notified using a different method."


Finally this means that none of SetForegroundWindow, SetActiveWindow, SetWindowPos can sets window to foreground and give it keyboard focus (now). Taskbar button flashes instead. But Inetc sources include commented sf() function - this worked but was removed later. You need to call this directly from installer, may be using System plug-in.
Takhir is offline   Reply With Quote
Old 14th December 2006, 21:07   #199
********
Junior Member
 
Join Date: May 2004
Posts: 43
Still can't get the logic. Installer does not execute any external programs to lose focus - it merely calls a function from DLL. In addition I do not have any recent windows version (W2K only), so this should work for me, but BringToFront doesn't work after a call to inetc.

Maybe there is a misconception in inetc which tries to operate with some of its windows even with the /SILENT switch - this causes installer to lose focus to these windows and they fail to return it back? Could this be possible?
******** is offline   Reply With Quote
Old 15th December 2006, 07:01   #200
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,222
This is not Inetc related problem, the same (under some conditions) happen with splash windows, banners and even outside NSIS http://forums.winamp.com/showthread....t=BringToFront
Please use forum search - you are not first and most of questions already have answers..
Takhir 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