Mods / Linux 1-click install handler

Category: #Utility
Author: maximalmax90
Side: Client
Created: Sep 12th 2023 at 10:03 PM
Last modified: Sep 13th 2023 at 4:39 PM
Downloads: 461
Follow Unfollow 3

Latest version:
vs1clickmodinstaller-0.2.zip


vs1clickmodinstaller

It's simple python script for mods installation through 1-click link without starting client. Arch Linux users can install it from AUR

For other distrs

1) sudo cp vs1clickmodinstaller /usr/bin/

2) sudo chmod +x /usr/bin/vs1clickmodinstaller

3) sudo cp vs1clickmodinstaller.desktop /usr/share/applications/

*4) xdg-mime default vs1clickmodinstaller.desktop x-scheme-handler/vintagestorymodinstall

 

Script require some python modules: requests, tk (see instructions for your distr how to install it)

*Optional, often works without it

vintagestory binary must be in /usr/bin, but you can change path in vs1clickmodinstaller.desktop if you need

vs1clickmodinstaller-native

This version uses native implementation and starting client for mod installation. It was integrated by copygirl into VintageStory package in AUR.

For other distrs

You can install a vs1clickmodinstaller.desktop or make changes to an existing one.

If install file

1) sudo cp vs1clickmodinstaller.desktop /usr/share/applications/

*2) xdg-mime default vs1clickmodinstaller.desktop x-scheme-handler/vintagestorymodinstall

If make changes

In vintagestory.desktop:

1) replace Exec=/usr/bin/vintagestory to Exec=/usr/bin/vintagestory -i %u

2) add MimeType=x-scheme-handler/vintagestorymodinstall;

You can also copy desktop-file to ~/.local/share/applications/ and make changes there.

*3) xdg-mime default vintagestory.desktop x-scheme-handler/vintagestorymodinstall

*Optional, often works without it

vintagestory binary must be in /usr/bin, but you can change path in vs1clickmodinstaller.desktop if you need

Version For Game version Downloads Release date Changelog Download 1-click mod install*
v0.2
184 Sep 13th 2023 at 4:39 PM Show vs1clickmodinstaller-0.2.zip
v0.1
139 Sep 12th 2023 at 10:05 PM Show vs1clickmodinstaller-0.1.zip
v0.1-native
138 Sep 12th 2023 at 11:09 PM Show vs1clickmodinstaller-0.1-native.zip

7 Comments (oldest first | newest first)

💬 Aelius, Sep 2nd at 7:26 PM

kde-open vintagestorymodinstall://fsmlib@0.4.5

When you log sys.argv[1] it becomes vintagestorymodinstall://fsmlib@0.4.0.5

Really wierd.

💬 maximalmax90Author, Mar 14th at 11:57 AM

Hi effgee,

I need more details as I'm not reproducing the bug on my side.

Also, please use the bug tracker to discuss issues that arise. At the moment I sometimes have problems, but they are solely due to errors made by mod developers when describing modinfo.json.

💬 effgee, Mar 14th at 1:07 AM

Hi maximalmax90

This is somewhat broken, not sure why. 

Message window pops up, accept the query and then it silently fails.

I minimally modified the config location in ( vs1clickmodinstaller) due to using the AppImage distribution

Changed

_default_client_settings = f"{os.path.expanduser('~')}/.config/VintagestoryData/clientsettings.json"

to

# Added config location for flatpak version
_default_client_settings = f"{os.path.expanduser('~')}/.var/app/at.vintagestory.VintageStory/config/VintagestoryData/clientsettings.json"

and the handler is picking up the config properly.

 

Running in console, xdg-open vintagestorymodinstall://buzzybees@1.0.1 for example gives

Traceback (most recent call last):
File "/usr/bin/vs1clickmodinstaller", line 88, in <module>
if messagebox.askyesno(title=_title,message=f"Install version {_mod_ver} of {_mod_name} mod?"): install(_get_file, _get_url, _mod_name, _mod_ver)
^^^^^^^^^
NameError: name '_get_file' is not defined

Seems like perhaps the api format has changed a bit I haven't investigated more. At first glance the json parsing looks correct but I am not sure.

https://mods.vintagestory.at/api/mod/buzzybees

 

 

💬 maximalmax90Author, Sep 13th 2023 at 6:44 PM

Teslov

Ok, thx!

💬 Teslov, Sep 13th 2023 at 6:36 PM

maximalmax90

https://mods.vintagestory.at/show/mod/83

This one is missing modID in modinfo.json file. Having it installed threw error in line 64 when trying to install anything else.

💬 maximalmax90Author, Sep 13th 2023 at 4:14 PM

Teslov

Can you give an example of a mod with which a similar situation occurs? This is just for understanding) I have made changes, I will update the files soon.

💬 Teslov, Sep 13th 2023 at 3:51 PM

Heeeey, works perfectly but you might want to replace line 64 with `if _modinfo.get('modid') == _mod_id:` instead of `if _modinfo['modid'] == _mod_id:`.
get() returns None instead of erroring and some mods do not provide modid and having them installed breaks the installer.

(edit comment delete)