diff --git a/.github/workflows/build-exe.yml b/.github/workflows/build-exe.yml index 51e261e..d7e0fe7 100644 --- a/.github/workflows/build-exe.yml +++ b/.github/workflows/build-exe.yml @@ -36,9 +36,9 @@ jobs: sleep 3 # 给虚拟显示器几秒钟的启动时间 # 步骤 3: 下载 Python Windows 安装包 - - name: Download Python 3.9.9 + - name: Download Python 3.9.1 run: | - wget https://mirrors.tuna.tsinghua.edu.cn/python/3.9.9/python-3.9.9-amd64.exe -O python-installer.exe + wget https://mirrors.tuna.tsinghua.edu.cn/python/3.9.1/python-3.9.1-amd64.exe -O python-installer.exe ls -lh python-installer.exe # 步骤 4: 初始化 Wine 环境 @@ -48,12 +48,15 @@ jobs: wineboot -u # 重要:等待 Wine 后台配置进程完全结束 wineserver -w + # 将 Wine 配置为 Windows 10 (Python 3.9+ 强制要求 Win8 以上) + winecfg -v win10 + wineserver -w # 步骤 5: 在 Wine 中安装 Python - name: Install Python in Wine run: | - # /quiet 表示静默安装 - wine python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0 + # /quiet 表示静默安装,加入 /log 参数抓取日志以便排错 + wine python-installer.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0 /log python-install.log || (cat python-install.log && exit 1) # 重要:静默安装往往是异步的,必须等待 wineserver 彻底结束,防止 X connection 突然断开 wineserver -w # 安装完后立即删除安装包,释放硬盘