[Solved] Vortex mod manager download handler not working

I tried installing the wine version of Vortex from here, and it works great with the exception of nxm download links (the “mod manager download” ones on Nexus Mods). To handle them, the install script creates a bash script in the prefix which generates a .desktop entry in ~/.local/share/applications/. The entry in question looks like this for me:

[Desktop Entry]
Categories=Game;Network;
Comment[en_US]=NXM Protocol Download Handler
Comment=NXM Protocol Download Handler
Exec=sh -c "CONFIGPATH=$(sqlite3 \\"/home/doggy/.local/share/lutris/pga.db\\" \\"select configpath from games where installer_slug = \\\\\\"vortex-mod-manager-wine\\\\\\" order by id asc limit 1;\\");sed -i \\"s/^  args:.*$/  args: -d $(printf \\"%%s\\\\\\\\n\\" \\"%u\\" | sed \\"s/^'//;s/'$//;s/\\//\\\\\\\\\\\\\\\\\\\\\\\\//g;s/\\\\\\\\&/\\\\\\\\\\&/g\\")/\\" \\"/home/doggy/.config/lutris/games/$CONFIGPATH.yml\\";env LUTRIS_SKIP_INIT=1 lutris lutris:rungameid/$(sqlite3 \\"/home/doggy/.local/share/lutris/pga.db\\" \\"select id from games where installer_slug = \\\\\\"vortex-mod-manager-wine\\\\\\" order by id asc limit 1;\\")"
GenericName[en_US]=Writes the provided nxm url as an argument to Vortex by editing the Lutris game config for Vortex twice before launching.
GenericName=Writes the provided nxm url as an argument to Vortex by editing the Lutris game config for Vortex twice before launching.
Icon=lutris_vortex-mod-manager
MimeType=x-scheme-handler/nxm-protocol;x-scheme-handler/nxm;
Name[en_US]=Vortex
Name=Vortex
NoDisplay=true
Path=/mnt/diskd/Games/vortex-mod-manager
StartupNotify=true
Terminal=false
Type=Application

Firefox output when clicking an nxm link (no changes in the lutris log):

Error: in prepare, no such column: vortex-mod-manager-wine
  lect configpath from games where installer_slug = "vortex-mod-manager-wine" or
                                      error here ---^
sed: can't read /home/doggy/.config/lutris/games/.yml: no such file or directory
Error: in prepare, no such column: vortex-mod-manager-wine
  select id from games where installer_slug = "vortex-mod-manager-wine" order by
                                error here ---^

What I know is that the Exec key in the desktop entry is not right, specifically I figured that double quotation marks quoting "vortex-mod-manager" should be replaced with single ones, also removing backslashes and adding a couple in front of the first $ (in accordance with the .desktop spec) so the Exec key looks like this:

Exec=sh -c "CONFIGPATH=\\$(sqlite3 \\"/home/doggy/.local/share/lutris/pga.db\\" \\"select configpath from games where installer_slug = 'vortex-mod-manager-wine' order by id asc limit 1;\\");sed -i \\"s/^  args:.*$/  args: -d $(printf \\"%%s\\\\\\\\n\\" \\"%u\\" | sed \\"s/^'//;s/'$//;s/\\//\\\\\\\\\\\\\\\\\\\\\\\\//g;s/\\\\\\\\&/\\\\\\\\\\&/g\\")/\\" \\"/home/doggy/.config/lutris/games/$CONFIGPATH.yml\\";env LUTRIS_SKIP_INIT=1 lutris lutris:rungameid/$(sqlite3 \\"/home/doggy/.local/share/lutris/pga.db\\" \\"select id from games where installer_slug = 'vortex-mod-manager-wine' order by id asc limit 1;\\")"

Firefox output when clicking a link with this key is empty, the lutris log:

lutris-wrapper: Vortex Mod Manager
Started initial process 129625 from sh -c "$WINE" "$1" $(CONFIGPATH=$(sqlite3 "/home/doggy/.local/share/lutris/pga.db" "select configpath from games where installer_slug = \"vortex-mod-manager-wine\" order by id asc limit 1;");sed -n "/args:.*$/s/^  args://;T;p;Q" "/home/doggy/.config/lutris/games/$CONFIGPATH.yml";NOYAML=" -d";sed -i "s/^  args:.*$/  args:$NOYAML/" "/home/doggy/.config/lutris/games/$CONFIGPATH.yml";) >/dev/null 2>&1; /home/doggy/.local/share/lutris/runners/wine/lutris-GE-Proton8-21-x86_64/bin/wine /mnt/diskd/Games/vortex-mod-manager/drive_c/Program Files/Black Tree Gaming Ltd/Vortex/Vortex.exe -d nxm://skyrimspecialedition/mods/30379/files/449463?key=ANbm7dX9zxwPlxVtuQ4gOQ&expires=1704562751&user_id=81948013
Start monitoring process.
Error: in prepare, no such column: vortex-mod-manager-wine
  lect configpath from games where installer_slug = "vortex-mod-manager-wine" or
                                      error here ---^
sed: can't read /home/doggy/.config/lutris/games/.yml: No such file or directory
sed: can't read /home/doggy/.config/lutris/games/.yml: No such file or directory
Monitored process exited.
Initial process has exited (return code: 0)
All processes have quit
Exit with return code 0

(/mnt/diskd/ is my hard drive’s mountpoint, on which Vortex is installed)
And at this point I’m confused and asking for your help. Here’s the Github issue where this installer was first proposed, and thanks in advance.

EDIT: Alright so I finally got it to work, the problem was with the lutris config for Vortex, specifically its prefix_command (which is the one executed on the second line of the lutris log attached). Apparently it had to be edited in the same manner as the desktop entry which means replacing double quotes with single ones.

I am also facing this kind of problem after find your guide my query is resolved.

And Lastly, if you want to download the latest version of the Vortex Mod Manager you can go with the link.