Skip to content

Instantly share code, notes, and snippets.

@coldnight
Created January 14, 2014 06:03
Show Gist options
  • Save coldnight/8413795 to your computer and use it in GitHub Desktop.
Save coldnight/8413795 to your computer and use it in GitHub Desktop.
Wine TM2013 automatic and solve font encode error.
#!/bin/bash -e
# Public Domain
: ${TMPREFIX:=$HOME/.winetm}
export WINEPREFIX="$TMPREFIX" WINEARCH=win32
export WINEDEBUG=fixme-all
env -u DISPLAY wineboot -u
winetricks -q riched20 mfc42
winetricks -q ie7 || true
regfile=/tmp/winetm.reg
cat > "$regfile" <<'REG'
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Wine\DllOverrides]
"urlmon.dll"="builtin"
REG
regedit "$regfile"
rm -f "$regfile"
curl http://www.linuxzen.com/simsun.ttc -o $TMPREFIX/drive_c/windows/Fonts/simsun.ttc
cat > "$regfile" << _REG
REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
"Arial"="simsun"
"Arial CE,238"="simsun"
"Arial CYR,204"="simsun"
"Arial Greek,161"="simsun"
"Arial TUR,162"="simsun"
"Courier New"="simsun"
"Courier New CE,238"="simsun"
"Courier New CYR,204"="simsun"
"Courier New Greek,161"="simsun"
"Courier New TUR,162"="simsun"
"FixedSys"="simsun"
"Helv"="simsun"
"Helvetica"="simsun"
"MS Sans Serif"="simsun"
"MS Shell Dlg"="simsun"
"MS Shell Dlg 2"="simsun"
"System"="simsun"
"Tahoma"="simsun"
"Times"="simsun"
"Times New Roman CE,238"="simsun"
"Times New Roman CYR,204"="simsun"
"Times New Roman Greek,161"="simsun"
"Times New Roman TUR,162"="simsun"
"Tms Rmn"="simsun"
_REG
regedit "$regfile"
rm -f "$regfile"
tmexe=TM2013Preview1.exe
# tmexe=TM2013Preview2.exe
# [[ -f "$tmexe" ]] && tmexe=$(locate -b '\'"$tmexe" || true)
# [[ ! -f "$tmexe" ]] && wget http://dldir1.qq.com/qqfile/tm/TM2013Preview1.exe
# [[ ! -f "$tmexe" ]] || wget http://dldir1.qq.com/qqfile/qq/tm/2013Preview2/7246/TM2013Preview2.exe
wine $tmexe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment