Compare commits

...

4 Commits

Author SHA1 Message Date
tyrrrz 1181a35f08 Variable names consistency 2026-03-21 20:27:05 +02:00
Copilot 4a62f9c34f Add DISCORDCHATEXPORTER_ALLOW_AUTO_UPDATE env var to suppress auto-update in GUI (#1514)
* Add DISCORDCHATEXPORTER_DISABLE_UPDATE env var to disable auto-update in GUI

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/158dba86-9958-4f57-ab22-174e0606b42f

* Rename IsAutoUpdateDisabled to IsAutoUpdateAllowed and env var to DISCORDCHATEXPORTER_ALLOW_AUTO_UPDATE

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/aa3944a4-e542-4770-8d17-2acb2c958ce9

* Refine IsAutoUpdateAllowed: group in (), invert, rename v to env, only accept false

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/1467eee2-3069-4f0b-abdf-b1dc65e00a9a

* Fix CSharpier formatting: move is { } env to indented new line

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/7933cfe4-ecad-4697-8b9c-ee3991aa147e

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
2026-03-21 20:25:53 +02:00
Oleksii Holub b6e1f92989 Add the GUI flavor of the AUR package to readme 2026-03-21 17:14:45 +02:00
Oleksii Holub 0d3d2ddcf0 Add more package manager install options
Added community-maintained package installation instructions for Scoop and WinGet, and clarified notes regarding MacOS and community-maintained packages.
2026-03-21 17:03:57 +02:00
5 changed files with 39 additions and 27 deletions
@@ -9,7 +9,8 @@ namespace DiscordChatExporter.Gui.Services;
public class UpdateService(SettingsService settingsService) : IDisposable public class UpdateService(SettingsService settingsService) : IDisposable
{ {
private readonly IUpdateManager? _updateManager = OperatingSystem.IsWindows() private readonly IUpdateManager? _updateManager =
OperatingSystem.IsWindows() && StartOptions.Current.IsAutoUpdateAllowed
? new UpdateManager( ? new UpdateManager(
new GithubPackageResolver( new GithubPackageResolver(
"Tyrrrz", "Tyrrrz",
@@ -25,8 +26,8 @@ public class UpdateService(SettingsService settingsService) : IDisposable
: null; : null;
private Version? _updateVersion; private Version? _updateVersion;
private bool _updatePrepared; private bool _isUpdatePrepared;
private bool _updaterLaunched; private bool _isUpdaterLaunched;
public async ValueTask<Version?> CheckForUpdatesAsync() public async ValueTask<Version?> CheckForUpdatesAsync()
{ {
@@ -51,7 +52,7 @@ public class UpdateService(SettingsService settingsService) : IDisposable
try try
{ {
await _updateManager.PrepareUpdateAsync(_updateVersion = version); await _updateManager.PrepareUpdateAsync(_updateVersion = version);
_updatePrepared = true; _isUpdatePrepared = true;
} }
catch (UpdaterAlreadyLaunchedException) catch (UpdaterAlreadyLaunchedException)
{ {
@@ -71,13 +72,13 @@ public class UpdateService(SettingsService settingsService) : IDisposable
if (!settingsService.IsAutoUpdateEnabled) if (!settingsService.IsAutoUpdateEnabled)
return; return;
if (_updateVersion is null || !_updatePrepared || _updaterLaunched) if (_updateVersion is null || !_isUpdatePrepared || _isUpdaterLaunched)
return; return;
try try
{ {
_updateManager.LaunchUpdater(_updateVersion, needRestart); _updateManager.LaunchUpdater(_updateVersion, needRestart);
_updaterLaunched = true; _isUpdaterLaunched = true;
} }
catch (UpdaterAlreadyLaunchedException) catch (UpdaterAlreadyLaunchedException)
{ {
+7
View File
@@ -6,6 +6,8 @@ namespace DiscordChatExporter.Gui;
public partial class StartOptions public partial class StartOptions
{ {
public required string SettingsPath { get; init; } public required string SettingsPath { get; init; }
public required bool IsAutoUpdateAllowed { get; init; }
} }
public partial class StartOptions public partial class StartOptions
@@ -20,5 +22,10 @@ public partial class StartOptions
? Path.Combine(path, "Settings.dat") ? Path.Combine(path, "Settings.dat")
: path : path
: Path.Combine(AppContext.BaseDirectory, "Settings.dat"), : Path.Combine(AppContext.BaseDirectory, "Settings.dat"),
IsAutoUpdateAllowed = !(
Environment.GetEnvironmentVariable("DISCORDCHATEXPORTER_ALLOW_AUTO_UPDATE")
is { } env
&& env.Equals("false", StringComparison.OrdinalIgnoreCase)
),
}; };
} }
@@ -46,6 +46,9 @@ public class SettingsViewModel : DialogViewModelBase
set => _settingsService.Language = value; set => _settingsService.Language = value;
} }
public bool IsAutoUpdateAvailable { get; } =
OperatingSystem.IsWindows() && StartOptions.Current.IsAutoUpdateAllowed;
public bool IsAutoUpdateEnabled public bool IsAutoUpdateEnabled
{ {
get => _settingsService.IsAutoUpdateEnabled; get => _settingsService.IsAutoUpdateEnabled;
@@ -50,8 +50,7 @@
<!-- Auto-updates --> <!-- Auto-updates -->
<DockPanel <DockPanel
Margin="16,8" Margin="16,8"
IsVisible="{OnPlatform False, IsVisible="{Binding IsAutoUpdateAvailable}"
Windows=True}"
LastChildFill="False" LastChildFill="False"
ToolTip.Tip="{Binding LocalizationManager.AutoUpdateTooltip}"> ToolTip.Tip="{Binding LocalizationManager.AutoUpdateTooltip}">
<TextBlock DockPanel.Dock="Left" Text="{Binding LocalizationManager.AutoUpdateLabel}" /> <TextBlock DockPanel.Dock="Left" Text="{Binding LocalizationManager.AutoUpdateLabel}" />
+8 -6
View File
@@ -43,23 +43,25 @@ To learn more about the war and how you can help, [click here](https://tyrrrz.me
- **Graphical user interface** (desktop app): - **Graphical user interface** (desktop app):
- 🟢 **[Stable release](https://github.com/Tyrrrz/DiscordChatExporter/releases/latest)**: look for `DiscordChatExporter.*.zip` - 🟢 **[Stable release](https://github.com/Tyrrrz/DiscordChatExporter/releases/latest)**: look for `DiscordChatExporter.*.zip`
- 🟠 [CI build](https://github.com/Tyrrrz/DiscordChatExporter/actions/workflows/main.yml): look for `DiscordChatExporter.*.zip` - 🟠 [CI build](https://github.com/Tyrrrz/DiscordChatExporter/actions/workflows/main.yml): look for `DiscordChatExporter.*.zip`
- 📦 [Scoop](https://scoop.sh/#/apps?q=DiscordChatExporter&p=1&id=c71b7367623c560a2dc746b9739b9568b79b59ae): `scoop install extras/discordchatexporter` (community-maintained)
- 📦 [WinGet](https://winget.run/pkg/Tyrrrz/DiscordChatExporter.GUI): `winget install Tyrrrz.DiscordChatExporter.GUI` (community-maintained)
- 📦 [AUR](https://aur.archlinux.org/packages/discord-chat-exporter-gui): `yay -S discord-chat-exporter-gui` (community-maintained)
- **Command-line interface** (terminal app): - **Command-line interface** (terminal app):
- 🟢 **[Stable release](https://github.com/Tyrrrz/DiscordChatExporter/releases/latest)**: look for `DiscordChatExporter.Cli.*.zip` - 🟢 **[Stable release](https://github.com/Tyrrrz/DiscordChatExporter/releases/latest)**: look for `DiscordChatExporter.Cli.*.zip`
- 🟠 [CI build](https://github.com/Tyrrrz/DiscordChatExporter/actions/workflows/main.yml): look for `DiscordChatExporter.Cli.*.zip` - 🟠 [CI build](https://github.com/Tyrrrz/DiscordChatExporter/actions/workflows/main.yml): look for `DiscordChatExporter.Cli.*.zip`
- 🐋 [Docker](https://hub.docker.com/r/tyrrrz/discordchatexporter): `docker pull tyrrrz/discordchatexporter` - 🐋 [Docker](https://hub.docker.com/r/tyrrrz/discordchatexporter): `docker pull tyrrrz/discordchatexporter`
- 📦 [AUR](https://aur.archlinux.org/packages/discord-chat-exporter-cli): `discord-chat-exporter-cli` - 📦 [AUR](https://aur.archlinux.org/packages/discord-chat-exporter-cli): `yay -S discord-chat-exporter-cli` (community-maintained)
- 📦 [Nix](https://search.nixos.org/packages?query=discordchatexporter-cli): `discordchatexporter-cli` - 📦 [Nix](https://search.nixos.org/packages?show=discordchatexporter-cli): `nix-shell -p discordchatexporter-cli` (community-maintained)
> [!IMPORTANT] > [!IMPORTANT]
> To launch the GUI version of the app on MacOS, you need to first remove the downloaded file from quarantine. > To launch the GUI version of the app on MacOS, you may need to first remove the downloaded file from quarantine.
> You can do that by running the following command in the terminal: `xattr -rd com.apple.quarantine DiscordChatExporter.app`. > You can do that by running the following command in the terminal: `xattr -rd com.apple.quarantine DiscordChatExporter.app`.
> [!NOTE] > [!NOTE]
> If you're unsure which build is right for your system, consult with [this page](https://useragent.cc) to determine your OS and CPU architecture. > Community-maintained packages are published independently from this repository and may not always be up to date with the latest release.
> [!NOTE] > [!NOTE]
> AUR and Nix packages linked above are maintained by the community. > If you're unsure which build is right for your system, consult with [this page](https://useragent.cc) to determine your OS and CPU architecture.
> If you have any issues with them, please contact the corresponding maintainers.
## Features ## Features