Skip to content
⌘ NSIS Forum Archive

Help with some code...

7 posts

myne#

Help with some code...

Ok, I've searched a little but I dont really know much more than the basics when it comes to programming. pop and push dont make any sense to me - sorry.


This is what I'm trying to do in pseudocode

;**
set intCounter 0

oninit
Check RegkeyClient. If exist set intCounter = IntCounter + 1
Check RegkeyServer. If exist set intCounter = IntCounter + 2

If intCounter == 3 then
{
popup msg box asking if you want Server or Client
If BoxClicked = Server then set intCounter 2
If BixClicked = Client then set intCounter 1
}
Endif

If intCounter == 2 then ReadRegStr $INSTDIR regKeyServer
If intCounter == 1 then ReadRegStr $INSTDIR regKeyClient
;**


If anyone could point me in the right directions it'll be appreciated.
kichik#
You don't need push and pop here. All you need is StrCpy (to set variables), ClearErrors, ReadRegStr, IfErrors, StrCmp or IntCmp, MessageBox and Goto. Use GetWindowsVersion as an example.
myne#
Thanks for the replies.

I've coded what seems like a good solution to me.
Does it seem too long winded?
One thing I wish is that I could change the text in the buttons without having to get a plugin.



Hopefully it'll help someone else.
Vytautas#
You should not need a plugin to change the texts of NSIS buttons, there are several defines that do that. Which button texts do you wish to change?

Vytautas
Vytautas#
If you were talking about the message boxes generated by 'MessageBox' command and none of the standard buttons are acceptible, e.g. OK Cancel, then you will need to use a plugin as these are windows message boxes and not NSIS ones.

Sorry for any confusion.

Vytautas 🙂