Mac m1 安装Wine/WineHQ

Wine (“Wine Is Not an Emulator” 的首字母缩写)是一个能够在多种 POSIX-compliant 操作系统(诸如 Linux,macOS 及 BSD 等)上运行 Windows 应用的兼容层。Wine 不是像虚拟机或者模拟器一样模仿内部的 Windows 逻辑,而是將 Windows API 调用翻译成为动态的 POSIX 调用,免除了性能和其他一些行为的内存占用,让你能够干净地集合 Windows 应用到你的桌面。

在m1上安装尝试了比较多的教程,基本都失败了。直到看到这篇文章:https://git.boc-group.eu/adoxxosports/adoxx-15-64bit/-/blob/master/Installation%20Manual%20(M1)%20Wine%20und%20Azure%20SQL

下面简单记录一下安装步骤:

1.如果安装过wine通过下面的命令删除旧版本:

brew uninstall --cask xquartz
brew uninstall --cask wine-stable
rm -rf ${HOME}/.wine_adoxx64

2.安装m1版本wine

brew tap gcenx/wine
brew install --cask --no-quarantine wine-crossover
(base) zhongming@ZhongMingdeMacBook-Pro ~ % brew install --cask --no-quarantine wine-crossover

Updating Homebrew...
==> Caveats
wine-crossover supports both 32-bit and 64-bit now. It is compatible with your
existing 32-bit wine prefix, but it will now default to 64-bit when you
create a new wine prefix. The architecture can be selected using the
  WINEARCH environment variable which can be set to either win32 or
win64.

To create a new pure 32-bit prefix, you can run:
    $ WINEARCH=win32 WINEPREFIX=~/.wine32 winecfg
See the Wine FAQ for details: https://wiki.winehq.org/FAQ#Wineprefixes

To enable noflicker set the following registry key in your prefix:
[HKCU\Software\Wine\Mac Driver]
"ForceOpenGLBackingStore"="y"


y
==> Downloading https://github.com/Gcenx/homebrew-wine/releases/download/20.0.2/wine-crossover-20.0.2-osx64.tar.xz
==> Downloading from https://github-releases.githubusercontent.com/240977125/509ec980-9337-11eb-86db-469e60cf048c?X-Amz-Algorithm=A
######################################################################## 100.0%
All formula dependencies satisfied.
==> Installing Cask wine-crossover
Warning: macOS's Gatekeeper has been disabled for this Cask
==> Moving App 'Wine Crossover.app' to '/Applications/Wine Crossover.app'
==> Linking Binary 'appdb' to '/opt/homebrew/bin/appdb'
==> Linking Binary 'winehelp' to '/opt/homebrew/bin/winehelp'
==> Linking Binary 'msiexec' to '/opt/homebrew/bin/msiexec'
==> Linking Binary 'notepad' to '/opt/homebrew/bin/notepad'
==> Linking Binary 'regedit' to '/opt/homebrew/bin/regedit'
==> Linking Binary 'regsvr32' to '/opt/homebrew/bin/regsvr32'
==> Linking Binary 'wine64' to '/opt/homebrew/bin/wine64'
==> Linking Binary 'wineboot' to '/opt/homebrew/bin/wineboot'
==> Linking Binary 'winecfg' to '/opt/homebrew/bin/winecfg'
==> Linking Binary 'wineconsole' to '/opt/homebrew/bin/wineconsole'
==> Linking Binary 'winedbg' to '/opt/homebrew/bin/winedbg'
==> Linking Binary 'winefile' to '/opt/homebrew/bin/winefile'
==> Linking Binary 'winemine' to '/opt/homebrew/bin/winemine'
==> Linking Binary 'winepath' to '/opt/homebrew/bin/winepath'
==> Linking Binary 'wineserver' to '/opt/homebrew/bin/wineserver'
==> Linking Binary 'wine' to '/opt/homebrew/bin/wine'
==> Linking Binary 'wine32on64' to '/opt/homebrew/bin/wine32on64'
🍺  wine-crossover was successfully installed!

3.测试wine

