Skip to content

Instantly share code, notes, and snippets.

@kazu0617
Last active September 5, 2025 03:52
Show Gist options
  • Select an option

  • Save kazu0617/05bffda45f8da9ea4ee6e7a90e703165 to your computer and use it in GitHub Desktop.

Select an option

Save kazu0617/05bffda45f8da9ea4ee6e7a90e703165 to your computer and use it in GitHub Desktop.
alcomでの自動更新を無効化するパッチ。AUR等パッケージマネージャーでビルドするなら、まあ必要かな…と。
diff --git a/vrc-get-gui/Tauri.toml b/vrc-get-gui/Tauri.toml
index cd180da8..4818a478 100644
--- a/vrc-get-gui/Tauri.toml
+++ b/vrc-get-gui/Tauri.toml
@@ -34,7 +34,6 @@ icon = [
resources = []
publisher = "anatawa12"
-createUpdaterArtifacts = "v1Compatible" # remove if ci # we do not generate updater artifacts in CI
[[bundle.fileAssociations]]
# note: for macOS we directory use info.plist for registering file association.
@@ -63,8 +62,5 @@ timestampUrl = "http://ts.ssl.com"
digestAlgorithm = "sha256"
tsp = true
-[plugins.updater]
-endpoints = []
-pubkey = "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDkyMjAzMkU2Q0ZGQjQ0MjYKUldRbVJQdlA1aklna2d2NnRoM3ZsT3lzWEQ3MC9zTGpaWVR4NGdQOXR0UGJaOHBlY2xCcFY5bHcK"
[app.security]
diff --git a/vrc-get-gui/src/commands.rs b/vrc-get-gui/src/commands.rs
index cf9f509a..be351014 100644
--- a/vrc-get-gui/src/commands.rs
+++ b/vrc-get-gui/src/commands.rs
@@ -369,12 +369,6 @@ impl_from_error!(
fs_extra::error::Error,
);
-impl From<tauri_plugin_updater::Error> for RustError {
- fn from(value: tauri_plugin_updater::Error) -> Self {
- log::error!(gui_toast = false; "failed to load latest release: {value}");
- Self::unrecoverable("failed to load the latest release")
- }
-}
impl From<MigrateVpmError> for RustError {
fn from(value: MigrateVpmError) -> Self {
diff --git a/vrc-get-gui/src/commands/util.rs b/vrc-get-gui/src/commands/util.rs
index 856bf009..3d0b003e 100644
--- a/vrc-get-gui/src/commands/util.rs
+++ b/vrc-get-gui/src/commands/util.rs
@@ -8,7 +8,6 @@ use crate::os::open_that;
use crate::utils::find_existing_parent_dir_or_home;
use tauri::{AppHandle, State, Window};
use tauri_plugin_dialog::DialogExt;
-use tauri_plugin_updater::{Update, UpdaterExt};
use url::Url;
#[derive(serde::Deserialize, specta::Type)]
@@ -61,22 +60,12 @@ pub fn util_get_version() -> String {
env!("CARGO_PKG_VERSION").to_string()
}
+// Disabled for AUR package - updates handled by package manager
pub async fn check_for_update(
- app_handle: AppHandle,
- stable: bool,
-) -> tauri_plugin_updater::Result<Option<Update>> {
- let endpoint = if stable {
- Url::parse("https://vrc-get.anatawa12.com/api/gui/tauri-updater.json").unwrap()
- } else {
- Url::parse("https://vrc-get.anatawa12.com/api/gui/tauri-updater-beta.json").unwrap()
- };
- app_handle
- .updater_builder()
- .endpoints(vec![endpoint])
- .unwrap()
- .build()?
- .check()
- .await
+ _app_handle: AppHandle,
+ _stable: bool,
+) -> Result<Option<()>, RustError> {
+ Ok(None)
}
#[derive(serde::Serialize, specta::Type)]
@@ -90,25 +79,12 @@ pub struct CheckForUpdateResponse {
#[tauri::command]
#[specta::specta]
pub async fn util_check_for_update(
- app_handle: AppHandle,
- updater_state: State<'_, UpdaterState>,
- config: State<'_, GuiConfigState>,
+ _app_handle: AppHandle,
+ _updater_state: State<'_, UpdaterState>,
+ _config: State<'_, GuiConfigState>,
) -> Result<Option<CheckForUpdateResponse>, RustError> {
- let stable = config.get().release_channel == "stable";
- let Some(response) = check_for_update(app_handle, stable).await? else {
- return Ok(None);
- };
- let current_version = response.current_version.clone();
- let latest_version = response.version.clone();
- let update_description = response.body.clone();
-
- let version = updater_state.set(response);
- Ok(Some(CheckForUpdateResponse {
- version,
- current_version,
- latest_version,
- update_description,
- }))
+ // Disabled for AUR package - updates handled by package manager
+ Ok(None)
}
#[derive(serde::Serialize, specta::Type, Clone)]
@@ -121,39 +97,14 @@ pub enum InstallUpgradeProgress {
#[tauri::command]
#[specta::specta]
pub async fn util_install_and_upgrade(
- updater_state: State<'_, UpdaterState>,
- app_handle: AppHandle,
- window: Window,
- channel: String,
- version: u32,
+ _updater_state: State<'_, UpdaterState>,
+ _app_handle: AppHandle,
+ _window: Window,
+ _channel: String,
+ _version: u32,
) -> Result<AsyncCallResult<InstallUpgradeProgress, ()>, RustError> {
- async_command(channel, window, async move {
- let Some(response) = updater_state.take() else {
- return Err(RustError::unrecoverable("No update response found"));
- };
-
- if response.version() != version {
- return Err(RustError::unrecoverable("Update data version mismatch"));
- }
-
- With::<InstallUpgradeProgress>::continue_async(move |ctx| async move {
- response
- .into_data()
- .download_and_install(
- |received, total| {
- ctx.emit(InstallUpgradeProgress::DownloadProgress { received, total })
- .ok();
- },
- || {
- ctx.emit(InstallUpgradeProgress::DownloadComplete).ok();
- },
- )
- .await?;
-
- app_handle.restart();
- })
- })
- .await
+ // Disabled for AUR package - updates handled by package manager
+ Err(RustError::unrecoverable("Updates are managed by the package manager"))
}
#[cfg(windows)]
diff --git a/vrc-get-gui/src/main.rs b/vrc-get-gui/src/main.rs
index 20c62afa..7c48ff75 100644
--- a/vrc-get-gui/src/main.rs
+++ b/vrc-get-gui/src/main.rs
@@ -49,7 +49,6 @@ fn main() {
}
process_args(app, &argv);
}))
- .plugin(tauri_plugin_updater::Builder::new().build())
.plugin(tauri_plugin_dialog::init())
.manage(io.clone())
.manage(state::new_http_client())
diff --git a/vrc-get-gui/src/state/updater.rs b/vrc-get-gui/src/state/updater.rs
index a668f21c..06c7eff2 100644
--- a/vrc-get-gui/src/state/updater.rs
+++ b/vrc-get-gui/src/state/updater.rs
@@ -1,8 +1,6 @@
use atomicbox::AtomicOptionBox;
use std::sync::atomic::{AtomicU32, Ordering};
-use tauri_plugin_updater::Update;
-
-type Data = Update;
+type Data = ();
struct UpdateResponseInfo {
pub version: u32,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment