Fix dvm for latest discord update#10
Merged
Merged
Conversation
- 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>
There was a problem hiding this comment.
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 containingresources/app.asar. - Patch/copy the
.desktopfile to point to thedvmlauncher and update the launcher script to handle the new folder layout. - Make
removeresilient to missing install/desktop/icon files (ignoreNotFound).
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 on lines
+81
to
+84
| let parsed = version | ||
| .split('.') | ||
| .map(|part| part.parse::<u32>().unwrap_or(0)) | ||
| .collect::<Vec<_>>(); |
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 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
approved these changes
May 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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