Skip to content

Fix dvm for latest discord update#10

Merged
diced merged 1 commit into
diced:trunkfrom
Kaydax:fix-new-discord
May 10, 2026
Merged

Fix dvm for latest discord update#10
diced merged 1 commit into
diced:trunkfrom
Kaydax:fix-new-discord

Conversation

@Kaydax
Copy link
Copy Markdown
Contributor

@Kaydax Kaydax commented May 5, 2026

The latest discord update added auto-updating while also changing the entire folder structure in the process.

This PR fixes dvm for the latest update, as well as making the .desktop file for discord use the dvm binary instead of discord's own auto update binary (This is to avoid issues with it replacing client mods on launch)

I also fixed the remove command throwing an error when the .desktop and icon files are missing

- Fix script to launch the discord binary directly. The latest update moved it
- Fix the remove script panicing when there is no .desktop or icon files
- Properly patch the .desktop file to use the dvm binary instead of the discord binary

Signed-off-by: Kaydax <kaydax@kaydax.xyz>
Copilot AI review requested due to automatic review settings May 5, 2026 20:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates dvm to work with Discord’s new auto-updating Linux folder layout by locating the active app-* directory, ensuring desktop launchers invoke the dvm wrapper (instead of Discord’s updater binary), and making uninstall more tolerant of missing files.

Changes:

  • Update app directory resolution to select the newest app-* directory containing resources/app.asar.
  • Patch/copy the .desktop file to point to the dvm launcher and update the launcher script to handle the new folder layout.
  • Make remove resilient to missing install/desktop/icon files (ignore NotFound).

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/util.rs Patches desktop entry to use dvm launcher, updates launcher script for app-* layout, and switches desktop/icon installation to fs operations.
src/path.rs Enhances app_dir() to choose the best (newest) app-* directory that contains resources/app.asar.
src/cli/remove.rs Improves uninstall robustness by treating missing files/dirs as non-fatal.
Cargo.lock Bumps lockfile format and reflects crate version update.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/path.rs
Comment on lines +81 to +84
let parsed = version
.split('.')
.map(|part| part.parse::<u32>().unwrap_or(0))
.collect::<Vec<_>>();
Comment thread src/util.rs
Comment on lines +130 to 142
if desktop_source.exists() {
Command::new("sed")
.arg("-i")
.arg(format!(
"s#/usr/share/{}/{}#{}/{}#",
"s#/usr/bin/{}#{}/{}#",
pkg_name,
pascal_pkg,
dvm_path::dvm_bin_dir()?.display(),
pkg_name
))
.arg(&desktop_file)
.arg(&desktop_source)
.spawn()?
.wait()
.await?;
Comment thread src/util.rs
Comment on lines +160 to +166
INSTALL_DIR="{}"
BIN_NAME="{}"
APP_DIR="$(find "$INSTALL_DIR" -maxdepth 1 -type d -name 'app-*' 2>/dev/null | sort -V | tail -n 1)"

if [[ -n "$APP_DIR" && -x "$APP_DIR/$BIN_NAME" ]]; then
exec "$APP_DIR/$BIN_NAME" "$@" $USER_FLAGS
fi
@diced diced merged commit 222c8df into diced:trunk May 10, 2026
5 of 6 checks passed
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.

3 participants