Advertisement
UchiTesting

Super Street Fighter IV Arcade Edition Locale Changer v 1.0

Jul 10th, 2011
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Explicit
  2.  '
  3. '   Author :    EminoMeneko
  4. '   Date :  2011年07月10日 EST
  5. '   Script Name :   Super Street Fighter IV Arcade Edition PC Locale Changer
  6. '   Version :   1.0
  7. '   Description :
  8. '       SSFIVAE locale changer
  9. '   SFIV did choose the locale according to your session locale but it is not
  10. '   the same with SSFIVAE which relies on a registry key. This script gives you
  11. '   a simple and easy way to modify the proper value with a given data.
  12. '   Usage :
  13. '       Just launch the script. You will beprompted for the correct locale value
  14. '   but some of them will be given to you. Just type the corresponding value and
  15. '   validate by pressing the OK button. This is designed to work with GUI so it
  16. '   may not work as a CLI.
  17. '       You also many need admin privilege especially on recent versions of
  18. '   Windows.
  19. '       Moreover, this script is ditributed AS IS and I take NO RESPONSIBILITY
  20. '   AT ALL for your usage of it. It should work though. ;)
  21.  
  22. 'WScript.Echo "今日は!"
  23. Dim title, mess, defaultLocale
  24. Dim chosenLocale, gameLocaleRegKey
  25. Dim is64Bit
  26.  
  27. is64bit = DetermineOSArchitecture
  28.  
  29. If is64bit Then
  30.     gameLocaleRegKey = "HKLM\SOFTWARE\Wow6432Node\CAPCOM\Super Street Fighter IV\language"
  31. Else
  32.     gameLocaleRegKey = "HKLM\SOFTWARE\CAPCOM\Super Street Fighter IV\language"
  33. End If
  34.  
  35. defaultLocale = DetermineGameLocale
  36. 'Wscript.Echo "Current Windows Session Locale value is : " & defaultLocale
  37. if defaultLocale = 0 Then
  38.     defaultLocale = 1033
  39. End If
  40.  
  41. title = "言語の選抜"
  42.  
  43. mess = "Please copy the correct integer value to the InputBox bellow :" & vbCrlf & vbCrlf
  44. mess = mess & "1041     日本語" & vbCrlf
  45. mess = mess & "1036     Français" & vbCrlf
  46. mess = mess & "1033     English" & vbCrlf
  47. mess = mess & "1045     Polski" & vbCrlf
  48. mess = mess & "1042     한국어" & vbCrlf
  49. mess = mess & "------------------------" & vbCrlf
  50. mess = mess & "1029     Czech" & vbCrlf
  51. mess = mess & "1030     Danish" & vbCrlf
  52. mess = mess & "1031     Deutsch" & vbCrlf
  53. mess = mess & "1034     Spanish - Spain" & vbCrlf
  54. mess = mess & "1035     Finnish - Finland" & vbCrlf
  55. mess = mess & "1040     Italian" & vbCrlf
  56. mess = mess & "1043     Dutch" & vbCrlf
  57. mess = mess & "1044     Norwegian" & vbCrlf
  58. mess = mess & "1049     Russian" & vbCrlf
  59. mess = mess & "1053     Swedish - Sweden" & vbCrlf
  60. mess = mess & "2052     中国語 - 中国 - 中華料理美味いぞ!" & vbCrlf
  61. mess = mess & "2070     Portugese - Portugal" & vbCrlf
  62. mess = mess & vbCrlf & vbCrlf
  63. mess = mess & "No Waranty. Use at your own risk. " & _
  64.     "You may want to backup the registry before proceeding." & vbCrlf
  65. mess = mess & "This should work though. ;)" & vbCrlf
  66.  
  67. chosenLocale = InputBox(mess, title, defaultLocale)
  68. If chosenLocale = False Then
  69.     ' Do nothing at all or uncomment line bellow to display a message.
  70.     WScript.Echo "You aborted the process." & vbCrlf & _
  71.         "Nothing has been changed." & vbCrlf & "Bye bye ! ;)"
  72. Else
  73.     ' Do the stuff
  74.     UpdateGameLocale (chosenLocale)
  75. End If
  76.  
  77. WScript.Quit
  78.  
  79. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  80. '   Function definition
  81. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  82. ' Returns locale integer value or O if unable to find it
  83. Function DetermineGameLocale
  84.     Dim tmpval, ShellObject
  85.     Set ShellObject = WScript.CreateObject("WScript.Shell")
  86.     ' Reading the entry value according to architecture
  87.    
  88.     On Error Resume Next
  89.             tmpval = ShellObject.RegRead(gameLocaleRegKey)
  90.    
  91.     'Wscript.Echo "Error number : " & Err.Number
  92.    
  93.     ' Tells is the Registry data exists or not
  94.     if Err.Number <> 0 Then
  95.         'Err.Clear
  96.         Wscript.Echo "Unable to determine Current game locale"
  97.         DetermineGameLocale = 0
  98.     Else
  99.         'Err.Clear
  100.         DetermineGameLocale = tmpval
  101.     End If
  102. End Function
  103.  
  104. Sub UpdateGameLocale (locale)
  105.     Dim tmpval, ShellObject
  106.     Set ShellObject = WScript.CreateObject("WScript.Shell")
  107.     ' Writing the entry value in the Registry according to architecture
  108.    
  109.     On Error Resume Next
  110.             tmpval = ShellObject.RegWrite(gameLocaleRegKey, locale, "REG_SZ")
  111.    
  112.     'Wscript.Echo "Error number : " & Err.Number
  113.    
  114.     ' Tells is the Registry data exists or not
  115.     if Err.Number <> 0 Then
  116.         Wscript.Echo "Something unwanted occured while trying to" & vbCrlf & _
  117.             "update current game locale !" & vbCrlf & _
  118.             "You should relaunch the script to checkout the value." & vbCrlf & _
  119.             "You also may want to check if you have administrator privilege."
  120.            
  121.             With Err
  122.                 WScript.Echo "Error info : " & vbCrlf & _
  123.                 "Error number : " & Err.Number & vbCrlf & _
  124.                 "Error Source : " & Err.Source & vbCrlf & _
  125.                 "Error Descr. : " & Err.Description
  126.                
  127.             End With
  128.         Err.Clear
  129.     Else
  130.         WScript.Echo "Locale number " & locale  & " has been setup." & vbCrlf & _
  131.             "Have fun ! ;D"
  132.         Err.Clear
  133.     End If
  134. End Sub
  135.  
  136. ' Determine OS Architecture
  137. Function DetermineOSArchitecture
  138.     Dim objWMIService, strComputer, colOS, objOS, winArch
  139.     Dim msg, retMsgBox
  140.  
  141.     strComputer = "."
  142.     Set objWMIService = GetObject("winmgmts:" _
  143.      & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  144.     Set colOS = objWMIService.ExecQuery _
  145.      ("SELECT * FROM Win32_OperatingSystem")
  146.     For Each objOS in colOS
  147.         winArch = objOS.OSArchitecture
  148.         mess = "Some system information" & vbCrlf & vbCrlf
  149.         mess = mess & "OS Architecture : " & winArch & vbCrlf
  150.         mess = mess & "OS Locale value : " & objOS.OSLanguage & vbCrlf
  151.         mess = mess & "OS Caption : " & objOS.Caption & vbCrlf
  152.         'mess = mess & "OS Name : " & objOS.Name & vbCrlf
  153.         ' Convert returned value from Hex to Dec
  154.         'mess = mess & "OS Locale : " & CLng("&h" & objOS.Locale) & vbCrlf
  155.     Next
  156.    
  157.     Wscript.Echo mess
  158.  
  159.     'WSCript.Echo "OS Arch before processing : " & winArch
  160.     winArch = Left(winArch, 2)
  161.    
  162.     If (winArch = "32") Then
  163.         is64bit = False
  164.     ElseIf (winArch = "64") Then
  165.         is64bit = True
  166.     Else
  167.         ' If something would make OS architecture detection fail,
  168.         ' (as the string is localised) I assume the OS is 64 bit
  169.         msg = "Cannot determine OS architecture for some reason." & vbCrlf
  170.         msg = msg & "Assuming it is 64 bit. Is this correct ?" & vbCrlf
  171.         msg = msg & "Yes for 64 bit OS." & vbCrlf
  172.         msg = msg & "No for 32 bit OS." & vbCrlf
  173.         retMsgBox = MsgBox (msg, vbYesNo, "OS Architecture")
  174.         If (retMsgBox = 7) Then
  175.             ' Clicked No
  176.             is64bit = False
  177.         Else
  178.             ' Clicked Yes
  179.             is64bit = True
  180.         End If
  181.     End If
  182.  
  183.     'WSCript.Echo "OS Arch after processing : " & winArch & vbCrlf & "Is System 64 bit ? : " & is64bit
  184.     DetermineOSArchitecture = is64bit
  185. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement