tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
80.46k stars 2.4k forks source link

[如何解决安装失败] #7338

Open rjl-cli opened 1 year ago

rjl-cli commented 1 year ago

Describe the bug

Downloading https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
Error failed to bundle project: https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip: Connection Failed: Connect error: 由于连接方在一段时间后没有正确答复或连接 的主机没有反应,连接尝试失败。 (os error 10060) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproduction

Downloading https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
Error failed to bundle project: https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip: Connection Failed: Connect error: 由于连接方在一段时间后没有正确答复或连接 的主机没有反应,连接尝试失败。 (os error 10060) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior

Downloading https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip
Error failed to bundle project: https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip: Connection Failed: Connect error: 由于连接方在一段时间后没有正确答复或连接 的主机没有反应,连接尝试失败。 (os error 10060) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Platform and versions

Downloading https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip    
       Error failed to bundle project: `https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip: Connection Failed: Connect error: 由于连接方在一段时间后没有正确答复或连接 的主机没有反应,连接尝试失败。 (os error 10060)`
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Stack trace

No response

Additional context

No response

FabianLars commented 1 year ago

I think something (yourproxy?) is blocking the github download or just timing out. Can you try what's described here? https://github.com/tauri-apps/tauri/issues/2616 ? -> Download the file yourself and extract it into C:\Users\yourname\AppData\Local\tauri\WixTools\ and then try again :)

zyppe commented 1 year ago

This is just because of GFW, you should use proxy or VPN or try offline install solution.

zyppe commented 1 year ago

@FabianLars Is it possible to try to check if the IP is from China mainland? If it, then try to download from github mirrors, such as kgithub.com or others. The link failed to download mensioned can be changed to https://kgithub.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip

TZDXF commented 1 year ago

手动下载文件,并解压到C:\Users\你的用户名\AppData\Local\tauri\WixTools下, 对应源码 https://github.com/tauri-apps/tauri/blob/dev/tooling/bundler/src/bundle/windows/msi.rs#L29

后边你还可能遇到 nsis 下载失败,同样的办法 解压到C:\Users\你的用户名\AppData\Local\tauri\NSIS 后续还有可能遇到 nsis插件下载失败 ,同样,手动下载,解压到对应文件夹 对应源码 https://github.com/tauri-apps/tauri/blob/dev/tooling/bundler/src/bundle/windows/nsis.rs "Plugins/x86-unicode/ApplicationID.dll", "Plugins/x86-unicode/nsis_tauri_utils.dll",

jiafuzhang commented 1 year ago

这么好的东西,中国用不了,可惜了

xphost008 commented 1 year ago

但是,这个方法并不凑效。。 似乎tauri会自动的将AppData\Local\tauri\NSIS整个文件夹删掉。

它有个提示:似乎说的是NSIS文件夹下缺失某个文件,需要重新创建一次,我不明白到底缺了什么文件。

        Warn NSIS directory is missing some files. Recreating it.
        Info Verifying NSIS package

不知道什么原因,我将下载下来的zip包,无论放到该文件夹里的任何地方,都会使得以下报错被触发:

Downloading https://github.com/tauri-apps/binary-releases/releases/download/nsis-3/nsis-3.zip
       Error failed to bundle project: `https://github.com/tauri-apps/binary-releases/releases/download/nsis-3/nsis-3.zip: Connection Failed: tls connection init failed: invalid peer certificate: UnknownIssuer`

不仅该报错被触发,我原本解压nsis的zip包放在上述目录中的文件也一并被移除了。 很明显,我的电脑具备上外网的能力,包括github,只是下载接着接着失败罢了。 如果有知情者告诉我该怎么做,我将不胜感激!

but, this method is not effective It seems that tauri will auto delete the path folder by AppData\Local\tauri\NSIS. it has a tip: seem that say NSIS folder is missing some files, need to recreating once, I'm not understand whatever it missing file.

        Warn NSIS directory is missing some files. Recreating it.
        Info Verifying NSIS package

