- NSIS Discussion
- inetload not passing info to MUI ?
Archive: inetload not passing info to MUI ?
grahama
18th June 2005 20:54 UTC
inetload not passing info to MUI ?
Is there a way to force InetLoad to pass its stuff to the MUI? something like: /MUI or /NSIS
For some odd reason,since I converted to logiclib, inetload is not passing downloads to the MUI. Instead, InetLoad is treating the below as a /BANNER. I ran the code in a clean test project and it works fine, so there must be a variable conflicting with InetLoad with my current project?
InetLoad::load "$source" "$destination" /END
Pop $0
${IF} $0 != "OK"
MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST \
"Download Error: $0 for file: $theFile, \
Click OK to abort installation" IDOK
Abort
${ENDIF
grahama
18th June 2005 22:14 UTC
On that note:
be great if setting the Mode would overide all the variables passed to inetLoad ...like $title and $bannerText
Then you could build a very handy generic download function
this below code works....but only if the mode = "/Banner"
Be great to input variables for inetLoad to process
So if $mode = "", only the $source and $dest variables are passed while $title and $bannerText is ignored
the code:
strcpy $theFile "version.xml"
strcpy $source "http://www.server.cc/$theFile"
strcpy $dest "$PLUGINSDIR\$theFile"
strcpy $bannerText "Checking for Updates...Please Wait"
strcpy $mode "/BANNER"
strcpy $title "My Title"
;
InetLoad::load "$mode" \
"$title" "$bannerText" \
"$source" "$dest" /END
Pop $0
${IF} $0 != "OK"
MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST \
"Download Error: $0 for file: $theFile, \
Click OK to abort installation" IDOK
Abort
${ENDIF}
Takhir
19th June 2005 10:08 UTC
InetLoad worked fine with Modern UI in my tests. The only szBanner string definition comes to plug-in with /banner option, and not empty szBanner string is the only case when Banner dialog is active. Your problem really looks like a messed variables in your code (and may be LogicLib macros).
/mode - I don't see what improvement this may give. And BTW /popup mode requires one string parameter (prefix), but /banner - 2 strings (caption and text), this case I'll need to add second empty parameter for /popup.. I am not sure right now if this is a real step forward :)
grahama
19th June 2005 15:46 UTC
is there a specific variable I need to clear out in NSIS before I call inetLoad ... kind of like the /END variable does? Is this the $szBanner variable?
strcpy $szBanner "", then call inetLoad
I thought about the above and then put the above into a CASE statement with $mode....Case "/POPUP", Case "/BANNER"
this works pretty well as I sometimes use inetload in the .oInit and sometimes in sections :)
be back in a week, as I am now off to the Grand Canyone for a white water vacation :) Full week of being totally unplugged...
Takhir
19th June 2005 16:44 UTC
No, szBanner is internal C variable in the InetLoad.c file. The only parameter plug-in takes from installer is extra->exec_flags->silent mode.
Off: ;) I already had 2 weeks of the 'spring bike vacations' - 900 km of mountain roads, Caucasus and Crimea http://ineum.narod*****g05s.htm
grahama
27th June 2005 23:52 UTC
Hi Takhir
I'm back from a week of class 5 rapids,flash floods, hail, and 11 mile uphill hikes :) From looking at your pictures, Caucasus and Crimea look quite beautiful.
I still can't seem to keep inetload from using /BANNER mode :( I tried using /POPUP too...but still get /BANNER. As an alternative, nsisdl:download works fine, but I am quite wary of using it as I have had many problems with this plugin.
is there no way to totally reset inetload or force it to pass info to the MUI
Or, for those who use LogicLib, is there some way to clear its variables so they do not conflict with inetLoad ?
My problems began the moment I began using LogicLib
In a simple example, LogicLib and inetLoad work fine. So, I am not sure where the error is....
guess I'll also see if there is a new version of LogicLib. Would really like to continue using it as it really simplifes the code
g
grahama
28th June 2005 01:27 UTC
within my project I killed all the variables like "$sourceURL/$theFile" in inetLoad and used a simple inetload::load "sourceUrl" "destination" /END
I'm still getting the /BANNER ?
this debug is getting a bit baffling
would hate to rebuild the entire project if clearing a couple of variables would do the trick
Takhir
28th June 2005 06:49 UTC
Can you give me a script with this problem? Please minimize it's size if possible.
ElvenProgrammer
28th June 2005 06:58 UTC
I had this problem when I wrong typed the name of a temp copy of the setup to be run. This way the temp copy wasn't updated but run, not receiving my modifications to the code. Maybe it could be the case, if not post further code ;)
grahama
28th June 2005 18:50 UTC
I finally got it....
Thinking this would take hours, I disabled the first function run in the .onInit....
What do you know, everything returned to normal. :)
Being on a deadline for this project, I have moved on to finish . Will probably get back to the WHY in two days as I would like to put this function back in the onInit.
Anyone know what would conflict here ?
the conflicting funtion:
Function preventLaunchingTwice
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_TOPMOST "The installer is already running."
Abort
FunctionEnd
;--------------------
here is a script I am using for inetload...it is pretty simple, but has come in handy for me as I use inetload for all sorts of things :)
Function GenericDownload
/*
Example Variables
strcpy $theFile "version.xml"
strcpy $source "$xmlDirectory/$theFile"
strcpy $dest "$PLUGINSDIR\$theFile"
strcpy $title "${FILETITLE}"
strcpy $bannerText "Downloading ${FILETITLE}...Please Wait"
strcpy $mode "/POPUP" | "" | "/BANNER" | "nsisdl"
*/
${Select} $mode
${Case} ""
InetLoad::load "$source" "$dest" /END
${Case} "nsisdl"
NSISdl::download /TIMEOUT=30000 $source $dest
POP $R0
strcpy $0 $R0
${Case} "/BANNER"
InetLoad::load "$mode" "$title" "$bannerText" \ $source" "$dest" /END
${Case} "/POPUP"
InetLoad::load "$mode" "${FILETITLE}" \
"$source" "$dest" /END
${EndSelect}
;
Pop $0
${IF} $0 != "OK"
MessageBox MB_OK|MB_ICONEXCLAMATION|MB_TOPMOST "Download Error: $0 for file: $theFile, \
Click OK to abort installation" IDOK
Abort
${ENDIF}
FunctionEND
I'm sure its not flawless but it has helped me reduced my code bloat a bit.
what would be cool...maybe a future nsis thing for functions:
Call GenericDownload($mode,$title,$bannerText,$source,$dest)