This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Validate ipaddress
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 10, 2009
01:57 PM
Validate ipaddress
Hello to the community.
I've been searching for days how to implement this simple task without success. I'll appreciative any help given.
I'm working with version 2010 on a basic msi project. I wish to integrate an ip address text field on a dialog box and have a control validate the ip for format.
I've used Masked edit box for character control but it doesn’t control for values outside of the 255 scope.
I've also noticed that you're unable to used the sunken=true option without the restricted border line. <###.###.###.###> creates 4 separate flat boxes which doesn’t match the style of the dialogs.
Thanks.
I've been searching for days how to implement this simple task without success. I'll appreciative any help given.
I'm working with version 2010 on a basic msi project. I wish to integrate an ip address text field on a dialog box and have a control validate the ip for format.
I've used Masked edit box for character control but it doesn’t control for values outside of the 255 scope.
I've also noticed that you're unable to used the sunken=true option without the restricted border line. <###.###.###.###> creates 4 separate flat boxes which doesn’t match the style of the dialogs.
Thanks.
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 18, 2009
07:46 AM
When i've done this i've tested the property using a vbscript custom acting which using regex in a vbscript. If it's invalid after the doaction then i spawn and invalid dialog which is conditioned on the property created by the script VALIDIP
Heres the script:
Option Explicit
Dim myRegExp: Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = "^(([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+))$"
Dim myMatches: Set myMatches = myRegExp.Execute(Session.Property("MYIPADDRESSPROPERTY"))
If myMatches.Count > 0 Then
Session.Property("VALIDIP") = "True"
Else
Session.Property("VALIDIP") = "False"
End If
Heres the script:
Option Explicit
Dim myRegExp: Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = "^(([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+))$"
Dim myMatches: Set myMatches = myRegExp.Execute(Session.Property("MYIPADDRESSPROPERTY"))
If myMatches.Count > 0 Then
Session.Property("VALIDIP") = "True"
Else
Session.Property("VALIDIP") = "False"
End If
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 29, 2019
01:56 AM
Hi,
we saw you solution for ip validation
where the script should be triggered?
is it CA right?
thanks
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)