Skip to content

Maintain portable installation integrity and document exceptions - #5343

Open
Gabriel Dufresne (GabrielDuf) wants to merge 6 commits into
mainfrom
feat/5337-portable-zip-marker
Open

Maintain portable installation integrity and document exceptions#5343
Gabriel Dufresne (GabrielDuf) wants to merge 6 commits into
mainfrom
feat/5337-portable-zip-marker

Conversation

@GabrielDuf

Copy link
Copy Markdown
Contributor

This pull request significantly improves portable mode support in UniGetUI, especially for the Windows .zip release. It ensures portable mode is enabled by default for the .zip, relocates temporary and cache files to the portable directory, and introduces a user-friendly way to import settings from a previous installation. It also updates documentation to reflect these changes and upgrades the Pinget dependency.

Portable mode improvements:

  • The Windows .zip release now ships with the ForceUniGetUIPortable marker, making it portable out of the box. Documentation is updated to clarify that only the installer and non-Windows archives require manual activation of portable mode.
  • All temporary files, logs, and the WebView2 profile are now stored in the portable folder (AppPaths.ScratchDirectory) rather than system temp directories, ensuring no data is left behind on the host system.

Settings import feature:

  • On first run in portable mode, if previous settings are detected, a notification banner offers to import them. The user can import settings with a single click, and the UI provides feedback on success or failure.

Installer and update enhancements:

  • The auto-updater now uses a new helper (AutoUpdaterInstallerArguments) to ensure that updates to portable copies are performed in place and do not accidentally convert them to regular installs.

Third-party integration:

  • Pinget's data storage is redirected to the portable folder in portable mode, preventing it from writing to the user's profile.
    Dependency updates:

  • Upgrades Devolutions.Pinget.Cli.Rust to version 0.11.0.

These changes provide a more robust and privacy-conscious portable mode, improve the user experience for portable users, and ensure better consistency across platforms.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Root-path handling, failed-import retry behavior, missing translation keys, and incomplete temporary-file isolation remain unresolved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Improves portable-mode isolation, migration, updating, and documentation.

Changes:

  • Relocates application state and temporary artifacts into portable storage.
  • Adds settings import and portable-aware updates.
  • Ships Windows ZIPs as portable and upgrades Pinget to 0.11.0.
File summaries
File Description
src/UniGetUI.Tests/UniGetUI.Tests.csproj Includes updater argument helper in tests.
src/UniGetUI.Tests/AutoUpdaterTests.cs Tests portable installer arguments.
src/UniGetUI.PackageEngine.Operations/AbstractProcessOperation.cs Relocates elevated WinGet temporary data.
src/UniGetUI.PackageEngine.Managers.WinGet/WinGet.cs Uses the shared scratch directory.
src/UniGetUI.PackageEngine.Managers.WinGet/UniGetUI.PackageEngine.Managers.WinGet.csproj Upgrades Pinget Core.
src/UniGetUI.PackageEngine.Managers.WinGet/ClientHelpers/WinGetCliHelper.cs Relocates WinGet temporary data.
src/UniGetUI.PackageEngine.Managers.WinGet/ClientHelpers/PingetPackageDetailsProvider.cs Relocates Pinget temporary data.
src/UniGetUI.PackageEngine.Managers.WinGet/ClientHelpers/PingetCliHelper.cs Uses portable scratch storage.
src/UniGetUI.Interface.Telemetry/TelemetryHandler.cs Reports resolved portable mode.
src/UniGetUI.Interface.Telemetry.Tests/TelemetryHandlerTests.cs Updates portable telemetry tests.
src/UniGetUI.Core.Settings/SettingsEngine_Names.cs Adds the import-banner state setting.
src/UniGetUI.Core.Logging.Tests/LoggerTests.cs Isolates newly generated log entries.
src/UniGetUI.Core.Logging.Tests/AppPathsTests.cs Tests portable path resolution.
src/UniGetUI.Core.Logger/Logger.cs Moves session logs into scratch storage.
src/UniGetUI.Core.Logger/AppPaths.cs Centralizes portable and scratch paths.
src/UniGetUI.Core.Data/PortableDataImport.cs Implements selective settings import.
src/UniGetUI.Core.Data/CoreData.cs Integrates portable paths and backups.
src/UniGetUI.Core.Data.Tests/PortableDataImportTests.cs Tests import and backup behavior.
src/UniGetUI.Avalonia/ViewModels/MainWindowViewModel.cs Adds the settings-import banner.
src/UniGetUI.Avalonia/UniGetUI.Avalonia.csproj Upgrades Pinget CLI and links updater helper.
src/UniGetUI.Avalonia/Infrastructure/ProcessEnvironmentConfigurator.cs Redirects Pinget storage.
src/UniGetUI.Avalonia/Infrastructure/AvaloniaAutoUpdater.cs Preserves portable installs during updates.
src/UniGetUI.Avalonia/Infrastructure/AvaloniaAppHost.cs Configures Pinget during startup.
src/UniGetUI.Avalonia/CrashHandler.cs Relocates pending crash reports.
src/UniGetUI.Avalonia/App.axaml.cs Relocates the WebView profile.
src/Shared/AutoUpdater.InstallerArguments.cs Builds portable-aware installer arguments.
README.md Identifies Windows ZIPs as portable.
docs/PORTABLE.md Documents portable behavior and exceptions.
.github/workflows/build-release.yml Adds the portable marker to ZIP releases.
Review details

