wine 安装使用记录

安装

1. Wine程序安装

1.1 自带版本(不建议)

Ubuntu 16.04 默认自带1.6.2(2016.07.16),一般小程序运行也没什么大问题。

sudo apt install wine

1.2 最新版本Wine:Wine-builds PPA

sudo add-apt-repository ppa:wine/wine-builds
sudo apt-get update
sudo apt-get install –install-recommends winehq-devel
安装步骤参考地址:http://wiki.ubuntu.org.cn/Wine 和https://wiki.winehq.org/Ubuntu

安装后第一次程序启动过程会下载需要的win库包,按需安装即可。

2. 最新版本Winetricks:winetricks Github

wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks
下载地址参考:http://forum.ubuntu.org.cn/viewtopic.php?f=121&t=478871

2.1 通过winetricks安装必要的DLLs

./winetricks dlls gdiplus 必须
./winetricks dlls vcrun2008 msxml6 corefonts
./winetricks dlls d3dx9 d3dcompiler_43 xact_jun2010
./winetricks dlls ie8
./winetricks dlls wininet

其他建议安装的包
colorprofile、corefonts、d3dx9、fontfix、fontsmooth-gray、fontsmooth-rgb、fontsmooth-bgr、gdiplus、mfc40、mfc42、msxml3、msxml4、msxml6、riched20、riched30、tahoma、urlmon、vb6run、vcrun6、vcrun2003、vcrun2005、vcrun2008、ie6、allfonts

3 安装最靠谱的Office 2007套件

Office 2007版本只需要在安装时输入一个序列号就可以激活,非常方便。而且基本功能也算比较全,SmartArt等新功能都有了。而且打开速度非常快,在我的x250+SSD环境下基本秒开。

注意:

  1. 不需要提前安装各种DLL,默认wine环境即可“开箱即用”,可见Office 2007版本的方便之处。
  2. 安装过程以干净的wine环境为基准,所以建议区别于默认的.wine目录,为office建立一个新的wineprefix。(其它程序也是一样,尽量都独立开,方便管理)
  3. 必须使用wine 32bit架构,因为Office 2007时代还没有64bit版本,且只有在wine 32bit架构下才能正常工作。
  4. 保持默认的Windows XP系统不要修改。

安装步骤:

  1. 不动默认的wineprefix(.wine),为Office 2007建立新的wineprefix,并修改wine为32bit架构
export WINEARCH=win32 WINEPREFIX=~/.wineoffice
winecfg    初始化新的32bit Arch wineprefix,并确认操作系统是Windows XP
  1. winecfg 添加riched20为Native(Windows)(别退出上边的SHELL,否则再添加环境变量export WINEARCH=win32 WINEPREFIX=~/.wineoffice到新SHELL)

    《wine 安装使用记录》 winecfg截图

  2. 下载Office 2007安装包和SP3包(SP3版本有另存为PDF功能)

  3. 安装”Office 2007安装包”和”sp3包”

export WINEARCH=win32 WINEPREFIX=~/.wineoffice
cd /media/OFFICE12
wine ./setup.exe  可选:建议选择所有软件都安装在本地计算机,少一点后期麻烦

可参考URL:
https://appdb.winehq.org/objectManager.php?iId=4992&sClass=version
https://community.linuxmint.com/tutorial/view/1325
http://www.webupd8.org/2011/01/how-to-install-microsoft-office-2007-in.html
https://wiki.archlinux.org/index.php/Wine
http://nithinaneeshsct06bt.blogspot.jp/2012/05/install-microsoft-office-2007-in-ubuntu.html
http://nithinaneeshsct06bt.blogspot.jp/2013/02/install-microsoft-office-2010-in-ubuntu.html
https://bbs.deepin.org/forum.php?mod=viewthread&tid=42729&highlight=office
http://forum.ubuntu.org.cn/viewtopic.php?t=331153

4 安装Visio 2010

众所周知,Office套件是不包括Visio的,如需使用要单独安装。而且Visio与其它Office不同,最新的vsdx格式是2013版本才引进的,而且最低版本需要Visio 2010+Converter才能支持,Visio2007是不支持最新vsdx格式的。这也是为什么我安装完Visio 2007后无奈又安装了Visio 2010版本(Visio 2007版本使用没有任何问题,安装和使用的都不能有riched20 Override!!!否则输入框不能正常工作)。
同时,安装完Visio 2010后还需要安装SP2包,以实现对vsdx格式的支持(目前有点问题,我还没有成功)。
操作系统:WinXP
安装DLL:vcrun2008/mfc90

安装过程如下:

export WINEARCH=win32 WINEPREFIX=~/.winevisio2010
winecfg 初始化新的wineprefix,并确认操作系统是Windows 7(不是XP)
wine ~/media/VISIO/setup.exe  安装Visio 2010
./winetricks2 dlls vcrun2008    安装必须的DLL,注意WINEPREFIX是否选对
wine ~/Download/visiosp2010-kb2687468-fullfile-x86-zh-cn.exe  安装VISIO SP2补丁

