Old 5th October 2003, 13:01   #41
DrO
 
Join Date: Sep 2003
Posts: 27,873
Quote:
Originally posted by Afrow UK
you obviously must know quite a bit!
enough to get by with

is mainly from playing around with things (all self taught though i wonder why at times ) that i've learnt win32 and even then i still have to research things / spend hours working out why it won't work but that's the same with anything really

-daz

[edit]
p.s. starts a second page here @ n0On3
[/edit]
DrO is offline  
Old 5th October 2003, 13:18   #42
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
That's the way I get taught.
I know a few basic languages inside out by making the same program for my game in the different languages.
My programs basically read through a Quake2 log file getting the number of kills the entered name has done, how many deaths etc for specific weapons.

So far I've done it in Basic, QuickBasic, Perl and C
I'm looking forward to getting MS Visual Studio but that will come once I have finised school.

-Stu
Afrow UK is offline  
Old 5th October 2003, 13:59   #43
DrO
 
Join Date: Sep 2003
Posts: 27,873
i remember basic first language i learnt back on my old atari ste (one for the history books and i've still got it).

only do c now since it's straight forward, have dabbled a bit in c++ but not enough to be able to do it all the time.

learnt the basics of c at uni and then win32 for my final project (a little editor and development thing for some DOS tools from the first year).

still developing the thing so that i can have a MDI text editor with customisable syntax highlighting of my source files. also worked on a thing to allow most windows and dialogs to 'dock' to the screen edge or the inside of MDI window eg Excel and that as linux does - makes positioning of windows easier to do but still have a few bugs with the code when it's closed down (but with recent stuff i've done here i think i may have the solution to the problems)

File reading is the fun stuff to do windows hooks and subclassing are a real pain in comparison at times

-daz
DrO is offline  
Old 12th October 2003, 18:36   #44
n0On3
Senior Member
 
n0On3's Avatar
 
Join Date: Jan 2001
Location: Barcelona
Posts: 314
Send a message via ICQ to n0On3
hi, I used v0.98 beta 3 and still have the extra fourth button. I don't know how it got there

PHP Code:
MessageBox::Show MB_TOPMOST|MB_ICONQUESTION "Can't Move, Copy instead?" "" \\
`
We can't move through different drives.$\nBut we can copy and delete if no errors` \\
"Copy && Delete" "Copy" IDCANCEL 
n0On3 is offline  
Old 13th October 2003, 17:01   #45
DrO
 
Join Date: Sep 2003
Posts: 27,873
can you post a screen shot of what's appearing for you. also what OS are you using?

i will have a look at the code again in a bit but i can't think what could be going wrong

also did this version definitely fix the crash issue you were having in the earlier versions?

-daz
DrO is offline  
Old 14th October 2003, 14:46   #46
n0On3
Senior Member
 
n0On3's Avatar
 
Join Date: Jan 2001
Location: Barcelona
Posts: 314
Send a message via ICQ to n0On3
yes, it seems that the silent crash is gone

I attach a snap. Using Win98se
Attached Images
File Type: png zero.png (3.5 KB, 391 views)
n0On3 is offline  
Old 14th October 2003, 15:09   #47
DrO
 
Join Date: Sep 2003
Posts: 27,873
thanks for the picture and it's what i expected to see.

i managed to reproduce the problem and it's down to there being other values on the stack. the function will read in until it gets to the 4 button limit or there is nothing else on the stack hence what you get.

best option i can think of would be to add a control character on for the last button to ensure that the correct number of buttons are added
e.g. IDYES "blah" \eIDCANCEL

-daz
DrO is offline  
Old 14th October 2003, 21:48   #48
n0On3
Senior Member
 
n0On3's Avatar
 
Join Date: Jan 2001
Location: Barcelona
Posts: 314
Send a message via ICQ to n0On3
ah, so the problem is the stack...

do all plugins read parameters from stack?
n0On3 is offline  
Old 15th October 2003, 10:39   #49
DrO
 
Join Date: Sep 2003
Posts: 27,873
yep, that's how they are passed for the plugin to get them. the issue with this plugin is that it takes variable parameters unlike most other plugins which accept a fixed number of parameters - hence the problem with reading what is available.

