Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for Windows #68

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Build for Windows #68

wants to merge 6 commits into from

Conversation

chrisx8
Copy link

@chrisx8 chrisx8 commented Apr 29, 2021

Hi there! I noticed restic has a Windows binary but autorestic doesn't, so I thought I'd modify the build script to build Windows (32 and 64-bit) binaries. Here are some things I changed:

  • Add Windows (32 and 64-bit) to build targets
  • File names of Windows binaries has the required exe extension
  • Use zip compression for Windows, as Windows systems can't decompress bzip2 archives without 3rd-party programs. Code is heavily inspired by restic's build script :)
  • Configure the GitHub Actions workflow to only release bzip2 and zip files.

Releases are still created the same way with the Actions workflow, and now include Windows binaries.

Edit: I did some basic testing (local backup/restore a test directory) on my Windows machine (running Windows 10 20H2, 64bit) and it seems to work well.

@vercel
Copy link

vercel bot commented Apr 29, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/cupcakearmy/autorestic/F3PL2GemunCGxGXfTFhTe8qUJZz9
✅ Preview: https://autorestic-git-fork-chrisx8-master-cupcakearmy.vercel.app

@chrisx8 chrisx8 marked this pull request as ready for review April 29, 2021 21:02
@cupcakearmy
Copy link
Owner

Thank you very much!
I'll need to test some stuff out, like all the path stuff

const INSTALL_PATH = "/usr/local/bin"

but would be great to have support for that.

@cupcakearmy
Copy link
Owner

Also the install script would need some love.

@chrisx8
Copy link
Author

chrisx8 commented Apr 30, 2021

Local backup seems to work fine. In the config file (.autorestic.yml), just specify paths like one usually do on Windows (like D:\backup\restic1) would work. I haven't tested any remote backup targets though.

The self-upgrade function probably would be broken in many ways. I'll take a look when I have some more time.

@cupcakearmy
Copy link
Owner

If you want you can work on it, otherwise I can do that too, but not before tuesday as I have quite some stuff to do :)

@cupcakearmy cupcakearmy added the enhancement New feature or request label May 4, 2021
@cupcakearmy cupcakearmy modified the milestones: 1.1, 1.2 May 4, 2021
@cupcakearmy cupcakearmy removed this from the 1.2 milestone Aug 3, 2021
@cqjjjzr
Copy link

cqjjjzr commented Dec 22, 2021

is zip preinstalled on windows

Not really. However, we have tar.exe and Compress-Archive Powershell cmdlet. How about these?

@cqjjjzr
Copy link

cqjjjzr commented Dec 22, 2021

One more question, I'm planning to test out if Ctrl+C works normally on Windows. Ideally, it should send SIGINT to the underlying restic process so it can clean up and exit gracefully, so I need to do some tests.

More Information: https://docs.microsoft.com/en-us/windows/console/ctrl-c-and-ctrl-break-signals

@chrisx8
Copy link
Author

chrisx8 commented Dec 22, 2021

is zip preinstalled on windows?

Windows File Explorer can open and create zip archives. There's also Expand-Archive in PowerShell. Both options are built in to Windows, which is why I packaged Windows releases as zip.

@vercel
Copy link

vercel bot commented May 3, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
autorestic ✅ Ready (Inspect) Visit Preview May 3, 2022 at 2:09AM (UTC)

@arabcoders
Copy link

@cupcakearmy any chance of getting this merged into main build?

@shahvirb
Copy link
Contributor

Hi, I'd love to see this get merged as well!

@bluewalk
Copy link

Still no windows build?

@ljani
Copy link

ljani commented Jul 13, 2023

Hooks probably need a little work to support Windows as the default shell and its flags should be probably at least manually configurable via config, if not auto detected. That change should benefit other OS' as well.

@allenlook
Copy link

allenlook commented Oct 23, 2024

This would be outstanding.

Edit: Windows 11 is supposedly expanding the in-built support for compression algorithms in the latest builds if that is still a concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants