From 41e70ab560bba90b2e93c9328f67cf241aa0f7ac Mon Sep 17 00:00:00 2001 From: "yongsung1.kim" Date: Mon, 14 Apr 2014 13:17:41 +0900 Subject: [PATCH] [STUB] Installmanager can check JDK8 on Windows. Change-Id: I8e781b5f318c24d7ad9e91164e005c1e5f70ae3d Signed-off-by: yongsung1.kim --- os_stubs/windows/InstallManager-64.nsi | 49 +++++++++++++++--------- os_stubs/windows/InstallManager.nsi | 69 ++++++++++++++++++++++------------ 2 files changed, 77 insertions(+), 41 deletions(-) diff --git a/os_stubs/windows/InstallManager-64.nsi b/os_stubs/windows/InstallManager-64.nsi index 2399ea4..e1bfd31 100644 --- a/os_stubs/windows/InstallManager-64.nsi +++ b/os_stubs/windows/InstallManager-64.nsi @@ -1,6 +1,6 @@ outfile "inst-manager.exe" -Name "Samsung-gear-SDK" +Name "Tizen-SDK-for-Wearable" ShowInstDetails show @@ -193,29 +193,44 @@ done: Call StrStr Pop $1 ${If} $1 == "" ; if not java version 1.7, it will check java version using java home. - ## Execute java.exe in java home - nsExec::ExecToStack '"$3" /C ""$5\bin\java.exe" "-version""' - Pop $0 - Pop $6 - - Push $6 - Push "1.6" - Call StrStr - Pop $1 - ${If} $1 == "" ; if not java version 1.6, it will check java version 1.7. - Push $6 - Push "1.7" - Call StrStr - Pop $1 - ${If} $1 == "" ; if not java version 1.7, system does not support java. - goto NoEnv + Push $6 + Push "1.8" + Call StrStr + Pop $1 + ${If} $1 == "" ; if not java version 1.8, it will check java version using java home. + ## Execute java.exe in java home + nsExec::ExecToStack '"$3" /C ""$5\bin\java.exe" "-version""' + Pop $0 + Pop $6 + + ## check java 1.6 + Push $6 + Push "1.6" + Call StrStr + Pop $1 + ${If} $1 == "" ; if not java version 1.6, it will check java version 1.7. + Push $6 + Push "1.7" + Call StrStr + Pop $1 + ${If} $1 == "" ; if not java version 1.7, it will check java version 1.8. + Push $6 + Push "1.7" + Call StrStr + Pop $1 + ${If} $1 == "" ; if not java version 1.8, system does not support java. + goto NoEnv + ${EndIf} + ${EndIf} ${EndIf} ${EndIf} ${EndIf} ${EndIf} ${If} $R0 == "" + DetailPrint "Installmanager needs initialization time for executing itself." ExecDos::Exec /NOUNLOAD /ASYNC /DISABLEFSR "java -jar $INSTDIR\InstallManager.jar $2" + sleep 5000 pop $4 ${Else} StrCpy $3 "$2 $R0" diff --git a/os_stubs/windows/InstallManager.nsi b/os_stubs/windows/InstallManager.nsi index beed2a3..e1bfd31 100644 --- a/os_stubs/windows/InstallManager.nsi +++ b/os_stubs/windows/InstallManager.nsi @@ -1,6 +1,6 @@ outfile "inst-manager.exe" -Name "Samsung-gear-SDK" +Name "Tizen-SDK-for-Wearable" ShowInstDetails show @@ -8,6 +8,7 @@ Icon "SDK_icon.ico" !include FileFunc.nsh !include LogicLib.nsh +!include x64.nsh !insertmacro GetParameters !insertmacro GetOptions @@ -76,7 +77,6 @@ Function StrStr FunctionEnd ############ - ### TimeStamp !ifndef TimeStamp !define TimeStamp "!insertmacro _TimeStamp" @@ -139,6 +139,7 @@ section ${GetParameters} $R0 ${GetExePath} $R1 ${TimeStamp} $0 + SetRegView 64 StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment" StrCpy $2 0 @@ -167,14 +168,20 @@ done: ## Check java version and java execution. ExpandEnvStrings $3 %COMSPEC% - ${If} $3 == "%COMSPEC%" + ${If} $3 == "%COMSPEC%" + ${DisableX64FSRedirection} ; execute cmd command for windows7 64bit nsExec::ExecToStack '"java.exe" "-version"' + ${EnableX64FSRedirection} ; execute cmd command for windows7 64bit + Pop $0 + Pop $6 ${Else} + ${DisableX64FSRedirection} ; execute cmd command for windows7 64bit nsExec::ExecToStack '"$3" /C ""java.exe" "-version""' + ${EnableX64FSRedirection} ; execute cmd command for windows7 64bit + Pop $0 + Pop $6 ${EndIf} - Pop $0 - Pop $6 ## check java 1.6 Push $6 Push "1.6" @@ -186,31 +193,45 @@ done: Call StrStr Pop $1 ${If} $1 == "" ; if not java version 1.7, it will check java version using java home. - ## Execute java.exe in java home - nsExec::ExecToStack '"$3" /C ""$5\bin\java.exe" "-version""' - Pop $0 - Pop $6 - - ## check java 1.6 - Push $6 - Push "1.6" - Call StrStr - Pop $1 - ${If} $1 == "" ; if not java version 1.6, it will check java version 1.7. - Push $6 - Push "1.7" - Call StrStr - Pop $1 - ${If} $1 == "" ; if not java version 1.7, system does not support java. - goto NoEnv + Push $6 + Push "1.8" + Call StrStr + Pop $1 + ${If} $1 == "" ; if not java version 1.8, it will check java version using java home. + ## Execute java.exe in java home + nsExec::ExecToStack '"$3" /C ""$5\bin\java.exe" "-version""' + Pop $0 + Pop $6 + + ## check java 1.6 + Push $6 + Push "1.6" + Call StrStr + Pop $1 + ${If} $1 == "" ; if not java version 1.6, it will check java version 1.7. + Push $6 + Push "1.7" + Call StrStr + Pop $1 + ${If} $1 == "" ; if not java version 1.7, it will check java version 1.8. + Push $6 + Push "1.7" + Call StrStr + Pop $1 + ${If} $1 == "" ; if not java version 1.8, system does not support java. + goto NoEnv + ${EndIf} + ${EndIf} ${EndIf} ${EndIf} ${EndIf} ${EndIf} ${If} $R0 == "" - ExecDos::Exec /NOUNLOAD /ASYNC "java.exe -jar $INSTDIR\InstallManager.jar $2" - Pop $4 + DetailPrint "Installmanager needs initialization time for executing itself." + ExecDos::Exec /NOUNLOAD /ASYNC /DISABLEFSR "java -jar $INSTDIR\InstallManager.jar $2" + sleep 5000 + pop $4 ${Else} StrCpy $3 "$2 $R0" System::Call 'kernel32::GetStdHandle(i -11)i.r0' ;try to get stdout -- 2.7.4