so the options are:
* a control flag on the last button
* assuming that if the stack parameter converts to a number to stop
* to control the number it expects (as in older versions)
* ensure the stack is clear before using the function

personally i think the first option is the easiest to use. didn't have enough time to make the above alteration last night, will be up by tomorrow.

-daz
DrO is offline  
Old 15th October 2003, 22:00   #50
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
You can do what the author of UnTGZ has done. He forced an extra stack push of "--" for inputs of variant sizes. It's the most elegant and simple way in my opinion. Forcing a flag on the last button might cause the user to delete it when editing or move it around when moving the buttons.

BTW, nsisdt uses the $0 variable

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline  
Old 16th October 2003, 06:12   #51
DrO
 
Join Date: Sep 2003
Posts: 27,873
yeah the flag option has it's issues
i'll have a look at what you've mentioned, thanks.

-daz
DrO is offline  
Old 17th May 2004, 18:06   #52
scully13
Senior Member
 
Join Date: Apr 2004
Posts: 130
Can somebody help me out on this one. Here is the code I'm using:
messagebox::show "MB_ICONQUESTION" "" "" "$(TEXT_INSTCLIENT_MSG)" "$(TEXT_YES_MSG)" "$(TEXT_NO_MSG)"
I keep getting a third button like what is described above. I've tried the possible fixes except I can't figure out how to clear the stack to make the third button go away. I tried the control flag "\e$(TEXT_NO_MSG)" but then it just shows up in the buttons text. It also looks like the last option is one he was talking about putting back in but never did. Is there a newer version of this available or can somebody show me a workaround?
scully13 is offline  
Old 1st February 2005, 21:17   #53
superwan
Senior Member
 
Join Date: Aug 2004
Posts: 109
and I'm upping this topic because I think you should explain in your txt what is the id of an icon group


I have this code :
code:

messagebox::show MB_ICONEXCLAMATION|MB_ICONHAND|MB_TOPMOST "$(question_hercules)" \
"another_software.exe,103" \
"$(messagebox_hercules)" $(yes) $(no)



and I didn't find the good value for "103"

resource hacker gave me the good values...

say it in your help file


see ya and thx for your great plugin dro
superwan is offline  
Old 8th February 2005, 18:08   #54
superwan
Senior Member
 
Join Date: Aug 2004
Posts: 109
hello

I have this messagebox :


code:
messagebox::show MB_YESNO|MB_ICONEXCLAMATION|MB_TOPMOST "$(question_hercules)" \
"0,103" \
"$(messagebox_hercules)$\n" "$(yes)"

Pop $0
StrCmp $0 "1" yes
StrCmp $0 "2" no




But I have no sound when it appears
I'd like that a window "question" sound comes...

How can I do ?


thx for your answers
superwan is offline  
Old 8th February 2005, 20:14   #55
DrO
 
Join Date: Sep 2003
Posts: 27,873
point 1: yeah, i agree on that. i also really need to just better document the plugin (as well as finding the source code for it on my old machine otherwise it's re-write time which in some ways could be a good thing i think and since there's a decent changelog in the zip i can re-work things if needed that way)

point 2: not sure to be honest, only thing i can think of is that you don't have a sound assigned to that system action (you'd need to check in the sound properties dialog)

-daz
DrO is offline  
Old 8th February 2005, 20:34   #56
superwan
Senior Member
 
Join Date: Aug 2004
Posts: 109
are saying that this code is giving you a sound ?
superwan is offline  
Old 8th February 2005, 20:53   #57
DrO
 
Join Date: Sep 2003
Posts: 27,873
i've just looked through some info on msdn and the MessageBeep(..) needs to be called. as a work around you can use the system plugin to manually do this.

i think i will just do a complete re-code of the plugin and i'm noting down to have sound support in there as well (for some of my Winamp plugins i need to alter a standard messagebox so i intend to make a general core which will work for them and as a nsis plugin for this)

just as i was about to post i did a quick system scan and i've found what looks like the source code for 0.98beta (first one i believe) so i'll do a bit more and see what else i can find since if i can get 0.98b3 that'll make my life easier)

-daz
DrO is offline  
Old 8th February 2005, 22:41   #58
superwan
Senior Member
 
Join Date: Aug 2004
Posts: 109
yeah

this is cool