Suppressed comments (1)

src/UniGetUI.Avalonia/ViewModels/MainWindowViewModel.cs:579

  • The new success title and message keys are also missing from src/Languages/lang_en.json, so translation-source synchronization cannot export them for translators. Add both literals to the English translation source.
                PortableImportBanner.Title = CoreTools.Translate("Settings imported");
                PortableImportBanner.Message = CoreTools.Translate(
                    "{0} file(s) were copied. Restart UniGetUI to apply them.", copied);
  • Files reviewed: 29/29 changed files
  • Comments generated: 6
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/PORTABLE.md
The scratch directory holds files that are rebuilt on demand: the session log, the crash report
left behind for the next launch, the per-attempt auto-updater log, the WebView2 profile, and the
`%TEMP%` handed to package-manager subprocesses when UniGetUI runs elevated. Portable mode moves
it inside the portable folder, so a portable copy leaves nothing behind in the system temporary
return CommonWindowsArguments;
}

string directory = installationDirectory.TrimEnd('\\', '/');
Comment on lines +569 to +576
PortableImportBanner.ActionButtonCommand = new CommunityToolkit.Mvvm.Input.RelayCommand(() =>
{
Settings.Set(Settings.K.ShownPortableImportBanner, true);

try
{
int copied = PortableDataImport.Import(importableSource);
PortableImportBanner.Severity = InfoBarSeverity.Success;
Comment on lines +147 to +150
return Path.GetFullPath(path).TrimEnd(
Path.DirectorySeparatorChar,
Path.AltDirectorySeparatorChar
);
Comment on lines +562 to +565
PortableImportBanner.Title = CoreTools.Translate("Import your previous settings?");
PortableImportBanner.Message = CoreTools.Translate(
"UniGetUI is running in portable mode and started with empty settings. Settings from a previous installation were found at {0}.",
importableSource
Logger.Error("Could not import settings into the portable folder");
Logger.Error(ex);
PortableImportBanner.Severity = InfoBarSeverity.Error;
PortableImportBanner.Title = CoreTools.Translate("Could not import settings");

@randy-but-a-ro randy-but-a-ro Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This pull request will not be approved automatically: it modifies files listed in human-review-paths, so a human review is required.

  • .github/workflows/build-release.yml matches .github/
Integration Details
{
	"deliveryId": "4c2eb166-a642-11f1-9088-bee494c05993",
	"headSha": "84cd2a7a1533e6edf0c9500a3fe9ea5f0fc42a35"
}

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants