pop-os / popsicle

Multiple USB File Flasher
MIT License
636 stars 77 forks source link

Cross platform support? (Windows version) #166

Open A9G-Data-Droid opened 2 years ago

A9G-Data-Droid commented 2 years ago

I normally use https://github.com/balena-io/etcher for cross platform image writing needs but I would prefer to use Popsicle.

Is there any interest in supporting Windows?

Would there be any resistance to me trying to get this to run on Windows?

ids1024 commented 2 years ago

I quite like the idea of Windows support, and have thought of trying to add it. (If only so we can document Popsicle as the canonical way to create a Pop!_OS USB drive on Windows as well.)

I have a couple concerns though.

A9G-Data-Droid commented 2 years ago

While developing the code to write Windows 10 ISOs there should be some consideration given to cross platform methods. It could be developed using preexisting cross platform tools, like 7-zip for ISO decompression. It could be decompressed directly on to target combining your "read\mount" and "copy" steps in to one step. Maybe there is a rust native way of decompressing ISOs to avoid the reliance on 7zip libraries.

I would think there must be a rust tool for cross platform disk formatting. If not, that's a useful crate to exist in it's own right. Maybe that's the next step.

ids1024 commented 2 years ago

Maybe there is a rust native way of decompressing ISOs to avoid the reliance on 7zip libraries.

I think that library is for a different format, it just happens to be sometimes given the .iso extension since that's common for disk images. Actually, I've written a partial isofs implementation in Rust, but even if that's robust enough, if I recall correctly the Windows 10/11 ISOs actually use the newer UDF filesystem.

I would think there must be a rust tool for cross platform disk formatting. If not, that's a useful crate to exist in it's own right. Maybe that's the next step.

Could be useful. One complication is that Popsicle accesses USB drives with the udisks2 dbus API, so it doesn't require root access and can run in a Flatpak sandbox. An ideal abstraction would with with udisks2, direct operations via root access, or however Windows does things.

I've been meaning to work on better backend abstractions, using async IO. Which is more possible now that zbus 2.0 has released. But I have other projects to work on currently.

techguy16 commented 1 year ago

GTK applications can run on Windows, like @ids1024 said, but they are a giant pain to get working. Popsicle uses some Linux-only libraries, so these would have to be reverse-engineered for Windows.

If you could get around these two issues, it would be possible, but you would have to maintain two versions, one for Linux, and one for Windows, because you would have to implement everything from the Linux one in Windows, so the Windows version would get features a few weeks or even a few months after the Linux version.

mmstick commented 1 year ago

Nothing necessarily has to be reverse-engineered. Just adding code to flash devices on Windows with Windows APIs.