I'm waiting for it

"bon courage" like we say in France see ya
superwan is offline  
Old 11th July 2005, 15:15   #59
Comperio
Major Dude
 
Comperio's Avatar
 
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
Hey DrO,
This might be a moot point if you are still planning to re-write, but I thought I'd mention it:

In your latest reslease (v0.98 beta 3), I still get a crash with the silent install.

To recreate, just run the file messagebox_s.exe included with the package. The crash occurs on the message box that reads "And for the special options"

I've attached a screenshot of the message box that generates the error. i also noticed that the "no" button should be named "m12if you can!"

Here's the text of the error:
The application, , generated an application error The error occurred on 07/11/2005 @ 07:54:13.718 The exception generated was c00000fd at address 100023B4 (<nosymbols>)

This is nothing urgent--just letting you know.
Thanks!
Attached Images
File Type: png messageboxexample.png (1.5 KB, 341 views)
Comperio is offline  
Old 5th August 2005, 23:59   #60
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,363
btw, nsis (english translation) officially uses "OK" and not "Ok", like that messagebox plugin (IDOK)
Yathosho is offline  
Old 12th November 2005, 12:48   #61
donovaly
Junior Member
 
Join Date: Nov 2005
Posts: 3
Hello DrO,

I am using your MessageBox plugin v0.98 beta 3.

I found two bugs:

1. when I use you plugin in a section twice without pop $0 between them, I get three buttons in the second messagebox. Here an example script:

-------------------------
OutFile "MessageBoxTest.exe"

; Installer sections
Section "-Installation actions" SecInstallation

messagebox::show MB_ICONINFORMATION|MB_DEFBUTTON1 "" "" "test" "Download Now" "Download Later"
; Pop $0 ; without this the next messagebox will have three buttons although only two are defined!!!

messagebox::show MB_ICONINFORMATION|MB_DEFBUTTON1 "" "" "test2" "Download Now" "Download Later"
Pop $0
StrCmp $0 "1" 0 readyTest ; pressed "Download Now"
ExecShell "open" "http://google.com/"
readyTest:

SectionEnd
-----------------------------

2. When I use your plugin in the .onInit function my installer always crashes. Here an example script:

-----------------------------
OutFile "MessageBoxTest.exe"

Section

SectionEnd

Function .onInit

messagebox::show MB_ICONINFORMATION|MB_DEFBUTTON1 "" "" "test" "Download Now" "Download Later"

messagebox::show MB_ICONHAND|MB_DEFBUTTON2 "" "" "and for the special options...$\n" "IDYES" "m12if you can!"

ClearErrors
FunctionEnd
-----------------------------

Could you help me with this bugs or do I have bugs in my scripts.
Thanks in advance and regards
Attached Files
File Type: nsi messageboxtest.nsi (891 Bytes, 318 views)
donovaly is offline  
Old 5th December 2005, 00:39   #62
vbgunz
Senior Member
 
Join Date: Jun 2003
Posts: 284
Send a message via AIM to vbgunz
I too am also experiencing this problem
vbgunz is offline  
Old 5th December 2005, 01:05   #63
DrO
 
