/bundles/itninjaweb/img/Breadcrumb_cap_w.png
Hi there!

I have a (wierd) application that needs to put the machines IP-adress in the registry.
Does anyone have any suggestions how to do this best?

I have been thinking about making a VBS to get the IP, but then I need to get the variable as a InstallShield String.
Isn't there any better way to do this?

Thanks!

/Jonas
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
I solved it with this VBS, but there must be a better way...

The HOSTIP is the propery that I uses where to set the IP-adress.

/Jonas

[hr]
Set objWMIService = GetObject("winmgmts:")
Set colNicConfig = objWMIService.ExecQuery("SELECT * FROM " & "Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
For Each objNicConfig In colNicConfig
For Each strIPAddress In objNicConfig.IPAddress
'Only get IP-adress if it starts with "10."
If left(strIPAddress,3) = "10." Then
Session.Property("HOSTIP") = strIPAddress
End If
Next
Next
Answered 10/17/2006 by: jonasm
Blue Belt

Please log in to comment
0
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set IPConfigSet = objWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")

For Each IPConfig in IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)
WScript.Echo IPConfig.IPAddress(i)
Next
End If
Next

________________________________________________
That script was generated with, "The Portable Script Center" (Free download) (http://www.microsoft.com/technet/scriptcenter)
Answered 10/18/2006 by: Secondlaw
Third Degree Blue Belt

Please log in to comment
0
Thanks for your reply.

I maybe wasn't clear enough, but with a "better way" I ment that there maybe was a InstallShield Property or kinda to get the IP-adress without making a VBS.

/Jonas
Answered 10/18/2006 by: jonasm
Blue Belt

Please log in to comment
0
Try a few of these:

http://community.macrovision.com/printthread.php?t=163146
http://www.installshield.com/news/newsletter/archives/0101_oragebrain.pdf
http://www.installsite.org/pages/en/isp_net.htm
http://support.installshield.com/kb/view.asp?articleid=Q105786

Hope that helps.
Answered 10/19/2006 by: Secondlaw
Third Degree Blue Belt

Please log in to comment
0
there is no default properties that do what you want. scripted is likely the best option.

secondlaws script could be tweaked to accomodate your session.property changes.
Answered 08/01/2011 by: jmcfadyen
Fifth Degree Black Belt

Please log in to comment