Skip to content

Commit 4bbcec4

Browse files
committed
Add reset scripts and setup docs
1 parent 6989bdb commit 4bbcec4

12 files changed

Lines changed: 264 additions & 31 deletions

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ USB Mirror Sync is a cross-platform tray app for keeping selected folders from a
1717
- GitHub Pages docs: `https://radnotred.github.io/USBFileSync/`
1818
- Local docs source: [`docs/`](docs/)
1919
- Example config: [`config.example.json`](config.example.json)
20+
- Reset and cleanup tools: [`tools/reset/`](tools/reset/)
2021
- Contribution guide: [`CONTRIBUTING.md`](CONTRIBUTING.md)
2122

2223
## Install
@@ -36,19 +37,27 @@ Release artifacts are produced automatically from the version in `Cargo.toml` fo
3637

3738
Windows keeps the installer with optional desktop shortcut creation and optional run-at-startup registration. Startup is off by default. macOS now ships a drag-to-Applications `.dmg` plus a raw archive fallback. Linux ships per-architecture archives.
3839

39-
## Runtime Files
40+
## First Launch
4041

41-
On first launch the app creates:
42+
Use the native `Setup Wizard` from the tray menu for guided setup, or edit `config.json` directly.
4243

43-
- `%LOCALAPPDATA%\UsbMirrorSync\config.json`
44-
- `%LOCALAPPDATA%\UsbMirrorSync\manifest.json`
45-
- `%LOCALAPPDATA%\UsbMirrorSync\shadow\`
46-
- `%LOCALAPPDATA%\UsbMirrorSync\sync.log`
44+
Basic setup:
4745

48-
Use the tray menu `Setup Wizard` action for guided configuration, or edit `config.json` directly.
46+
- Windows: install or unzip the release, launch the app, then set `drive.letter`
47+
- macOS: open the `.dmg`, drag the app to `Applications`, launch it, then set `drive.path`
48+
- Linux: extract the archive, launch the binary, then set `drive.path`
4949

5050
On Windows, set `drive.letter`. On macOS and Linux, set `drive.path` to the mounted USB root.
5151

52+
The app creates a per-user data directory containing:
53+
54+
- `config.json`
55+
- `manifest.json`
56+
- `shadow/`
57+
- `sync.log`
58+
59+
Use the tray actions to open the config, log, app-data folder, mounted drive, or shadow cache.
60+
5261
## Development
5362

5463
```powershell

docs/contributing.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Contributing
22

3-
USB Mirror Sync is a Windows-first utility with file movement, caching, packaging, and tray UX all tied together. Keep changes scoped and document behavior changes in the same patch.
3+
USB Mirror Sync is a cross-platform utility with file movement, caching, packaging, and tray UX all tied together. Keep changes scoped and document behavior changes in the same patch.
44

55
## Quick Checklist
66

7-
- Keep Windows behavior explicit
7+
- Keep platform-specific behavior explicit
88
- Preserve the documented sync model unless you are intentionally changing it
99
- Add or update tests when sync logic changes
1010
- Update the docs when config fields, workflows, packaging, or tray behavior change
@@ -22,5 +22,6 @@ python -m mkdocs build --strict
2222

2323
- `src/sync_engine.rs`: sync direction, delete semantics, manifest handling
2424
- `src/app.rs`: tray behavior, status, startup flow, config recovery
25-
- `assets/setup_wizard.ps1`: user-facing setup experience
25+
- `src/wizard.rs`: cross-platform setup experience
2626
- `.github/workflows/`: release and documentation automation
27+
- `tools/reset/`: local cleanup and reset behavior

docs/getting-started.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,30 @@
22

33
## Choose a Release
44

5-
USB Mirror Sync ships in two Windows-friendly forms:
5+
USB Mirror Sync ships in platform-specific forms:
66

7-
- Portable zip: unzip and run `usb_mirror_sync.exe`
8-
- Installer: installs the app, Start Menu entry, optional desktop shortcut, and optional startup registration
7+
- Windows: portable zip or installer
8+
- macOS: `.dmg` plus a `.tar.gz` fallback
9+
- Linux: per-architecture `.tar.gz`
910

10-
Startup is disabled by default in the installer.
11+
Startup is disabled by default in the Windows installer.
1112

1213
## First Launch
1314

14-
On first launch the app creates:
15+
1. Launch the app.
16+
2. Open `Setup Wizard` from the tray/menu bar icon.
17+
3. Point the app at the USB source:
18+
- Windows: set `drive.letter`
19+
- macOS/Linux: set `drive.path`
20+
4. Add at least one job mapping a USB-relative `source` to an absolute local `target`.
21+
5. Save the config and leave the app running in the tray.
1522

