自然定律 發表於 2022-7-5 00:58:00

Ubuntu安装Deepin-wine、微信、企业微信

<p>https://www.winehq.org/</p>
<p>一键安装deepin-wine、 微信、企业微信</p>
<pre><code class="language-sh">curl -s https://raw.githubusercontent.com/xmaples/scripts/main/shell/deepin-wine-wechat.sh | bash
</code></pre>
<h3 id="install-wine-6-on-ubuntu">Install Wine 6 on Ubuntu</h3>
<pre><code class="language-bash">sudo dpkg --add-architecture i386
sudo apt update
wget -qO- https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
sudo apt-add-repository "deb http://dl.winehq.org/wine-builds/ubuntu/ $(lsb_release -cs) main"
sudo apt install --install-recommends winehq-stable

</code></pre>
<h4 id="install-deepin-wine_218-22">Install deepin-wine_2.18-22</h4>
<pre><code class="language-bash">mkdir -p /tmp/deepin-wine
cd /tmp/deepin-wine
echo '下载deepin-wine安装包'
wget https://packages.deepin.com/deepin/pool/non-free/d/deepin-wine/deepin-wine_2.18-22~rc0_all.deb
wget https://packages.deepin.com/deepin/pool/non-free/d/deepin-wine/deepin-wine32_2.18-22~rc0_i386.deb
wget https://packages.deepin.com/deepin/pool/non-free/d/deepin-wine/deepin-wine32-preloader_2.18-22~rc0_i386.deb
wget https://packages.deepin.com/deepin/pool/non-free/d/deepin-wine-helper/deepin-wine-helper_1.2deepin8_i386.deb
wget https://packages.deepin.com/deepin/pool/non-free/d/deepin-wine-plugin/deepin-wine-plugin_1.0deepin2_amd64.deb
wget https://packages.deepin.com/deepin/pool/non-free/d/deepin-wine-plugin-virtual/deepin-wine-plugin-virtual_1.0deepin3_all.deb
wget https://packages.deepin.com/deepin/pool/non-free/d/deepin-wine-uninstaller/deepin-wine-uninstaller_0.1deepin2_i386.deb
wget https://packages.deepin.com/deepin/pool/non-free/u/udis86/udis86_1.72-2_i386.deb
wget https://packages.deepin.com/deepin/pool/non-free/d/deepin-wine/deepin-fonts-wine_2.18-22~rc0_all.deb
wget https://packages.deepin.com/deepin/pool/non-free/d/deepin-wine/deepin-libwine_2.18-22~rc0_i386.deb
wget https://packages.deepin.com/deepin/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_1.5.1-2_amd64.deb
wget https://packages.deepin.com/deepin/pool/main/libj/libjpeg-turbo/libjpeg62-turbo_1.5.1-2_i386.deb

#echo '添加32位支持'
sudo dpkg --add-architecture i386

echo '刷新apt缓存信息'
sudo apt-get update

echo '开始安装'
sudo dpkg -i *.deb

echo '安装依赖'
sudo apt install -fy
</code></pre>
<p>References:</p>
<ul>
<li>https://blog.csdn.net/Lunch2020/article/details/122853466</li>
<li>https://zhuanlan.zhihu.com/p/144286142</li>
</ul>
<h4 id="安装微信企业微信-install-deepin-wechat-weixin-work">安装微信、企业微信 Install deepin-wechat, weixin-work</h4>
<pre><code class="language-bash">mkdir -p /tmp/deepin-wine/wechat
cd /tmp/deepin-wine/wechat
echo '下载微信安装包'
wget https://packages.deepin.com/deepin/pool/non-free/d/deepin.com.wechat/deepin.com.wechat_2.6.8.65deepin0_i386.deb
wget https://packages.deepin.com/deepin/pool/non-free/d/deepin.com.weixin.work/deepin.com.weixin.work_2.8.10.2010deepin0_i386.deb
echo '安装'
sudo dpkg -i deepin.com.wechat_2.6.8.65deepin0_i386.deb
sudo dpkg -i deepin.com.weixin.work_2.8.10.2010deepin0_i386.deb
echo '安装完成'
</code></pre>
<p>requirement of deepin-wine &gt;= 2.18_19 for deepin.com.wechat_2.6.8.</p>
<hr>
<hr>
<p>environment variable <code>WINEPREFIX</code> can be set to the absolute path of the root directory path of a custom wine container for wine related commands.<br>
e.g.</p>
<pre><code class="language-sh">env WINEPREFIX="/home/xxx/.wine-2" wineserver -k
env WINEPREFIX="/home/xxx/.wine-3" winetricks corefonts
</code></pre>
<pre><code class="language-sh"># install winetricks
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
# chmod a+x winetricks      # make it executable
# mv winetricks /usr/local/bin      # move it into $PATH
# install core fonts
winetricks corefonts
# ./winetricks ...# without moving it into $PATH
# sh winetricks ...   # without making executable nor moving
</code></pre>
<pre><code class="language-sh"># config deepin-wine
deepin-wine winecfg
</code></pre>
<h5 id="在wine中用deepinubuntu本地相应程序打开文件">在Wine中用Deepin/Ubuntu本地相应程序打开文件</h5>
<p>基本原理是修改windows注册表将所有文件扩展名的对应到一个自定义处理程序脚本,脚本中调用linux程序来使用相应程序打开文件。</p>
<ol>
<li>创建可执行文件 <code>.wine/drive_c/linuxnativeopen.exe</code> (文件路径可自定义但需在wine容器系统中且后续步骤需对应该路径),并注入脚本代码(见后附)。</li>
</ol>
<pre><code class="language-sh">vim .wine/drive_c/linuxnativeopen.exe    # then typing the content, see appendix
chmod +x .wine/drive_c/linuxnativeopen.exe   # make it executable
</code></pre>
<ol start="2">
<li>编写一个windows registry(.reg)文件,在wine容器内注册表中注册文件类型的处理程序。</li>
</ol>
<pre><code class="language-sh">vim .wine/drive_c/linuxnative.reg   # 将.reg文件放到wine容器系统中
wine regedit .wine/drive_c/linuxnative.reg
</code></pre>
<p>Appendix 附文件内容:<br>
文件处理程序<code>linuxnativeopen.exe</code></p>
<pre><code class="language-txt">#!/bin/bash
LINUX_PATH=$(winepath "$@" 2&gt; /dev/null)    #如果是自定义了wine容器根目录,则需加上相应的WINEPREFIX环境变量
/usr/bin/xdg-open "$LINUX_PATH"
</code></pre>
<p>注册表脚本<code>linuxnative.reg</code></p>
<pre><code class="language-txt">REGEDIT4


