JoeMcC00L
26th July 2006 23:09 UTC
IP address control
Hello,
I have been doing a bit of research on how to implement an IP-Address box in an NSIS installer. For those of you who are familiar with writing MFC apps using Visual Studio, I'm trying to achieve the equivalence of an "IP Address Control."
Basically I want the textbox to look like a normal one, except with four periods. Here is an example:
http://joe.jmcc00l.googlepages.com/maskedtextbox.bmp
When the user tries to type something in, I want to restrict their input to only numbers, three digits at a time. For example, when I type in "192" I want the cursor to parse just past the first period. In the case "." is typed I want to parse past the next period. This is implemented in Windows' TCP/IP connection properties dialog, which can be reached in WinXP by opening Network Connections and right clicking on a connection->Properties and clicking on Internet Protocol(TCP/IP) and clicking Properties button.
I know it's not straightforward to do something like this using InstallOptions, but I would like to know if any of you have seen or written a plugin that might help. As always, any help is greatly appreciated :D.
Sincerely,
Joe
Afrow UK
27th July 2006 00:06 UTC
You could try my PassDialog serial page, which sort of does this, except you'd need to edit the code so that it only accepts numbers (or you could just do a validation check on page leave).
http://nsis.sf.net/File:PassDialog.zip
-Stu
JoeMcC00L
27th July 2006 14:56 UTC
Thank you for the quick reply. Great work on the plugin. This is very close to what I want, but not quite.
I guess I should have cleared this up in my initial post: I currently have an InstallOptions page that reads in two ip-addresses and two subnet masks (in form 192.168.1.0/16). Is there a way to incorporate this into an InstallOptions script (or something to that effect)?
Afrow UK
27th July 2006 17:31 UTC
Have you tried InstallOptionsEx?
-Stu
JoeMcC00L
28th July 2006 19:30 UTC
I've tried using InstallOptionsEx, but I couldn't even get the test script to display correctly. Also I've read that it's difficult to get this to work fine in MUI, especially if you're using regular InstallOptions. Would I have to resort to hacking the C++ code of the InstallOptions plugin?
Afrow UK
28th July 2006 20:02 UTC
Regular InstallOptions works fine with MUI and I don't see why IOEx won't work.
You don't need to use the MUI_INSTALLOPTIONS_* macro's at all.
They just mask the InstallOptions plugin calls with a friendlier syntax.
-Stu