项目

项目:https://github.com/tw93/Pake/

免费ICO图片:https://icon-icons.com/zh/

设置环境

以下教程仅针对windows系统适用

请确保您的 Node.js 版本为 18 或更高版本

文档:https://v1.tauri.app/zh-cn/v1/guides/getting-started/prerequisites/

  1. Microsoft Visual Studio C++ 生成工具

  2. WebView2

  3. Rust(难点)

前面两点容易,难的是安装Rust,原因在于网络互通,因为github,npm默认都是国外的地址,我的方法有两种:

设置代理方法1

1.我使用的是v2rayN 并将监听端口设置为7890,所以,打开cmd,输入以下代码

setx http_proxy "http://127.0.0.1:7891"
setx https_proxy "http://127.0.0.1:7891"

2.https://www.rust-lang.org/tools/install 下载Rust,双击打开,输入序号1安装依赖

Image

Image

方法2:使用winget安装rust

首先安装winget,如果你的系统没有安装winget ,步骤如下:

下载winget

https://github.com/microsoft/winget-cli/releases/download/v1.9.2507/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle

然后打开powershell,导航到下载目录,使用以下命令安装msixbundle文件:

Add-AppxPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle

换源

winget source remove msstore
winget source add winget https://cdn.winget.microsoft.com/cache

打开powershell,设置代理:

$env:http_proxy="http://127.0.0.1:7891"
$env:https_proxy="http://127.0.0.1:7891"

最后安装rust

winget install --id Rustlang.Rustup

命令行打包

首先安装pake-cli,步骤:

1.换源(可选)

npm config set registry https://mirrors.huaweicloud.com/repository/npm/

2.安装(必须)

npm install pake-cli -g

3.一键打包,参考如下:

pake https://woniu336.github.io --name bilibili --icon blog.ico --installer-language zh-CN --show-system-tray --system-tray-icon blog.ico
  • https://woniu336.github.io 打包的网址,前面带http/https
  • bilibili为名称,最好是单个英文,不能有下划线和中文
  • ico文件放在当前目录
  • zh-CN 设置安装程序为中文

更多参数:https://github.com/tw93/Pake/blob/master/bin/README_CN.md

最后,打包成功的文件在命令所在目录,以.msi为后缀

其他命令

清除代理命令,安装成功后可选

setx http_proxy ""
setx https_proxy ""

更新你的 Rust 版本

rustup update

卸载 Rust

rustup self uninstall

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部