2010年1月6日 星期三

Wine

前言:
 最近,想要把windows中常用的廣播軟体。搬到Fedora中使用。故我便朝此方向
而在搜尋中,看到好幾種的方式
1。安裝Virtual machian

2。wine

在目前我所使用的linux dri..中,它有一個“虛擬機器管理員”。但因為我還未使用
故,我是採用原始的。Wine來進行windows程序的轉移動作。





Wine 是一種在類Unix系統上執行Windows程式的軟體,其名稱為一遞迴式縮寫(即縮寫全名中又包含縮寫本身):Wine Is Not an Emulator(意即wine不是模擬器),但也有另一個非官方說法是其全名應為"Windows Emulator",即視窗模擬器。wine在英文中的原意為葡萄酒,因此以裝著葡萄酒的酒杯作為其代表標誌。
其運作模式是用相容模式呼喚 DLLs 以運行 Windows 程式,實作了大多數的 Windows API(即Windows程式運行的環境)。透過 Wine,你可以在 Linux 上安裝和執行 Windows 的程式,像是 Internet Explorer、MS Office、CS,以及exe檔等Windows格式的檔案。 -----------------
我在使用時,所遇到的二個問題是
1。其運作模式是用相容模模式呼喚DLLs來運行Windows程式。故
   你可能會遇到其DLLs是過期‘缺少等相關的問題

2。其在wine安裝時中,其預設的字型。仍是以最原始的windows中
   所預定的“字型”(新細明體)。但在各個linux中,它因版權的問題,並沒有加入
   故會造成其中文顯示的問題。

---------------------
一:缺少DLLs時
   在原始的windows中其DLLs是動態連結檔,大多是程式設計者把它的libary.包成一個專門的檔案,以便於更新。使用者不必更新它的主程式,只需更新其附加的DLL即可逹成目的。

  在原始的windows缺少DLL時, 都要上 google 找或是從另外一台 windows 機器複製過來。
或是找到其相關的安裝程式。(它大多是安裝於C:\\windows\\system32 資料夾中)
然而你在wine中也可把它當做一個windows一樣地安裝。
或是
winetricks
它是Wine它所提供的工具,讓你能更方便地尋找其相關的DLLs。
並且安裝。


winetricks is a quick and dirty script to download and install various redistributable runtime libraries sometimes needed to run programs in Wine.

如何安裝:
chmod +x winetricks
sudo mv winetricks /usr/local/bin


如何使用
Once you've obtained winetricks you can run it simply by typing sh winetricks at the console.
一但你拿到winetricks時,你可以在console中簡單地使用它,只需在console中下“sh winetricks”即可。
If ran without parameters a winetricks displays a GUI with a list of available packages.
若你沒有在執行winetricks加上其它的參數時,它會顯示其其安裝套件中GUI的畫面出來。
(在有時,會有問題。故你需取消其安裝畫面。以文字模式顯示)
If you know the name of the package(s) you wish to install, you can append the name(s) to the winetricks command line and it will immediately start the installation process.
若你知道你所需的套件名稱,你何以在其winetricks command 附加上其 相關的“名稱”。即可安裝。
For example,


 
#sh winetricks corefonts vcrun6

 will install both the corefonts and vcrun6 packages.


