Skip to content

Preserve wallpaper backups when restore fails - #55

Closed
rubenmarcus wants to merge 2 commits into
nunreasonable:mainfrom
rubenmarcus:fix/preserve-wallpaper-backup
Closed

rubenmarcus wants to merge 2 commits into
nunreasonable:mainfrom
rubenmarcus:fix/preserve-wallpaper-backup

Conversation

@rubenmarcus

@rubenmarcus rubenmarcus commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • stop the destructive uninstall cleanup when restoring the previous look fails
  • count an unavailable recorded monitor as an unrestored wallpaper instead of silently succeeding
  • preserve the last wallpaper backup so the user can retry recovery
  • add regressions for copy failure and disconnected-monitor recovery

Tests

  • cargo test --locked -p iiw-setup-core: 73 host tests passed
  • added two Windows-only regression tests; native Windows execution was unavailable locally and is required in CI
  • independent review checked the restore and cleanup paths

AI and files

  • Model: kimi-code/k3.1-pro
  • Files: installer/core/src/ops.rs, installer/core/src/win.rs, .github/workflows/build.yml
  • Follow-up: the setup-tests job now explicitly runs the new ops:: and win:: regressions.

Model: kimi-code/k3.1-pro\nFiles: installer/core/src/ops.rs, installer/core/src/win.rs\nAgent: omp
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
Model: kimi-code/k3.1-pro\nFiles: .github/workflows/build.yml\nAgent: omp
Signed-off-by: rubenmarcus <rubenmarcus.dev@gmail.com>
@rubenmarcus

Copy link
Copy Markdown
Contributor Author

Validation is complete: x64/ARM64 builds, setup tests and all Windows smoke jobs are green.
Both new uninstall regressions executed and passed on Windows, including copy-failure and disconnected-monitor backup preservation.
No review comments or remaining gate failures are pending.

@nunreasonable

Copy link
Copy Markdown
Owner

Thanks, worrying about the wallpaper backup makes sense since it lives inside the install folder. The catch is that any restore problem now stops the uninstall halfway: shortcuts, startup and the winget packages are already gone, but the files and the Installed apps entry stay, and the error doesn't tell anyone to untick "Restore how Windows looked" and try again. The likeliest trigger is a monitor recorded at install that isn't plugged in anymore (a laptop off its dock), and there the wallpaper is often the original file still on disk, so there's no backup to save at all.

Could it copy the backup folder somewhere safe instead (something like Pictures\ii-windows wallpaper), add a note saying where it went and finish the uninstall, with a missing monitor going back to a note? Also, #54 is going in first and touches the same build.yml filter and the end of ops.rs, so this one will need a rebase on main after that.

@nunreasonable

Copy link
Copy Markdown
Owner

One more thing while you're in there: the install folder, with the manifest inside it, gets deleted at the end even when a winget package or a PowerShell profile didn't come out, so nothing remembers what's left and a second uninstall can't retry it. So instead of stopping when the restore fails, it could finish the uninstall, copy the wallpaper backup folder somewhere safe first, and end with a short note listing what stayed behind: where the backup went, the package IDs winget couldn't remove and the profiles that still have the block, each with its path. The unplugged monitor case then just becomes one line in that list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants