mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-09-24 11:08:56 +02:00
Compare commits
4 Commits
9afecd47bd
...
2.47.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 1181a35f08 | |||
| 4a62f9c34f | |||
| b6e1f92989 | |||
| 0d3d2ddcf0 |
@@ -9,24 +9,25 @@ 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 =
|
||||||
? new UpdateManager(
|
OperatingSystem.IsWindows() && StartOptions.Current.IsAutoUpdateAllowed
|
||||||
new GithubPackageResolver(
|
? new UpdateManager(
|
||||||
"Tyrrrz",
|
new GithubPackageResolver(
|
||||||
"DiscordChatExporter",
|
"Tyrrrz",
|
||||||
// Examples:
|
"DiscordChatExporter",
|
||||||
// DiscordChatExporter.win-arm64.zip
|
// Examples:
|
||||||
// DiscordChatExporter.win-x64.zip
|
// DiscordChatExporter.win-arm64.zip
|
||||||
// DiscordChatExporter.linux-x64.zip
|
// DiscordChatExporter.win-x64.zip
|
||||||
$"DiscordChatExporter.{RuntimeInformation.RuntimeIdentifier}.zip"
|
// DiscordChatExporter.linux-x64.zip
|
||||||
),
|
$"DiscordChatExporter.{RuntimeInformation.RuntimeIdentifier}.zip"
|
||||||
new ZipPackageExtractor()
|
),
|
||||||
)
|
new ZipPackageExtractor()
|
||||||
: 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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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}" />
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user