Flutter_Installer
Flutter_Installer copied to clipboard
interrupt causing failure
hey @YazeedAlKhalaf @csells , I have found this issue long back but forgot to raise a issue here. when i wanna switch channels, and downloads the flutter zip, while extracting if any interrupt was happened it is corrupting the whole flutter files. hope you get a note of it. Regards.
@YazeedAlKhalaf ahh better make this also a critical thing. we have have a fix in future.
What kind of interrupt, can you provide reproduction steps?
Steps to reproduce:
- Install flutter in your pc.
- Try installing another channel from this installer to your flutter installed folder, in my case, it is
C:/src/
. (If stable then try to install dev or beta). - Wait till it gets to the extracting process.
- Now cancel it (during extracting).
- Try executing flutter command in your cmd or terminal/zsh.
- You will find it crashing.
This is the result when I try to change the channel(stable to master)
So you mean that when you choose a directory in which flutter is in then the files are corrupted. So I believe the solution would be to add a check to see if the directory is empty or not. If not empty then tell the user to change the directory of the installation?
Tell me if I got you right.
@YazeedAlKhalaf I know if we interrupt any process while upgrading or channel switching, it will also cause the same issue. But Our process must avoid that. To do that
- Backup the existing flutter(if exist only).
- Store a copy in our temp folder.
- When process get interrupt, then just remove the processed files and replace users old files and say user that process interruption may fail the process and we have restores your old files instead failing it.
- we even have custom -, X, [] icons too here.
- Do same functionality on X button also and then exit.
@YazeedAlKhalaf I know if we interrupt any process while upgrading or channel switching, it will also cause the same issue. But Our process must avoid that. To do that
- Backup the existing flutter(if exist only).
- Store a copy in our temp folder.
- When process get interrupt, then just remove the processed files and replace users old files and say user that process interruption may fail the process and we have restores your old files instead failing it.
- we even have custom -, X, [] icons too here.
- Do same functionality on X button also and then exit.
But won't ending task or closing just end the instance Flutter Installer.exe
on Windows for example. How would we restore the directory, it would take time to restore so the user might just kill the app from Task Manager.
So I think checking if files exist we just do not install there as proposed in issue #5
What do you think?
we must show some info about getting existing backup and restoring it to the user on both processes. If still the user don't want that then that is his mistake. Then errors will be raised and we must handle that too.