Unicode補完計畫,各Windows版本都適用「一鍵安裝版」

teinedni

一般般會員
已加入
3/9/08
訊息
163
互動分數
35
點數
28
因Vista導入iCacls存取權限機制,導致無法置換Code Page 950下的C_950.nls

造成Unicode安裝失敗,Unicode也停留在XP時代下的安裝模式,沒有一個新的配套措施

都需要使用手動新增擁有者,來置換C_950.nls,相當麻煩

在2010年時本人就在youtube上放上了Vista安裝補完計畫的教學影片

良久還是不見有人開發安裝版,所以就釋出了這個一件安裝版相容於各Windwos系統x64、x86平台

載點:點我下載


code 一樣開源,有需要的人自取

i165155_unicodeinstallcode.png


#RequireAdmin
#NoTrayIcon

#Region
#AutoIt3Wrapper_icon=C:\NewDang.ico
#AutoIt3Wrapper_Compression=5
#AutoIt3Wrapper_Res_Comment=Unicode補完計畫
#AutoIt3Wrapper_Res_Description=Unicode補完計畫
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
#AutoIt3Wrapper_Res_LegalCopyright=噹噹
#EndRegion

Dim $DirPath = "C:\Windows\System32"
Dim $FileName = "C_950.NLS"
Dim $FilePath = $DirPath&"\"&$FileName
Dim $C_950_MD_5 = "7f69955ce72ba9f187a686a637b8ffdd"

If StringInStr ( _MD5 ($FilePath), $C_950_MD_5) Then
MsgBox ( 0, "", "已安裝過unicode,無須再次安裝。")
Else
RunWait ( @ComSpec & " /c " & 'takeown /f '&$FilePath&' && icacls '&$FilePath&' /grant administrators:F ', $DirPath, @SW_HIDE)
FileInstall ( "C_950.nls", $FilePath, 1)
RunWait ( @ComSpec & " /c " & 'takeown /f '&$FilePath&' && icacls '&$FilePath&' /grant:r administrators:(RX)', $DirPath, @SW_HIDE)
RunWait ( @ComSpec & " /c " & 'takeown /f '&$FilePath&' && icacls '&$FilePath&' /setowner "NT Service\TrustedInstaller" /C', $DirPath, @SW_HIDE)
MsgBox ( 0, "Unicode補完計畫", "Unicode補完計畫,已安裝完成,重開機即可。")
EndIf

Func _MD5($sFile)
$hFile = FileOpen ($sFile, 16)
$bData = FileRead ($hFile)
$iLength = BinaryLen ($bData)
FileClose($hFile)

$tBuffer = DllStructCreate("byte[" & $iLength & "]")
$pBuffer = DllStructGetPtr($tBuffer)
DllStructSetData($tBuffer, 1, $bData)

$iResult = DllCall ("Crypt32.dll", "int", "CryptHashCertificate", "hWnd", 0, "dword", 0x8003, "dword", 0, "ptr", $pBuffer, "dword", $iLength, "ptr", 0, "dword*", 0)
$tResult = DllStructCreate ("byte[" & $iResult[7] & "]")
$pResult = DllStructGetPtr ($tResult)
$iResult = DllCall ("Crypt32.dll", "int", "CryptHashCertificate", "hWnd", 0, "dword", 0x8003, "dword", 0, "ptr", $pBuffer, "dword", $iLength, "ptr", $pResult, "dword*", $iResult[7])
If $iResult[0] <> 0 Then Return StringTrimLeft (DllStructGetData ($tResult, 1), 2)

$tBuffer = 0
$tResult = 0
EndFunc
 
最後編輯:

win98xp2

一般般會員
已加入
3/9/13
訊息
180
互動分數
7
點數
18
年齡
41
可能得找人當白老鼠測試一下?!話說WIN 8.1 X64能用嗎?
 

teinedni

一般般會員
已加入
3/9/08
訊息
163
互動分數
35
點數
28
保證可以用..沒必要開發出不能用的東西=.=
 

jamesfuh

榮譽會員
已加入
9/21/03
訊息
3,401
互動分數
3
點數
38
請教一下.早期個人也注意過unicode補完計畫...
也安裝過一些unicode東西...

但現在雖然沒裝.在繁簡字體檔案存取上也還OK...

能否請教安裝了這補完計畫.可解決甚麼樣困擾?
若不裝.最可能遇上甚麼問題?
謝謝!!
 

ken21

永不上線
已加入
11/18/07
訊息
1,424
互動分數
0
點數
36
http://zh.wikipedia.org/wiki/Unicode補完計畫
可參考一些歷史
現今已不推薦而直接改用Unicode編碼
如果不瞭解架構很容易被誤用帶給其他人麻煩(把未轉換的外字集傳給別人,別人看不到你打的字)
 
▌延伸閱讀