I dont know cause about it, whether I put the nsis zip package everywhere in my folder, this Exception just appear.

Downloading https://github.com/tauri-apps/binary-releases/releases/download/nsis-3/nsis-3.zip
       Error failed to bundle project: `https://github.com/tauri-apps/binary-releases/releases/download/nsis-3/nsis-3.zip: Connection Failed: tls connection init failed: invalid peer certificate: UnknownIssuer`

not only this exception appear, but also I put the unzipped nsis zip package in the above folder already delete soon. Actually, My Computer has Accessing the foreign website ability, include github, Just I cant Download it.. if someone know how to do it, I will appreciate much!

jiafuzhang commented 1 year ago

@rechalow

要解压了再放?

TZDXF commented 1 year ago

@rechalow @rjl-cli 我再说详细点

首先是msi中的wix安装的失败,网络上有很多答案 手动下载文件,并解压到C:\Users\你的用户名\AppData\Local\tauri\WixTools下, 下载地址 https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip 对应源代码地址为 https://github.com/tauri-apps/tauri/blob/dev/tooling/bundler/src/bundle/windows/msi/wix.rs#L33 https://github.com/tauri-apps/tauri/blob/dev/tooling/bundler/src/bundle/windows/msi.rs#L28

重点!!! msi.rs中 WIX_REQUIRED_FILES 会检查这里的文件是否存在,不存在会删除文件重新下载。接下来的nsis也是同样的问题。

第二!!! nsis 手动下载文件nsis 解压到C:\Users\你的用户名\AppData\Local\tauri\NSIS 下载地址 https://github.com/tauri-apps/binary-releases/releases/download/nsis-3/nsis-3.zip 对应源码地址 https://github.com/tauri-apps/tauri/blob/dev/tooling/bundler/src/bundle/windows/nsis.rs#L47

注意! NSIS这里检测的文件有两个插件是不包含再nsis-3.zip中的。

  "Plugins/x86-unicode/ApplicationID.dll",
  "Plugins/x86-unicode/nsis_tauri_utils.dll",

源码中给到了这两个文件的下载地址

const NSIS_APPLICATIONID_URL: &str = "https://github.com/tauri-apps/binary-releases/releases/download/nsis-plugins-v0/NSIS-ApplicationID.zip";
const NSIS_TAURI_UTILS: &str =
  "https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.1.1/nsis_tauri_utils.dll";

如果检测到没有这两个文件,就会删除NSIS文件夹,从头开始下载,这就是你@rechalow文件被删的原因 这两个文件按照上边给到的位置放进去就可以了。

到此为止,就可以了

简略的文件树 C:\Users\用户名\AppData\Local\tauri> ├─NSIS │ ├─Bin │ ├─Contrib │ ├─Docs │ ├─Examples │ ├─Include │ ├─Plugins │ │ ├─x86-ansi │ │ └─x86-unicode 下载的插件放这里 │ └─Stubs └─WixTools

xphost008 commented 1 year ago

好了,它已经解决了,谢谢你! Ok, It fixed! thank you! @TZDXF

suxin2017 commented 1 year ago

我写了一段ps脚本

mkdir temp
cd temp

curl  https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip -LO 

Expand-Archive ./wix311-binaries.zip -DestinationPath ./WixTools

curl  https://github.com/tauri-apps/binary-releases/releases/download/nsis-3/nsis-3.zip -LO 

Expand-Archive ./nsis-3.zip -DestinationPath ./NSIS

mv .\NSIS\nsis-3.*\* .\NSIS
rmdir .\NSIS\nsis-3.*

curl https://github.com/tauri-apps/binary-releases/releases/download/nsis-plugins-v0/NSIS-ApplicationID.zip -LO

Expand-Archive .\NSIS-ApplicationID.zip -DestinationPath .\NSIS-ApplicationID

mv .\NSIS-ApplicationID\Release\* .\NSIS\Plugins\x86-unicode

curl https://github.com/tauri-apps/nsis-tauri-utils/releases/download/nsis_tauri_utils-v0.1.1/nsis_tauri_utils.dll -LO

