Mac上安装Wine

Wine可以模拟Windows中的dll调用,从而使Windows程序可以运行在非BSD/UNIX/Linux平台上

1.安装XCode

2.安装MacPorts

3.配置MacPorts
依次执行下面的命令,需要admin授权
配置MacPorts路径

echo export PATH=/opt/local/bin:/opt/local/sbin:\$PATH$'\n'export MANPATH=/opt/local/man:\$MANPATH | sudo tee -a /etc/profile

配置cpu位数

if [ `sysctl -n hw.cpu64bit_capable` -eq 1 ] ; then echo "+universal" | sudo tee -a /opt/local/etc/macports/variants.conf; else echo "not 64bit capable"; fi

4.下载并编译wine

sudo port install wine

5.wine中安装软件

wine $INSTALLER.exe

或者是拷贝exe文件到wine下,但你要自己保证dll文件都在哟
wine的默认目录为

cd ~/.wine/drive_c

6.运行wine中软件

cd ~/.wine/drive_c/Program\ Files/
wine $PROGRAM.exe

7.增加桌面图标
在附件中找到AppleScript编辑器,把下面的东西粘进去

tell application "Terminal"
    do script "/opt/local/bin/wine ~/.wine/drive_c/Program\\ Files/$PATH_TO_PROGRAM.exe"
end tell

编译并运行试一下,如果可以的话,另存为Application
将其拖拽到Dock上就可以啦:)

8.更新Wine

sudo port selfupdate && sudo port upgrade outdated

9.卸载Wine

sudo port uninstall wine
sudo rm -rf /opt ~/.wine /Applications/MacPorts

如果我写的不够仔细,请参考下面的文章:
Installing Wine on Mac OS X

Leave a Reply

Your email address will not be published. Required fields are marked *

*