LANG=en_US WINEARCH=win64 WINEPREFIX=${HOME}/.wine_adoxx64 WINEDEBUG=-all wine64 explorer.exe

到这一步wine就安装成功了。

附原文安装脚本:

# Evaluation of Wine Installation on M1
## Remove pre-existing installation
brew uninstall --cask xquartz
brew uninstall --cask wine-stable
rm -rf ${HOME}/.wine_adoxx64
## Install Wine for M1 (as discussed here https://github.com/Gcenx/homebrew-wine)
brew tap gcenx/wine
brew install --cask --no-quarantine wine-crossover
# Test Wine on M1
LANG=en_US WINEARCH=win64 WINEPREFIX=${HOME}/.wine_adoxx64 WINEDEBUG=-all wine64 explorer.exe
EXPECTED RESULT:
a) Installation of Wine in prefix (please be patient, takes some time when run the first time)
b) Windows File Explorer opens
c) Close the explorer -> wine process ends in terminal
- - - - - - - - - - 
CHECKPOINT: WINE OK
- - - - - - - - - - 
# Running ADOxx with Azure Edge
a) Evaluate obdcinst
Open terminal and run odbcinst
Expected results: prints help information of odbcinst for unix
- - - - - - - - - - 
CHECKPOINT: ODBCINST OK
- - - - - - - - - - 
b) Setup SQL Azure
docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'SA_PASSWORD=12+*ADOxx*+34' -p 1433:1433 --name ADOXX15EN -d mcr.microsoft.com/azure-sql-edge
b) Create database (manually)
# UPDATE RUN FROM HOST
sudo docker exec -it ADOXX15EN mkdir -p /tmp/adoxx_install
sudo docker cp support/createUser.sql ADOXX15EN:/tmp/adoxx_install
sudo docker exec -it ADOXX15EN /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '12+*ADOxx*+34' -i /tmp/adoxx_install/createUser.sql
sudo docker exec -it ADOXX15EN mkdir -p /opt/mssql/adoxx_data
sudo docker cp support/createDB.sql ADOXX15EN:/tmp/adoxx_install
sudo docker exec -it ADOXX15EN /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P '12+*ADOxx*+34' -i /tmp/adoxx_install/createDB.sql
c) Enter license information (manually)
mkdir -p "${HOME}/.wine_adoxx64/drive_c/Program Files/BOC/"
cp -rf ADOxx15_EN_SA "${HOME}/.wine_adoxx64/drive_c/Program Files/BOC/"
sudo xattr -r -d com.apple.quarantine "${HOME}/.wine_adoxx64/drive_c/Program Files/BOC/ADOxx15_EN_SA"
WINEARCH=win64 WINEPREFIX="${HOME}/.wine_adoxx64" WINEDEBUG=-all wine64 "C:/Program Files/BOC/ADOxx15_EN_SA/asetlic.exe" -plicense.ini -Lalicdat.ini
cp -f alicdat.ini "${HOME}/.wine_adoxx64/drive_c/Program Files/BOC/ADOxx15_EN_SA/"
cp -f license.ini "${HOME}/.wine_adoxx64/drive_c/Program Files/BOC/ADOxx15_EN_SA/"
ATTENTION: COPY/PASTE the content from alicdat.ini
LANG=en_US WINEARCH=win64 WINEPREFIX="${HOME}/.wine_adoxx64" WINEDEBUG=-all wine64 "C:/Program Files/BOC/ADOxx15_EN_SA/adbinst.exe" -dadoxx15 -l<COPY_PASTE> -sSQLServer -iNO_SSO -lang2057
OR
b) Re-run the installation script of ADOxx

 

☆版权☆

* 网站名称:obaby@mars
* 网址:https://h4ck.org.cn/
* 个性:https://oba.by/
* 本文标题: 《Mac m1 安装Wine/WineHQ》
* 本文链接:https://h4ck.org.cn/2021/06/8305
* 短链接:https://oba.by/?p=8305
* 转载文章请标明文章来源,原文标题以及原文链接。请遵从 《署名-非商业性使用-相同方式共享 2.5 中国大陆 (CC BY-NC-SA 2.5 CN) 》许可协议。


猜你喜欢:

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注