mv .\nsis_tauri_utils.dll .\NSIS\Plugins\x86-unicode

mv .\NSIS ~\AppData\Local\tauri\NSIS
mv .\WixTools ~\AppData\Local\tauri\WixTools

echo "rm temp dir"

rm -r .\NSIS-ApplicationID
rm .\nsis-3.zip
rm .\NSIS-ApplicationID.zip
rm .\wix311-binaries.zip
rm .\temp

echo "done"

简化了这个过程

borankux commented 11 months ago

why do we have to always waste our lives on this kinda stuff

liuhuapiaoyuan commented 8 months ago

中国程序员总是要花费更多的时间

wwalkingg commented 7 months ago

The process of downloading does not follow through with the proxy. But why?

wwalkingg commented 7 months ago

By the way, /Local/AppData/tauri/ dir doese not exist in Tauri2.0.

jeffery-zhang commented 6 months ago

Same issue. Solved, thx!

lonelam commented 6 months ago

"For those who may encounter the same problem in mainland China: You can set the following in your .bashrc for proxy purposes:

export https_proxy=http://127.0.0.1:7890;
export http_proxy=http://127.0.0.1:7890;
export all_proxy=socks5://127.0.0.1:7890;

However, note that the Tauri bundler project does not support SOCKS proxies.

You can resolve this by unsetting the all_proxy using unset all_proxy, which should work fine if your proxy tool supports http_proxy and https_proxy.

If that's not the case, consider enabling the SOCKS feature of the ureq dependencies in the Tauri bundler."


"对于在中国大陆可能遇到同样问题的用户: 您可以在.bashrc文件中设置以下代理配置:

export https_proxy=http://127.0.0.1:7890;
export http_proxy=http://127.0.0.1:7890;
export all_proxy=socks5://127.0.0.1:7890;

但请注意,Tauri 打包项目不支持 SOCKS 代理。

您可以通过使用 unset all_proxy 命令来取消设置 all_proxy,如果您的代理工具支持 http_proxy 和 https_proxy,这应该是有效的。

如果不支持,可以尝试启用 Tauri 打包器中 ureq 依赖项的 SOCKS 功能。"

PlayerAI commented 6 months ago

Remember add another environment variable, in case you have local server need to access localhost: no_proxy = localhost,127.0.0.1,::1

liudonghua123 commented 6 months ago

Some files in nsis-3 changed since May of 2023, and I need to update %localappdata%\tauri\NSIS and %localappdata%\tauri\NSIS\Plugins\x86-unicode manually.

See more details in the code.

mashanz commented 3 months ago

I think something (yourproxy?) is blocking the github download or just timing out. Can you try what's described here? #2616 ? -> Download the file yourself and extract it into C:\Users\yourname\AppData\Local\tauri\WixTools\ and then try again :)

This works like a charm 🔥🚀

shuangmuaigwu commented 1 month ago

Version 314 folder name renamed to WixTools314

zengyuhan503 commented 4 weeks ago

我认为某些东西(你的代理?)阻止了 github 下载或只是超时。 你可以尝试这里描述的方法吗?#2616? -> 自行下载文件并将其解压到C:\Users\yourname\AppData\Local\tauri\WixTools\,然后重试 :)

After validation, you need to change the 'WixTools' name to' WixTools314 '

C:\Users\yourname\AppData\Local\tauri\WixTools314\

9mlcy7 commented 3 days ago

https://github.com/tauri-apps/tauri/discussions/3770#discussioncomment-2430117

travisbikkle commented 6 hours ago

说说我的看法。GFW这些东西,不是普通人能阻止的,而且你也不能指望 github 在所有地方都能访问。 Electron可以设置如下变量,来从 mirror 下载。

$env:ELECTRON_BUILDER_BINARIES_MIRROR = "https://npmmirror.com/mirrors/electron-builder-binaries/"
$env:ELECTRON_MIRROR = "https://npmmirror.com/mirrors/electron/"

tauri 有类似的设置吗? 其他人说的下载后手动解压的方案,实在是太low了。