@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"

@="linuxnative"
"Content Type"="application/linuxnative"




@="c:\\linuxnativeopen.exe \"%1\""
</code></pre>
<h2 id="faq">FAQ</h2>
<p>(wine5)</p>
<h5 id="微信不能显示中文">微信不能显示中文?</h5>
<p>1、是否缺少中文字体?<br>
通过winetricks安装<br>
或手动安装<br>
安装中文字体:<br>
(1)复制字体文件到.wine/drive_c/Windows/Fonts/目录。<br>
(2)在注册表中注册。(可从windows系统中注册表导出 HKLM/Software/Microsoft/Windows NT/Fonts为.reg文件,然后用wine regedit /path/to/file.reg)</p>
<p>2、是否设置wine的中文环境?<br>
如果在英文环境中运行wine,则会导致显示中文乱码,可在运行命令前LANG环境变量指定到中文,如<br>
(1)通过find找到微信的.desktop启动文件,<code>find ~/.local -iname '*wechat*.desktop'</code>,一般在~/.local/share/applications/wine/Programs/Wechat.desktop.<br>
(2)对Exe命令增加LANG等环境变量,如<code>Exec=env LANG=zh_CN.UTF-8 XMODIFIERS="@im=fcitx" GTK_IM_MODULE="fcitx" QT_IM_MODULE="fcitx" WINEPREFIX=....</code></p>
<p>或直接修改<code>/opt/deepinwine/tools/run.sh</code>中WINECMD,添加语言环境变量。</p>
<h5 id="wine微信输入框不显示已输入文字不论中英文但实际可发送消息">wine微信输入框不显示已输入文字(不论中英文)但实际可发送消息?</h5>
<p>已执行命令<code>winetricks riched20</code>,无报错,<strong>没有</strong>提示下载InstMsiW.exe或W2KSP4_EN.EXE失败,仅提示已安装riched20。输出如下</p>
<pre><code class="language-txt">------------------------------------------------------
You are using a 64-bit WINEPREFIX. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing w_do_call riched20
riched20 already installed, skipping
</code></pre>
<p>解决方案:<br>
强制重新安装riched20,<code>winetricks --force riched20</code>,会自动试图下载InstMsiW.exe及W2KSP4_EN.EXE,一般都会下载失败,故手动从网上下载此二文件,然后存放路径为<code>~/.cache/winetricks/msls31/InstMsiW.exe</code>及<code>~/.cache/winetricks/win2ksp4/W2KSP4_EN.EXE</code>,之后强制重新安装<code>winetricks --force riched20</code>。<br>
InstMsiW.exe及W2KSP4_EN.EXE的参考下载网址:https://saimei.ftp.acc.umu.se/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE<br>
https://chuangtzu.ftp.acc.umu.se/mirror/archive/ftp.sunet.se/pub/security/vendor/microsoft/win2000/Service_Packs/usa/W2KSP4_EN.EXE<br>
https://whp-aus2.cold.extweb.hp.com/pub/softlib/software/msi/InstMsiW.exe</p>
<p>P&gt; NSIS error launching installer<br>
S: try to place the .exe file under wine container path, e.g. ~/.wine/drive_c/, and then install it by a dos-style path, e.g. <code>wine C:\\APP.exe</code> for a installer file located at <code>~/.wine/drivce_c/APP.exe</code>.</p>
<hr>
<p>使用经历:</p>
<p>wine 微信问题:<br>
一段时候后再次打开微信,在中文输入法下打出的是英文,转到terminal或其他程序编辑正常输入中文后回到企业微信可以输入中文,回到微信可以输入中文</p><br><br>
来源:https://www.cnblogs.com/xmaples/p/16442488.html
頁: [1]
查看完整版本: Ubuntu安装Deepin-wine、微信、企业微信