[openrtm-commit:01021] r695 - in trunk/jp.go.aist.rtm.RTC: Source/examples installer/resources/Source/examples
openrtm @ openrtm.org
openrtm @ openrtm.org
2013年 2月 20日 (水) 23:28:08 JST
Author: ga
Date: 2013-02-20 23:28:08 +0900 (Wed, 20 Feb 2013)
New Revision: 695
Modified:
trunk/jp.go.aist.rtm.RTC/Source/examples/start-orbd.vbs
trunk/jp.go.aist.rtm.RTC/installer/resources/Source/examples/start-orbd.vbs
Log:
Correspondence to Windows7(64bit). refs #2592
Modified: trunk/jp.go.aist.rtm.RTC/Source/examples/start-orbd.vbs
===================================================================
--- trunk/jp.go.aist.rtm.RTC/Source/examples/start-orbd.vbs 2013-02-18 15:39:39 UTC (rev 694)
+++ trunk/jp.go.aist.rtm.RTC/Source/examples/start-orbd.vbs 2013-02-20 14:28:08 UTC (rev 695)
@@ -1,20 +1,56 @@
+'orbdN®pXNvg
+'{XNvgÍ«ÏTEMPªÝè³êÄ¢é±ÆðOñƵܷ
+'ȨA«ÏTEMPÍÊáOSÉæèftHgÅÝè³êĢܷ
+
+
'N®pIuWFNgÌæ¾
Set objShell = WScript.CreateObject("WScript.Shell")
-'JDKÌWXgL[ðZbg
-regJDKkey = "HKLM\SOFTWARE\JavaSoft\Java Development Kit"
+
+If GetOSVersion() >= 6 Then
+ 'JDKÌWXgL[ðZbg
+ regJDKkey = "HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit"
+Else
+ regJDKkey = "HKLM\SOFTWARE\JavaSoft\Java Development Kit"
+End If
+
'WXg©çJDKJgo[Wðæ¾
'objShell.RegRead("HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion")
+
'±êªAá¦Î"1.5"¾Æ·éÆA
'HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.5\JavaHome
'ÉJDKJgo[WÌ[gtH_ªLÚ³êÄ¢é
Javahome = regJDKkey & "\" & objShell.RegRead(regJDKkey & "\CurrentVersion") & "\JavaHome"
+
'JDKJgo[WÌ[gtH_Javahome̺Ìbin\orbd.exeªÚIÌÀst@C
targetexe = """" & objShell.RegRead(Javahome) & "\bin\orbd.exe"""
+
'ÚIÌÀst@CtargetexeðKØÈIvVð¯ÄÀs³¹é
objShell.Run targetexe & " -ORBInitialPort 2809 -ORBInitialHost localhost -defaultdb ""%TEMP%""\orb.db"
-'±êÍá¦ÎAÌæ¤È±ÆðâÁÄéBìÆfBNgð[U[ÌtemptH_ÉwèB
+'±êÍá¦ÎAÌæ¤È±ÆðâÁÄéB½¾µAìÆfBNgð[U[ÌtemptH_ÉwèB
'cf:objShell.Run """C:\Program Files\Java\jdk1.5.0_14\bin\orbd.exe"" -ORBInitialPort 2809 -ORBInitialHost localhost"
'êIuWFNgðJú
Set objShell = Nothing
+
+' **********************************************************
+' OS o[WÌæ¾
+' **********************************************************
+Function GetOSVersion()
+
+ Dim strComputer, Wmi, colTarget, strWork, objRow, aData
+
+ strComputer = "."
+ Set Wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
+ Set colTarget = Wmi.ExecQuery( "select Version from Win32_OperatingSystem" )
+
+ For Each objRow in colTarget
+ strWork = objRow.Version
+ Next
+
+ aData = Split( strWork, "." )
+ strWork = aData(0) & "." & aData(1)
+
+ GetOSVersion = CDbl( strWork )
+
+End Function
\ No newline at end of file
Modified: trunk/jp.go.aist.rtm.RTC/installer/resources/Source/examples/start-orbd.vbs
===================================================================
--- trunk/jp.go.aist.rtm.RTC/installer/resources/Source/examples/start-orbd.vbs 2013-02-18 15:39:39 UTC (rev 694)
+++ trunk/jp.go.aist.rtm.RTC/installer/resources/Source/examples/start-orbd.vbs 2013-02-20 14:28:08 UTC (rev 695)
@@ -6,8 +6,12 @@
'N®pIuWFNgÌæ¾
Set objShell = WScript.CreateObject("WScript.Shell")
-'JDKÌWXgL[ðZbg
-regJDKkey = "HKLM\SOFTWARE\JavaSoft\Java Development Kit"
+If GetOSVersion() >= 6 Then
+ 'JDKÌWXgL[ðZbg
+ regJDKkey = "HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit"
+Else
+ regJDKkey = "HKLM\SOFTWARE\JavaSoft\Java Development Kit"
+End If
'WXg©çJDKJgo[Wðæ¾
'objShell.RegRead("HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion")
@@ -28,3 +32,25 @@
'êIuWFNgðJú
Set objShell = Nothing
+
+' **********************************************************
+' OS o[WÌæ¾
+' **********************************************************
+Function GetOSVersion()
+
+ Dim strComputer, Wmi, colTarget, strWork, objRow, aData
+
+ strComputer = "."
+ Set Wmi = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
+ Set colTarget = Wmi.ExecQuery( "select Version from Win32_OperatingSystem" )
+
+ For Each objRow in colTarget
+ strWork = objRow.Version
+ Next
+
+ aData = Split( strWork, "." )
+ strWork = aData(0) & "." & aData(1)
+
+ GetOSVersion = CDbl( strWork )
+
+End Function
\ No newline at end of file
More information about the openrtm-commit
mailing list