Skip to content

Commit

Permalink
Merge branch 'master' into release/opengl
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed Aug 1, 2020
2 parents 39b97f2 + 442138c commit 523cece
Show file tree
Hide file tree
Showing 25 changed files with 1,115 additions and 363 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: ^tests/(backup|root)
exclude: ^tests/
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.7
hooks:
Expand Down
60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
## v0.7.0 (2020-08-01)

**The backup structure has changed! Read below for more detail.**

* Added:
* Backup option to exclude save locations that are only confirmed for
another operating system.
* Backup option to exclude store screenshots.
* `--try-update` flag for backups via CLI.
* Fixed:
* When starting the GUI, if Ludusavi could not check for a manifest update
(e.g., because your Internet is down), then it would default to an empty
manifest even if you already had a local copy that was downloaded before.
Now, it will use the local copy even if it can't check for updates.
* Changed:
* Backup structure is now human-readable.
* App window now has a minimum size, 640x480.
(Note: For now, the crates.io release will not have a minimum size.)
* File size units are now adjusted based on the size, rather than always using MiB.
([contributed by wtjones](https://github.com/mtkennerly/ludusavi/pull/32))

### New backup structure
Previously, Ludusavi used Base64 to encode game names and original paths when
organizing backups. There were some technical advantages of that approach, but
it was not easy to understand, and there was a technical flaw because Base64
output can include `/`, which isn't safe for folder or file names.

Therefore, Ludusavi now organizes backups like this, in a way that is easier
to read and understand:

```
C:/somewhere/the-backup-folder/
Game 1 Name/
mapping.yaml
registry.yaml
drive-C/ # drive-0 on Linux and Mac
Users/
...
Program Files/
Steam/
...
```

The name of each game's folder is as close to the real title as possible,
except for replacing some special characters with `_`. Ultimately, Ludusavi
doesn't care much about the folder name and mainly looks for `mapping.yaml`,
which contains some metadata that Ludusavi needs. If a game has any Windows
registry data to back up, then there will also be a `registry.yaml` file.
Within each drive folder, everything is simply organized exactly like it
already is on your computer.

If you need to restore a previous backup, then please use Ludusavi v0.6.0
to do the restoration first, then migrate to Ludusavi v0.7.0 and create a
new backup.

You can [read more here](https://github.com/mtkennerly/ludusavi/issues/29)
about the background of this change. Be assured that this sort of disruptive
change is not taken lightly, but may happen in some cases until Ludusavi
reaches version 1.0.0.

## v0.6.0 (2020-07-29)

* Added:
Expand Down
44 changes: 25 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ludusavi"
version = "0.6.0"
version = "0.7.0"
authors = ["mtkennerly <[email protected]>"]
edition = "2018"
description = "Game save backup tool"
Expand All @@ -10,6 +10,7 @@ license = "MIT"

[dependencies]
base64 = "0.12.3"
byte-unit = "4.0.8"
copypasta = "0.7.0"
dialoguer = "0.6.2"
dirs = "3.0.0"
Expand Down
65 changes: 41 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ Ludusavi is a tool for backing up your PC video game save data,
written in [Rust](https://www.rust-lang.org).
It is cross-platform and supports multiple game stores.

This tool uses the [Ludusavi Manifest](https://github.com/mtkennerly/ludusavi-manifest)
for info on what to back up, and it will automatically download the latest version of
the primary manifest. To add or update game entries in the primary manifest, please refer
to that project. Data is ultimately sourced from [PCGamingWiki](https://www.pcgamingwiki.com/wiki/Home),
so you are encouraged to contribute any new or fixed data back to the wiki itself.

## Features
* Ability to back up data from more than 7,000 games plus your own custom entries.
* Backup and restore for Steam as well as other game libraries.
Expand All @@ -21,6 +15,14 @@ so you are encouraged to contribute any new or fixed data back to the wiki itsel
* Saves that are stored as files and in the Windows registry.
* Proton saves with Steam.
* Steam screenshots.
* Available as a [Playnite](https://playnite.link) extension:
https://github.com/mtkennerly/ludusavi-playnite

This tool uses the [Ludusavi Manifest](https://github.com/mtkennerly/ludusavi-manifest)
for info on what to back up, and it will automatically download the latest version of
the primary manifest. The data is ultimately sourced from [PCGamingWiki](https://www.pcgamingwiki.com/wiki/Home),
so please contribute any new or fixed data back to the wiki itself, and your
improvements will be incorporated into Ludusavi's data as well.

## Demo
### GUI
Expand Down Expand Up @@ -91,21 +93,20 @@ If you are on Mac:
* You can press `preview` to see what the backup will include,
without actually performing it.
* You can press `back up` to perform the backup for real.
* If the target folder already exists, it will be deleted first,
then recreated. However, if you've enabled the merge option,
then it will not be deleted first.
* Within the target folder, for every game with data to back up,
a subfolder will be created with the game's name encoded as
[Base64](https://en.wikipedia.org/wiki/Base64).
For example, files for `Celeste` would go into a folder named `Q2VsZXN0ZQ==`.
* Within each game's backup folder, any relevant files will be stored with
their name as the Base64 encoding of the full path to the original file.
For example, `D:/Steam/steamapps/common/Celeste/Saves/0.celeste` would be
backed up as `RDovU3RlYW0vc3RlYW1hcHBzL2NvbW1vbi9DZWxlc3RlL1NhdmVzLzAuY2VsZXN0ZQ==`.
* If the target folder already exists, it will be deleted first and
recreated, unless you've enabled the merge option.
* Within the target folder, for every game with data to back up, a subfolder
will be created based on the game's name, where some invalid characters are
replaced by `_`. In rare cases, if the whole name is invalid characters,
then it will be renamed to `ludusavi-renamed-<ENCODED_NAME>`.
* Within each game's subfolder, there will be a `mapping.yaml` file that
Ludusavi needs to identify the game. There will be some drive folders
(e.g., `drive-C` on Windows or `drive-0` on Linux and Mac) containing the
backup files, matching the normal file locations on your computer.
* If the game has save data in the registry and you are using Windows, then
the game's backup folder will also contain an `other/registry.yaml` file.
the game's subfolder will also contain a `registry.yaml` file.
If you are using Steam and Proton instead of Windows, then the Proton `*.reg`
files will be backed up like other game files.
files will be backed up along with the other game files instead.
* Roots are folders that Ludusavi can check for additional game data. When you
first run Ludusavi, it will try to find some common roots on your system, but
you may end up without any configured. You can click `add root` to configure
Expand All @@ -130,11 +131,16 @@ If you are on Mac:
* You can press `preview` to see what the restore will include,
without actually performing it.
* You can press `restore` to perform the restore for real.
* For all the files in the source directory, they will be decoded as Base64
to get the target path and then copied to that location. Any necessary
parent directories will be created as well before the copy, but if the
directories already exist, their current files will be left alone (other
than overwriting the ones that are being restored from the backup).
* For each subfolder in the source directory, Ludusavi looks for a `mapping.yaml`
file in order to identify each game. Subfolders without that file, or with an
invalid one, are ignored.
* All files from the drive folders are copied back to their original locations
on the respective drive. Any necessary parent directories will be created
as well before the copy, but if the directories already exist, then their
current files will be left alone (other than overwriting the ones that are
being restored from the backup).
* If the game subfolder includes a `registry.yaml` file, then the Windows
registry data will be restored as well.
* You can use redirects to restore to a different location than the original file.
Click `add redirect`, and then enter both the old and new location. For example,
if you backed up some saves from `C:/Games`, but then you moved it to `D:/Games`,
Expand Down Expand Up @@ -165,6 +171,10 @@ If you are on Mac:
If the game name matches one from Ludusavi's primary data set, then your
custom entry will override it.

#### Other settings
* Switch to this screen by clicking the `other` button.
* This screen contains some additional settings that are less commonly used.

### CLI
Run `ludusavi --help` for the full usage information.

Expand Down Expand Up @@ -267,6 +277,13 @@ Here are the available settings (all are required unless otherwise noted):
This can be overridden in the CLI by passing a list of games.
* `merge` (optional, boolean): Whether to merge save data into the target
directory rather than deleting the directory first. Default: false.
* `filter` (optional, map):
* `excludeOtherOsData` (optional, boolean): If true, then the backup should
exclude any files that have only been confirmed for a different operating
system than the one you're using. On Linux, Proton saves will still be
backed up regardless of this setting. Default: false.
* `excludeStoreScreenshots` (optional, boolean): If true, then the backup
should exclude screenshots from stores like Steam. Default: false.
* `restore` (map):
* `path` (string): Full path to a directory from which to restore data.
This can be overridden in the CLI with `--path`.
Expand Down
Binary file modified docs/demo-cli.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/demo-gui.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 523cece

Please sign in to comment.