/build/static/layout/Breadcrumb_cap_w.png

Get System IP-Address? (Oracle 10g)

I'm working on a msi-package for Oracle 10g.

An IP-Address is added in the registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\OracleMTSRecoveryService\Protid_0]
"Host"="IP-ADRESS"
"Name"="HTTP"
"Port"="2030"

The ip that is added is the ip on the computer i made the setup capture on. Is there anyway to make this dynamic, so that it takes the ip from the computer/s we will install the package on?



Thanks for a great board! I had ODBC-problems too but solved it by reading here!

0 Comments   [ + ] Show comments

Answers (12)

Posted by: jonasm 17 years ago
Blue Belt
0
Hi there!

I once made a VBS Custom Action to get the client IP.
Just be aware of that the registry will not change if the IP on the computer change.

I did rem some of it, to make it fit my case, maybe you need to modify it.
I have also changed so it only takes IP-adresses starting with "10."
Then can you just get the IP from the propery HOSTIP.

I have maked it to run "After InstallInitialized" and only when "NOT Installed"

Hope it works!

/Jonas

-------------------------------
Set objWMIService = GetObject("winmgmts:")
Set colNicConfig = objWMIService.ExecQuery("SELECT * FROM " & "Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
For Each objNicConfig In colNicConfig
' WScript.Echo "Network Adapter: " & objNicConfig.Index
' WScript.Echo " IP Address(es):"
'If NOT IsNull(objNicConfig.IPAddress) Then
For Each strIPAddress In objNicConfig.IPAddress
If left(strIPAddress,3) = "10." Then
RealIPAdress = strIPAddress
Session.Property("HOSTIP") = RealIPAdress
End If
Next
'End If
Next
------------------------------
Posted by: polkagris 17 years ago
Orange Belt
0
Hmm, ok.
So there is no "easy" way to do it. I was hoping to find a system variable or something like that containing the ip.
Script like that really isnt my thing...yet. I will have to learn but there isnt time for it now.

I will see if i can use it. Thanks.
Posted by: jonasm 17 years ago
Blue Belt
0
I also searched for easier ways, but I did not found any other way.

/Jonas
Posted by: aogilmor 17 years ago
9th Degree Black Belt
0
IMHO, you should be using Oracle's silent installation instead of capturing. This should go better for you, as it should get that automatically. Oracle silent installations have been covered in the packages section. If you run into any problems with that just let us know.
Posted by: polkagris 17 years ago
Orange Belt
0
jonasm:
I been reading more about vbscripts and I have been trying to use just that.

With your script i get on error for line: Session.Property("HOSTIP") = RealIPAdress

Error: Object Required: 'Session'



Know anything about that.?



I'm also having trouble to get some vb-scripts to work properly withing Wise Package Studio. They work fine alone outside the package. Is it something special I have to think about when calling them (path to the scripts and wscript.exe etc is correct)? For example, put it in deffered section or immediate.
Posted by: polkagris 17 years ago
Orange Belt
0
I solved it by putting the vb-script in a Wise Script (Execute VBScript in WiseScript Editor).
When putting it in a wise script i could set a wise script variable in the vb-script. Then i used that variable to update the registry key.
Posted by: jonasm 17 years ago
Blue Belt
0
Yeah, sorry, that was what I was going to write, but I have been in meeting all the day.

/Jonas
Posted by: DishaDisha 16 years ago
Senior Yellow Belt
0
This script saved me!Thanks a bunch!
Posted by: spartacus 16 years ago
Black Belt
0
Using a fixed IP address for the host value in the registry sounds risky, IMHO. What happens if the local machine IP address changes - e.g. in a DHCP environment ?

Instead, you could try either putting the local machine name in this value - which is much easier to retrieve using the "ComputerName" property, or try entering the localhost address, 127.0.0.1, as the host value instead.

What may also be worth trying would be to omit the host registry value from the package and then see if the OracleMTSRecoveryService writes the registry setting dynamically with the correct address when the service starts.

Regards,

Spartacus
Posted by: anonymous_9363 16 years ago
Red Belt
0
Using a fixed IP address for the host value in the registry sounds risky, IMHO. What happens if the local machine IP address changes - e.g. in a DHCP environment ?Graham, whatever the IP address is, that script will pick it up, irrespective of whether it's static of provided by DHCP. I'm wondering how it would cope on machines with my than one adapter, mind... Not a typical scenario, that's true, but I like my solutions to be as bullet-proof as possible. There's probably additional code that could be added to determine which is the primary adapter, I guess, but as it stands, it rates an 'OK'.
Posted by: vishaujjain121 13 years ago
Senior Yellow Belt
0
hi

Pease let me know that how i can overcome the OracleMTSrecovery service error as i am doing silent installation for oracle 10g.

am creating response file but if i do silent installation then this service gets evoke and unable to apply the patch silently after that.

please suggest me on this..
Posted by: anonymous_9363 13 years ago
Red Belt
0
Two sins in one day: hijacking a thread over 2 years old AND duplicating a post.

Just because you don't get an answer in the timeframe you want, it's very bad form to start posting all over the fora. Thank you.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