==================
二:顯示的字型
它應該與在windows中,改變字型一樣。
但不同的是。它在其內建的字型檔。並沒有包含標準中文的字型檔。故你需要去下載
新的中文字型檔。並在其windows中內部設定其預設的字型。(透過windos的regedit

1。把新的字型檔放到windows中的Fonts資料夾中
#ln -s ~/.fonts/droid/DroidSansFallback.ttf ~/.wine/drive_c/windows/Fonts/

2。修改對內建各字型的對應
新增一個*.reg
內容如下
------------

REGEDIT4
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink]
"FontLinkControl"=dword:00004000
"FontLinkDefaultChar"=dword:00003000
/* 平滑化(anti-alias) */
/* 如果覺得開了之後字體難看,把三個Y改成N */
[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"ClientSideAntiAliasWithCore"="Y"
"ClientSideAntiAliasWithRender"="Y"
"ClientSideWithRender"="Y"
/* 平滑字型 */
[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
/* 替換字型1 */
/* 安裝Wine不會提供字型,所以需要替換字型,我以Droid Sans Fallback替換 */
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
"Arial Baltic,186"="Droid Sans Fallback,186"
"Arial CE,238"="Droid Sans Fallback,238"
"Arial CYR,204"="Droid Sans Fallback,204"
"Arial Greek,161"="Droid Sans Fallback,161"
"Arial TUR,162"="Droid Sans Fallback,162"
"Courier New Baltic,186"="Droid Sans Fallback,186"
"Courier New CE,238"="Droid Sans Fallback,238"
"Courier New CYR,204"="Droid Sans Fallback,204"
"Courier New Greek,161"="Droid Sans Fallback,161"
"Courier New TUR,162"="Droid Sans Fallback,162"
"Helv"="Droid Sans Fallback"
"Helvetica"="Droid Sans Fallback"
"MS Shell Dlg"="Droid Sans Fallback"
"MS Shell Dlg 2"="Droid Sans Fallback"
"PMingLiU"="Droid Sans Fallback"
"新細明體"="Droid Sans Fallback"
"Tahoma"="Droid Sans Fallback"
"Times"="Droid Sans Fallback"
"Times New Roman Baltic,186"="Droid Sans Fallback,186"
"Times New Roman CE,238"="Droid Sans Fallback,238"
"Times New Roman CYR,204"="Droid Sans Fallback,204"
"Times New Roman Greek,161"="Droid Sans Fallback,161"
"Times New Roman TUR,162"="Droid Sans Fallback,162"
"Tms Rmn"="Droid Sans Fallback"
/* 替換字型2 */
[HKEY_CURRENT_USER\Software\Wine\Fonts\Replacements]
@="Droid Sans Fallback"
"Arial"="Droid Sans Fallback"
"Fixedsys"="Droid Sans Fallback"
"Microsoft Sans Serif"="Droid Sans Fallback"
"MingLiU"="Droid Sans Fallback"
"MS UI Gothic"="Droid Sans Fallback"
"PMingLiU"="Droid Sans Fallback"
"Simsun"="Droid Sans Fallback"
"Songti"="Droid Sans Fallback"
"System"="Droid Sans Fallback"
"Tahoma"="Droid Sans Fallback"
"Terminal"="Droid Sans Fallback"
/* 取代字型 */
/* Wine 1.1.12 打補丁後也會有亂碼,所以要修改這裡 */
/* Wine 1.1.12 之前可以不用修改,改了應該也沒關係 */
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]
"Microsoft Sans Serif"="DroidSansFallback.ttf,Droid Sans Fallback"
"SimSun"="DroidSansFallback.ttf,Droid Sans Fallback"
"Tahoma"="DroidSansFallback.ttf,Droid Sans Fallback"
"PMingLiU"="DroidSansFallback.ttf,Droid Sans Fallback"
"Lucida Sans Unicode"="DroidSansFallback.ttf,Droid Sans Fallback"
[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]

"BorderWidth"="1"

"CaptionFont"=hex:f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,88,00,00,00,22,44,00,72,00,6f,00,69,00,64,00,20,00,53,00,61,00,6e,00,73,00,20,00,46,00,61,00,6c,00,6c,00,62,00,61,00,63,00,6b,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

"CaptionHeight"="18"

"CaptionWidth"="18"

"MenuFont"=hex:f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,88,00,00,00,22,44,00,72,00,6f,00,69,00,64,00,20,00,53,00,61,00,6e,00,73,00,20,00,46,00,61,00,6c,00,6c,00,62,00,61,00,63,00,6b,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

"MenuHeight"="18"

"MenuWidth"="18"

"MessageFont"=hex:f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,88,00,00,00,22,44,00,72,00,6f,00,69,00,64,00,20,00,53,00,61,00,6e,00,73,00,20,00,46,00,61,00,6c,00,6c,00,62,00,61,00,63,00,6b,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

"ScrollHeight"="16"

"ScrollWidth"="16"

"Shell Icon Size"="32"

"SmCaptionFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,00,00,00,88,00,00,00,00,4d,00,53,00,20,00,53,00,68,00,65,00,6c,00,6c,00,20,00,44,00,6c,00,67,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

"SmCaptionHeight"="18"

"SmCaptionWidth"="13"

"StatusFont"=hex:f0,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,bc,02,00,00,00,00,00,88,00,00,00,22,44,00,72,00,6f,00,69,00,64,00,20,00,53,00,61,00,6e,00,73,00,20,00,46,00,61,00,6c,00,6c,00,62,00,61,00,63,00,6b,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

----------------------
然後執行wine 中的 regedit,把上述的*.reg加入

3。修改預設字型、字體大小
在~/.wine/drive_c/windows/win.ini 中把下列內容新增


[Desktop]
IconTitleFaceName=Droid Sans Fallback
menufontsize=13
messagefontsize=13
statusfontsize=13
IconTitleSize=13
  

4。對其 winecfg 修正問題
 在console中執行winecfg .
 選擇桌面整合,分別調整Message Box Text、功能表文字、提示區文字、當前標題欄文字這  四個字型與字體大小。


4.完成。

------------------
問題:
1。在wine中無法使用其中文輸入法
2。有些程式無法執行。像是對於.Net的支援
    http://www.mono-project.com/About_Mono   
3。試著安裝keil c ,AVR ....的開發環境

參考資訊:
http://playubuntu.blogspot.com/2009/01/wine.html
http://wiki.winehq.org/FAQ
http://wiki.ubuntu-tw.org/index.php?title=Wine
http://b2dpurekgb.blogspot.com/search/label/winetricks
http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?topic_id=12836&viewmode=flat&order=ASC&type=&mode=0&start=0
-------
http://playubuntu.blogspot.com/2009/01/wine-wine.html#more
http://playubuntu.blogspot.com/2009/01/ies4linuxfreegrabsmartget-wine.html
-------------

沒有留言:

張貼留言