Option Explicit
\'
\' Author : EminoMeneko
\' Date : 2011年07月10日 EST
\' Script Name : Super Street Fighter IV Arcade Edition PC Locale Changer
\' Version : 1.0
\' Description :
\' SSFIVAE locale changer
\' SFIV did choose the locale according to your session locale but it is not
\' the same with SSFIVAE which relies on a registry key. This script gives you
\' a simple and easy way to modify the proper value with a given data.
\' Usage :
\' Just launch the script. You will beprompted for the correct locale value
\' but some of them will be given to you. Just type the corresponding value and
\' validate by pressing the OK button. This is designed to work with GUI so it
\' may not work as a CLI.
\' You also many need admin privilege especially on recent versions of
\' Windows.
\' Moreover, this script is ditributed AS IS and I take NO RESPONSIBILITY
\' AT ALL for your usage of it. It should work though. ;)
\'WScript.Echo "今日は!"
Dim title, mess, defaultLocale
Dim chosenLocale, gameLocaleRegKey
Dim is64Bit
is64bit = DetermineOSArchitecture
If is64bit Then
gameLocaleRegKey = "HKLM\\SOFTWARE\\Wow6432Node\\CAPCOM\\Super Street Fighter IV\\language"
Else
gameLocaleRegKey = "HKLM\\SOFTWARE\\CAPCOM\\Super Street Fighter IV\\language"
End If
defaultLocale = DetermineGameLocale
\'Wscript.Echo "Current Windows Session Locale value is : " & defaultLocale
if defaultLocale = 0 Then
defaultLocale = 1033
End If
title = "言語の選抜"
mess = "Please copy the correct integer value to the InputBox bellow :" & vbCrlf & vbCrlf
mess = mess & "1041 日本語" & vbCrlf
mess = mess & "1036 Français" & vbCrlf
mess = mess & "1033 English" & vbCrlf
mess = mess & "1045 Polski" & vbCrlf
mess = mess & "1042 한국어" & vbCrlf
mess = mess & "------------------------" & vbCrlf
mess = mess & "1029 Czech" & vbCrlf
mess = mess & "1030 Danish" & vbCrlf
mess = mess & "1031 Deutsch" & vbCrlf
mess = mess & "1034 Spanish - Spain" & vbCrlf
mess = mess & "1035 Finnish - Finland" & vbCrlf
mess = mess & "1040 Italian" & vbCrlf
mess = mess & "1043 Dutch" & vbCrlf
mess = mess & "1044 Norwegian" & vbCrlf
mess = mess & "1049 Russian" & vbCrlf
mess = mess & "1053 Swedish - Sweden" & vbCrlf
mess = mess & "2052 中国語 - 中国 - 中華料理美味いぞ!" & vbCrlf
mess = mess & "2070 Portugese - Portugal" & vbCrlf
mess = mess & vbCrlf & vbCrlf
mess = mess & "No Waranty. Use at your own risk. " & _
"You may want to backup the registry before proceeding." & vbCrlf
mess = mess & "This should work though. ;)" & vbCrlf
chosenLocale = InputBox(mess, title, defaultLocale)
If chosenLocale = False Then
\' Do nothing at all or uncomment line bellow to display a message.
WScript.Echo "You aborted the process." & vbCrlf & _
"Nothing has been changed." & vbCrlf & "Bye bye ! ;)"
Else
\' Do the stuff
UpdateGameLocale (chosenLocale)
End If
WScript.Quit
\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'
\' Function definition
\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'\'
\' Returns locale integer value or O if unable to find it
Function DetermineGameLocale
Dim tmpval, ShellObject
Set ShellObject = WScript.CreateObject("WScript.Shell")
\' Reading the entry value according to architecture
On Error Resume Next
tmpval = ShellObject.RegRead(gameLocaleRegKey)
\'Wscript.Echo "Error number : " & Err.Number
\' Tells is the Registry data exists or not
if Err.Number <> 0 Then
\'Err.Clear
Wscript.Echo "Unable to determine Current game locale"
DetermineGameLocale = 0
Else
\'Err.Clear
DetermineGameLocale = tmpval
End If
End Function
Sub UpdateGameLocale (locale)
Dim tmpval, ShellObject
Set ShellObject = WScript.CreateObject("WScript.Shell")
\' Writing the entry value in the Registry according to architecture
On Error Resume Next
tmpval = ShellObject.RegWrite(gameLocaleRegKey, locale, "REG_SZ")
\'Wscript.Echo "Error number : " & Err.Number
\' Tells is the Registry data exists or not
if Err.Number <> 0 Then
Wscript.Echo "Something unwanted occured while trying to" & vbCrlf & _
"update current game locale !" & vbCrlf & _
"You should relaunch the script to checkout the value." & vbCrlf & _
"You also may want to check if you have administrator privilege."
With Err
WScript.Echo "Error info : " & vbCrlf & _
"Error number : " & Err.Number & vbCrlf & _
"Error Source : " & Err.Source & vbCrlf & _
"Error Descr. : " & Err.Description
End With
Err.Clear
Else
WScript.Echo "Locale number " & locale & " has been setup." & vbCrlf & _
"Have fun ! ;D"
Err.Clear
End If
End Sub
\' Determine OS Architecture
Function DetermineOSArchitecture
Dim objWMIService, strComputer, colOS, objOS, winArch
Dim msg, retMsgBox
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\\\" & strComputer & "\\root\\cimv2")
Set colOS = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
For Each objOS in colOS
winArch = objOS.OSArchitecture
mess = "Some system information" & vbCrlf & vbCrlf
mess = mess & "OS Architecture : " & winArch & vbCrlf
mess = mess & "OS Locale value : " & objOS.OSLanguage & vbCrlf
mess = mess & "OS Caption : " & objOS.Caption & vbCrlf
\'mess = mess & "OS Name : " & objOS.Name & vbCrlf
\' Convert returned value from Hex to Dec
\'mess = mess & "OS Locale : " & CLng("&h" & objOS.Locale) & vbCrlf
Next
Wscript.Echo mess
\'WSCript.Echo "OS Arch before processing : " & winArch
winArch = Left(winArch, 2)
If (winArch = "32") Then
is64bit = False
ElseIf (winArch = "64") Then
is64bit = True
Else
\' If something would make OS architecture detection fail,
\' (as the string is localised) I assume the OS is 64 bit
msg = "Cannot determine OS architecture for some reason." & vbCrlf
msg = msg & "Assuming it is 64 bit. Is this correct ?" & vbCrlf
msg = msg & "Yes for 64 bit OS." & vbCrlf
msg = msg & "No for 32 bit OS." & vbCrlf
retMsgBox = MsgBox (msg, vbYesNo, "OS Architecture")
If (retMsgBox = 7) Then
\' Clicked No
is64bit = False
Else
\' Clicked Yes
is64bit = True
End If
End If
\'WSCript.Echo "OS Arch after processing : " & winArch & vbCrlf & "Is System 64 bit ? : " & is64bit
DetermineOSArchitecture = is64bit
End Function