参考URL:
https://appdb.winehq.org/objectManager.php?sClass=version&iId=24713
https://appdb.winehq.org/objectManager.php?sClass=version&iId=16692
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_visio-mso_other/how-to-open-vsdx-files-with-visio-2010/809bfaa6-fafa-4206-96fa-e34be1b8079c
https://www.microsoft.com/zh-CN/download/details.aspx?id=39665

5. 安装Evernote

目前可用的版本只有:5.8.13.8152,可以Google一下下载链接。wine后可以正常使用。

《wine 安装使用记录》 Evernote版本截图

安装过程如下:

export WINEARCH=win32 WINEPREFIX=~/.wineevernote
winecfg 初始化新的wineprefix
wine ~/Download/setup.exe

解决乱码:
最新版本的wine会自动映射Linux系统的可用字体到WinePrefix,所以不需要单独再安装字体,当然前提是宿主机的Linux系统已经有需要的字体。
使用最新版本wine,Evernote 5.8版本只有笔记显示部分的标题栏中文是乱码(英文没总问题),而且乱码显示为方块,所以可以确认乱码的原因是:Evernote在标题栏调用的字体不支持中文显示,解决方法如下:

  1. 安装gdiplus(至少让弹框的菜单好看一些)
    ./winetricks2 dlls gdiplus
  1. 修改注册表(最重要)
    运行命令wine regedit 修改[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows
    NT\CurrentVersion\FontSubstitutes] 如下键值:
"MS Shell Dlg"="SimSun"
"MS Shell Dlg 2″="SimSun"

《wine 安装使用记录》 FontSubstitutes键值

错误解决方法收集

6.1 错误1

winediag:SECUR32_initNTLMSP ntlm_auth was not found or is outdated. Make sure that ntlm_auth >= 3.0.25 is in your

sudo apt install winbind

错误解决方法出处:https://appdb.winehq.org/objectManager.php?bShowAll=true&bIsQueue=false&bIsRejected=false&sClass=version&sTitle=&sReturnTo=&iId=9828

6.2 错误2

Note: command ‘cabextract -q -d /home/ray/.wine/dosdevices/c:/windows/temp/_d3dx11_42 -L -F d3dx11_42x86* /home/ray/.cache/winetricks/directx9/directx_Jun2010_redist.exe’ returned status 1. Aborting. 原因是下载文件出错,需要清除缓存文件,重新下载即可:

rm /home/sub/.cache/winetricks/directx9/directx_Jun2010_redist.exe

解决方法出处:https://bbs.archlinux.org/viewtopic.php?id=177880

6.3 乱码解决

http://blog.chinaunix.net/uid-24993439-id-2979620.html

7. wine基础信息

7.1wine容器和架构

wine属于半虚拟化结构,默认情况下安装的Windows程序都属于全局的容器中(目录:~/.wine),在管理和可移值性就差一些。
所以一般建议,为每类Windows程序(甚至每个Windows程序)建立自己独立的容器,每个容器分离开,这样各类的兼容包、字体和调用的DLL不同都不会有相互的影响,移值和删除操作都更加灵活。
同时,每个容器可以定义程序的运行架构,如32bit或64bit,在安装只支持32bit环境的程序时非常有用。
容器和架构操作方法:

export WINEARCH=win32 WINEPREFIX=~/.wineevernote

运行完上述命令后,这个SHELL会话的后续的命令都将只作用于WINEPREFIX指定的这个容器目录。

7.2 wineboot 命令

wineboot performs the initial creation and setup of a WINEPREFIX for wine(1). It can also perform a simulated reboot or shutdown to any applications running within the WINEPREFIX.

ray@ray-ThinkPad-X250:~/Documents/system/vm/wine$ wineboot -h
Usage: wineboot [options]
Options;
    -h,--help         Display this help message
    -e,--end-session  End the current session cleanly
    -f,--force        Force exit for processes that don't exit cleanly
    -i,--init         Perform initialization for first Wine instance
    -k,--kill         Kill running processes without any cleanup
    -r,--restart      Restart only, don't do normal startup operations
    -s,--shutdown     Shutdown only, don't reboot
    -u,--update       Update the wineprefix directory
ray@ray-ThinkPad-X250:~/Documents/system/vm/wine$ 

7.3 Wine安装程序在Gnome里的desktop文件目录

~/.local/share/applications/wine

7.4 wine删除容器内安装的程序

export WINEPREFIX=~/.wineautocad 选定容器
wine uninstaller

参考URL:http://askubuntu.com/questions/101064/uninstall-a-program-installed-with-wine

8. 建议

这么多年wine依旧是这样,一点一点的有进步,却总也不能让人满足。现在我所使用的Office 2010软件是可以正常运行的,在需要紧急处理一些文档(主要是排版)的时候,就会调出来用,但是也不会用太长时间,毕竟很多时候还是会有写小的问题,比如右键不好用等。令人可喜的是支持的功能和可用的软件已经越来越多,只能寄望于未来了。
模拟WIN软件最好的方法还是Virtualbox 跑VM,然后运行需要的程序,当然这些程序最好不要依赖3D或声卡一类的,否则效果也不会特别好。

9. 深入研究文章

Wine Arch Linux Wiki

    原文作者:mst7
    原文地址: https://www.jianshu.com/p/6aa175a534c4
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