16-
- `%LOCALAPPDATA%\UsbMirrorSync\config.json`
17-
- `%LOCALAPPDATA%\UsbMirrorSync\manifest.json`
18-
- `%LOCALAPPDATA%\UsbMirrorSync\shadow\`
19-
- `%LOCALAPPDATA%\UsbMirrorSync\sync.log`
23+
On first launch the app creates a per-user data directory with:
24+
25+
- `config.json`
26+
- `manifest.json`
27+
- `shadow/`
28+
- `sync.log`
2029

2130
If the config is missing or invalid, the app can open the Setup Wizard automatically and recover to a safe default config.
2231

@@ -69,8 +78,20 @@ Tray actions include:
6978
- `Sync to USB now`
7079
- `Eject drive`
7180
- `Setup Wizard`
81+
- `Open mounted drive`
82+
- `Open shadow cache`
7283
- `Open raw config`
7384
- `Open log`
7485
- `Open app folder`
7586

7687
If a second copy of the app is launched, the single-instance guard shows a warning and lets you cancel or retry startup.
88+
89+
## Clean Reset
90+
91+
If you want to wipe local app state and start fresh, use the scripts in `tools/reset/`:
92+
93+
- `tools/reset/reset-windows.bat`
94+
- `tools/reset/reset-macos.sh`
95+
- `tools/reset/reset-linux.sh`
96+
97+
These are intended to remove the app's per-user config, manifest, logs, and shadow cache. They are for local state cleanup, not for uninstalling release artifacts.

docs/index.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# USB Mirror Sync
22

3-
USB Mirror Sync is a Windows tray app built for one job: keep selected folders from a removable USB drive mirrored onto a PC without forcing a full copy every time the drive is plugged in.
3+
USB Mirror Sync is a cross-platform tray app built for one job: keep selected folders from a removable USB drive mirrored onto a PC without forcing a full copy every time the drive is plugged in.
44

55
<div class="grid cards" markdown>
66

@@ -20,12 +20,15 @@ USB Mirror Sync is a Windows tray app built for one job: keep selected folders f
2020

2121
Sync, open logs, edit config, launch the setup wizard, and eject the drive directly from the taskbar icon.
2222

23+
- ### Reset When Needed
24+
25+
Platform-specific cleanup scripts in `tools/reset/` can wipe app data and cached state when you need a clean start.
26+
2327
</div>
2428

2529
## Core Ideas
2630

27-
- The app is Windows-only.
28-
- Jobs are tied to a configured USB drive letter.
31+
- Windows can use a USB drive letter; macOS and Linux use a mounted drive path.
2932
- `source` paths are relative to the USB root.
3033
- `target` paths are absolute folders on the PC.
3134
- `shadow` is a staging cache, not the live destination folder.
@@ -35,4 +38,5 @@ USB Mirror Sync is a Windows tray app built for one job: keep selected folders f
3538
- New user: [Getting Started](getting-started.md)
3639
- Need to hand-edit JSON: [Configuration](configuration.md)
3740
- Want to understand cache behavior and delete rules: [How Sync Works](sync-model.md)
41+
- Need to wipe config/cache state: [Reset and Cleanup](reset-and-cleanup.md)
3842
- Working on the repo: [Contributing](contributing.md)

docs/reset-and-cleanup.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Reset and Cleanup
2+
3+
USB Mirror Sync stores local state so it can stay incremental between runs. Sometimes that is exactly what you want to remove: a broken config, stale manifest, or shadow cache you no longer trust.
4+
5+
## Reset Scripts
6+
7+
The repo provides platform-specific cleanup scripts under `tools/reset/`:
8+
9+
- `tools/reset/reset-windows.bat`
10+
- `tools/reset/reset-macos.sh`
11+
- `tools/reset/reset-linux.sh`
12+
13+
These scripts are intended to remove the app's per-user state, including:
14+
15+
- `config.json`
16+
- `manifest.json`
17+
- `sync.log`
18+
- `shadow/`
19+
20+
They are for local cleanup. They are not meant to uninstall packaged binaries or remove release artifacts from system install locations.
21+
22+
## When to Use Them
23+
24+
Use a reset script when:
25+
26+
- the config was badly broken and you want to start fresh
27+
- you want to discard the cached manifest and shadow copy
28+
- you are testing a first-run experience
29+
- you want to verify behavior without any retained local state
30+
31+
## Safer First Steps
32+
33+
Before wiping everything:
34+
35+
- use the tray action `Open raw config`
36+
- use the tray action `Open log`
37+
- use the tray action `Open app folder`
38+
- back up `config.json` if you care about your current job setup
39+
40+
## After a Reset
41+
42+
After local state is removed:
43+
44+
1. Launch the app again.
45+
2. Open `Setup Wizard`.
46+
3. Recreate the drive setting:
47+
- Windows: `drive.letter`
48+
- macOS/Linux: `drive.path`
49+
4. Recreate your jobs and save.
50+
51+
The app will then build fresh local state on the next sync.

docs/tray-app.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
## Tray Menu
44

5-
The app lives in the Windows notification area and exposes the main workflow through the tray menu.
5+
The app lives in the system tray or menu bar area and exposes the main workflow through the tray menu.
66

77
Typical actions:
88

99
- `Sync from USB now`
1010
- `Sync to USB now`
1111
- `Eject drive`
1212
- `Setup Wizard`
13+
- `Open mounted drive`
14+
- `Open shadow cache`
1315
- `Open raw config`
1416
- `Open log`
1517
- `Open app folder`
@@ -30,16 +32,15 @@ This keeps the tray UI compact without losing visibility into what is happening.
3032

3133
## Setup Wizard
3234

33-
The setup wizard is a Windows PowerShell + WinForms UI that helps edit `config.json` without hand-editing JSON.
35+
The setup wizard is a Rust desktop UI that helps edit `config.json` without hand-editing JSON.
3436

3537
It includes:
3638

37-
- Overview, Jobs, and Advanced tabs
38-
- job grid editing
39+
- cross-platform drive and mount-path setup
40+
- job list editing
3941
- path browse actions
40-
- workflow explanations
41-
- hover tooltips
4242
- config recovery context when a broken config is repaired
43+
- save and save-and-close flows
4344

4445
## Single-Instance Protection
4546

docs/troubleshooting.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ Only one instance is allowed. Starting a second copy shows an `Already running`
2727

2828
## Where to Look for Logs
2929

30-
Use the tray action `Open log`, or inspect:
30+
Use the tray action `Open log` or `Open app folder` first. If you want a full clean slate, use the reset scripts in `tools/reset/`.
3131

32-
`%LOCALAPPDATA%\UsbMirrorSync\sync.log`
32+
The reset tools are:
33+
34+
- `tools/reset/reset-windows.bat`
35+
- `tools/reset/reset-macos.sh`
36+
- `tools/reset/reset-linux.sh`

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
site_name: USB Mirror Sync
2-
site_description: Windows tray app for mirroring USB folders onto a PC with a shadow cache, tray controls, and installer or portable releases.
2+
site_description: Cross-platform tray app for mirroring USB folders onto a PC with a shadow cache, tray controls, reset tools, and packaged releases.
33
site_url: https://radnotred.github.io/USBFileSync/
44
repo_url: https://github.com/RadNotRed/USBFileSync
55
repo_name: RadNotRed/USBFileSync
@@ -41,6 +41,7 @@ nav:
4141
- Configuration: configuration.md
4242
- How Sync Works: sync-model.md
4343
- Tray App: tray-app.md
44+
- Reset and Cleanup: reset-and-cleanup.md
4445
- Installer and Releases: installer-and-releases.md
4546
- Release Artifacts: releases.md
4647
- Troubleshooting: troubleshooting.md

tools/reset/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Reset Tools
2+
3+
These scripts remove USB Mirror Sync's local app state from the current user account.
4+
5+
They are intended for:
6+
7+
- clearing broken config or cache state
8+
- removing tray auto-start shortcuts
9+
- resetting the app to a first-run state
10+
11+
They do not remove:
12+
13+
- your synced target folders
14+
- files on the USB drive
15+
- the installed application binaries themselves
16+
17+
Scripts:
18+
19+
- `reset-windows.bat`
20+
- `reset-macos.sh`
21+
- `reset-linux.sh`
22+
23+
Each script removes local app data such as:
24+
25+
- `config.json`
26+
- `manifest.json`
27+
- `sync.log`
28+
- `shadow/`
29+
- single-instance lock files
30+
- startup shortcuts or launch entries created for the current user
31+
32+
Run them only when USB Mirror Sync is closed.

tools/reset/reset-linux.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
echo "USB Mirror Sync reset for Linux"
5+
echo
6+
echo "This removes local app state for the current user:"
7+
echo " - config, manifest, log, shadow cache"
8+
echo " - autostart desktop entries if present"
9+
echo "It does NOT remove synced folders or files on your USB drive."
10+
echo
11+
printf "Type RESET to continue: "
12+
read -r confirm
13+
if [ "$confirm" != "RESET" ]; then
14+
echo "Cancelled."
15+
exit 0
16+
fi
17+
18+
remove_path() {
19+
if [ -e "$1" ]; then
20+
echo "Removing $1"
21+
rm -rf "$1"
22+
fi
23+
}
24+
25+
data_home="${XDG_DATA_HOME:-$HOME/.local/share}"
26+
config_home="${XDG_CONFIG_HOME:-$HOME/.config}"
27+
28+
remove_path "$data_home/rad/UsbMirrorSync"
29+
remove_path "$config_home/UsbMirrorSync"
30+
remove_path "$HOME/.config/autostart/usb-mirror-sync.desktop"
31+
remove_path "$HOME/.config/autostart/USB Mirror Sync.desktop"
32+
33+
echo
34+
echo "Reset complete."

0 commit comments

Comments
 (0)