pingbird / puro

A powerful tool for installing and upgrading Flutter versions.

Home Page:https://puro.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

puro fails to extract the dart engine in Windows 10

feinstein opened this issue · comments

I installed puro on my Windows 10 machine and ran puro flutter --version to start the download and installation of flutter's stable version. The engine downloads fine, but then all fails. I ran it again with log-level=4 and I can see puro tries to find 7z in my machine to extract the engine, after it's downloaded, but I don't have 7z. Then it proceeds to try to extract it using a powershell command, and this command also fails, saying the arguments list is wrong (I don't remember precisely, it was something like "1 argument is missing").

So I installed 7zip and now it fails again. From what I can see 7zip in installed in a folder with a space in the name C:\Program Files\... and puro is not taking the spaces in consideration while trying to extract the engine. I imagine this could also be the reason why the powershell extraction command fails.

All commands executed by puro on paths loaded from the system must be under quotes to avoid spaces breaking the commands.

commented

This sort of sounds like what was happening here: #62

Puro does not execute any commends with a shell, my best guess is a bug in Dart or an antivirus is passing the child commands to a shell un-escaped causing them to break. None of my windows machines exhibit this behavior, so I'm not sure how to fix it.

Do you have spaces on your machines? Mine breakes at "Program Files".

Maybe something related to this: dart-lang/sdk#42571? Maybe not because he is using runInShell.

commented

The open issues about escaping on the dart repo are related to arguments, not the executable, under normal circumstances Process.run("C:\\Program Files\\7-Zip\\7z.exe", []) should work fine

commented

hmm, the calls to 7z actually do have runInShell: true, let me push a new release without that

Remember it also breaks if I don't have 7z installed, does the other extractor also runs with runInShell: true?

Also, why the optional 7z? Is it faster?

commented

Yes, 7z is much faster for extracting than powershell's Expand-Archive, so puro prefers it where possible.

I just pushed 1.4.6 which uses a new version of dart and removes runInShell for extraction, let me know if that works!

So maybe puro should show a warning when it doesn't detect 7z, so people have a chance to install it?

I will test it and let you know

It works! Thanks! I just got 2 warnings, one that the dart version can't be found (which I think it's expected, since it's the first run and there are no engines in puro's folders.... And another regarding symlinks needing elevation and dev mode (which I am still not sure which is the best option, for security).

You can close this issue now and link it with a PR if you want to.

Thanks!