Join Date: Sep 2003
Posts: 27,873
because the plugin uses a variable parameter list you need to ensure that the stack is in a 'clean' state otherwise it will start pulling more than it should do (as you've come across). there was a post a few up by kichik about using a terminating parameter to indicate the end of the params.

as for the crash, i've managed to find the source code for 0.98 beta 1. i'm not sure where the beta 3 code is (could be on my old dev machine still...) i'll see if i can at least get the code working again and fix up some of the issues that i'd fixed from b1 to b3 and hopefully the issue you're having as well

-daz
DrO is offline  
Old 5th December 2005, 03:32   #64
vbgunz
Senior Member
 
Join Date: Jun 2003
Posts: 284
Send a message via AIM to vbgunz
How do I apply what Kichik mentioned a few post up? I am not sure although I tried pushing before and after this plugin and failed to work around it

Also, if you do plan on re-writing the code can you possibly add in support for jumps much like how MessageBox Handles them now?
PHP Code:
e.gmessagebox::show "" "Title" "" "Body" '"B_A" +12' '"B_B" -12' '"B_D" .DONE' 
I find the idea of $Pop and $StrCmp a bit cumbersome... Do you think you can add in support for jumps right pass the buttons somehow (all on the same line)?

Thank you DrO, I find the plugin very promising. Thank you again!
vbgunz is offline  
Old 5th December 2005, 08:39   #65
vbgunz
Senior Member
 
Join Date: Jun 2003
Posts: 284
Send a message via AIM to vbgunz
I found this link (http://forums.winamp.com/showthread....212#post935212) in the forums and tried out what Virtlink said. It seems to work as advertised...
PHP Code:
LoopAgain:
 
Pop $R9
 IfErrors Done LoopAgain
Done

vbgunz is offline  
Old 5th December 2005, 12:11   #66
DrO
 
Join Date: Sep 2003
Posts: 27,873
the post by kichik was a suggestion on how the plugin could be fixed to handle the multiple parameters better.

i've been out of the loop on any real nsis coding for a while so i'm not sure if plugins are able to do what you're asking for with the jumps so i can't say. the other option is to have a quick macro in place to wrap things up for such a case (is something i'd need to look into to see if it's viable or not, etc)

Quote:
Do you think you can add in support for jumps right pass the buttons somehow
not quite sure what you mean by that

-daz
DrO is offline  
Old 5th December 2005, 12:49   #67
DrO
 
Join Date: Sep 2003
Posts: 27,873
i've managed to get the 0.98 beta 1 code compiling on my machine here at work and that example script doesn't crash for me but beta 3 does so i broke something with beta 3.

i've just added in /end needing to be on the end of a call to the plugin's function which fixes all of the pop fun since i can now at least only process what's needed and not anything else (will have to make sure it's working 100% though before i do anything else with it).

because of the state of the code i'm going to ditch a 1.0 and effectively re-code a fair chunk of it to aim towards a 2.0 since i also want to have the ability to have a checkbox on the bottom of the messagebox for setting as a default action type of thing.

it's going to take a few days for me to get upto speed with the code again but should have at least a fixed working build by the middle of the week

-daz
DrO is offline  
Old 5th December 2005, 19:16   #68
vbgunz
Senior Member
 
Join Date: Jun 2003
Posts: 284
Send a message via AIM to vbgunz
What I meant was instead of...
PHP Code:
messagebox::show "" "Title" "" "Body" "B_A" "B_B" "B_D"
pop $
StrCmp 
$0 1 +12
StrCmp 
$0 2 -12
StrCmp 
$0 3 .DONE 
Something a bit more like this...
PHP Code:
messagebox::show "" "Title" "" "Body" `"B_A" +12` `"B_B" -12` `"B_D" .DONE
Just keeping it on one line like the traditional MessageBox instead of Popping and StrCmping just to Goto. Just an idea if you're really going to rewrite the code... Thanks Dr0!
vbgunz is offline  
Old 6th December 2005, 11:44   #69
vbgunz
Senior Member
 
Join Date: Jun 2003
Posts: 284
Send a message via AIM to vbgunz
I have a problem I am not too sure how to get passed. It involves nesting a variable within a temporary !define inside a !macro. Basically, I am trying to create a macro in which I would be able to use relative jumps a bit easier to get around...
PHP Code:
!macro messagebox TITLE BODY B1 X1 B2 X2 B3 X3 B4 X4
  Pop $R9 
# Clear the Stack...
  
IfErrors 0 -1
  messagebox
::show "" "${TITLE}" "" "${BODY}" "${B1}" "${B2}" "${B3}" "${B4}"
   
Pop $1
    IntOp 
$$1
  StrCmp 
$$${X$2} -1
!macroend 
In theory, the above will jump forward perfectly whereas jumping back would require I add on +5. This way though insures the jumps are predictable as where the following leads to a lot of math for relative jumps...
PHP Code:
!macro messagebox TITLE BODY B1 X1 B2 X2 B3 X3 B4 X4
  Pop $R9 
# Clear the Stack...
  
IfErrors 0 -1
  messagebox
::show "" "${TITLE}" "" "${BODY}" "${B1}" "${B2}" "${B3}" "${B4}"
   
Pop $1
    StrCmp 
$1 1 ${X1}
    
StrCmp $1 2 ${X2}
    
StrCmp $1 3 ${X3}
    
StrCmp $1 4 ${X4}
!
macroend 
Global jumps are no problem *but* I am really trying to get this to be relatively friendly. My problem in example 1 (line 6) is, I do not know how to nest the variable inside the define... I tried doubling the $, quotes, backslashes and am completely lost as to how to do it... Can anybody shed some light or some better code?

I might have mistakes in the code but am unable to test it out fully

Any help is greatly appreciated on this! Thank you!
vbgunz is offline  
Old 10th January 2006, 21:01   #70
TonyDS
Senior Member
 
Join Date: Jul 2003
Posts: 151
how do you include a custom icon, where do you put that icon (dll file) for it to recognised
TonyDS is offline  
Old 11th January 2006, 21:15   #71
TonyDS
Senior Member
 
Join Date: Jul 2003
Posts: 151
Anyone?
Dro

Please
TonyDS is offline  
Old 12th January 2006, 12:56   #72
DrO
 
Join Date: Sep 2003
Posts: 27,873
sorry for the delay in reply, real world kept me from a proper browse of the forums yesterday.

the icon needs to be in a resource dll if i remember correctly (the example script uses shell32.dll from memory). i'll try and double-check the code over tonight (if need be i can look at modifying to make a custom build which allows you to specify just a .ico to be used (should be a relatively easy change from what i rememeber of the icon api in windows)

-daz
DrO is offline  
Old 12th January 2006, 19:40   #73
TonyDS
Senior Member
 
Join Date: Jul 2003
Posts: 151
Thanks DrO for the reply,
No need to change it to a ico, (but if you want that would be great), I can easily make icon dll file, I just need to no where to place or extract the dll file too, so it works, I tried placing it in the system32 folder, but it didn't work I just got a blank space where a icon should have been.

That's just messing around with your default script, I'm not really bother about adding more button, it would just be nice if I could place a custom icon in it.

Plus I'm not really sure what to put in the script, whether you can specify a named custom icon as in "fred.dll,0" or does could you specify it as "$INSTDIR\fred.dll,0"

Thanks

Tony
TonyDS is offline  
Old 12th January 2006, 19:42   #74
DrO
 
Join Date: Sep 2003
Posts: 27,873
you'd need to specify a full path, the reason the shell32 one works is because it's already on the system's default search path

-daz
DrO is offline  
Old 12th January 2006, 19:48   #75
TonyDS
Senior Member
 
Join Date: Jul 2003
Posts: 151
ah ok I'll try it thanks mate
TonyDS is offline  
Old 12th January 2006, 20:30   #76
TonyDS
Senior Member
 
Join Date: Jul 2003
Posts: 151
Nah I can't get it to work, I've placed a dll file in the system32 folder, the dll file has 2 icons in it so the full path and icon number (for icon 2) would be "$SYSDIR\fred.dll,2" right?

It didn't work

It frustrating
TonyDS is offline  
Old 12th January 2006, 20:41   #77
DrO
 
Join Date: Sep 2003
Posts: 27,873
with that dll, open it up in resource hacker for example and look for a [icon group] value in the tree. check which icon group the icon you want to use is in and then use the id of that group. that works ok for me from what i can tell

-daz
DrO is offline  
Old 12th January 2006, 20:50   #78
TonyDS
Senior Member
 
Join Date: Jul 2003
Posts: 151
Ah this is why it probably won't work tried opening it with res hacker as you suggested, but Res Hack says its not a win32 executable file I made the dll file with Axialis IconWorkshop

Bugger
TonyDS is offline  
Old 12th January 2006, 22:30   #79
DrO
 
Join Date: Sep 2003
Posts: 27,873
use the attached dll for adding your icons into. it's a valid dll i built in msvc and i tested by manually adding an icon in with resource hacker and it worked for me

-daz
Attached Files
File Type: zip blah.zip (374 Bytes, 375 views)
DrO is offline  
Old 13th January 2006, 00:30   #80
TonyDS
Senior Member
 
Join Date: Jul 2003
Posts: 151
thank but that didnt work but it gave me an idea, I found a existing dll file it was a file called acctres.dll deleted all the crap out of it leaving two icon and replaced those with my icons

And it works

so thanks
TonyDS is offline  
Closed Thread
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