Page 1 of 1

Mod (Auto) Installer

PostPosted: Fri Apr 15, 2016 15:02
by octacian
Installing mods can be annoying (for me anyway), especially when you have to add read and execute permissions to the folder, so I've created a relatively simple Bash script to install mods. This is meant for mod developers who would like some type of auto installer, not just to install a mod that you have downloaded. Currently, the script is not compatible with Mac OS X, but works with most Linux distributions. Recently, I updated the script so that it will detect and install to the new v0.4.13 mods directory too. My purpose of this, is to create something that mod creators are welcome to use to simplify the installation. Yes, I know it's already fairly simple, yet it might confuse some.

So if anyone is interested in including this in their mod, here are the instructions. Note: these instructions are for mod creators to set up the script, end user instructions are below.

It's fairly simple. Just download the script, open it with your favourite editor, and find line 20.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
# Name of mod to be installed
modname="modname"

Simply change the value of modname to the name of your mod. For example, I would change the value to genesis for my mod called genesis:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
# Name of mod to be installed
modname="genesis"


Please remember that the modname must be the final name of the folder which will be placed in the mods directory. The script will automatically deal with everything else. To insure that the script is ready to go, cd to the directory in which the script is stored, and run chmod:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
chmod +x install.sh


USE
Users can now open the mod directory in the terminal, and type ./install.sh, then follow the simple prompts to complete the installation. When you run the script, you are at one point prompted to choose which subgame you would like to install the mod to, so I have added a shortcut that skips this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
./install.sh minetest_game

Replacing minetest_game with the name of the subgame.

And for those who have a portable Minetest installation, or do not have the Minetest root folder in the expected places, the script will show an error allowing you to exit or enter a custom path.

Downloads:
Release v1.0 (stable)
Unstable (most recent)
or Browse the Code on Git

Lincense
MIT License

It would be great to see some people using this with their mods. I think it will help those people who are new to Minetest yet have even the most basic understanding of the terminal. If anybody has any suggestions or problems, let me know or open an Issue here.

Known Problems:
When subgame is specified through ./install.sh minetest_game, the script loops back to midCheck once after installation. I am working to figure this out, but any help would be really appreciated. This happened once before, and I believe I know what the problem is, but I am not sure how to efficiently fix it yet. However, I don't think this is a big problem, as it does not affect the functionality of the script - the rest still runs fine.

Re: Mod (Auto) Installer

PostPosted: Sat Jul 30, 2016 00:06
by lisacvuk
Would it be too big of an issue to push it to github? Thanks :P

Re: Mod (Auto) Installer

PostPosted: Sun Jul 31, 2016 17:43
by LNJ
I normally install my mods so:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
$ cd .minetest/mods
$ git clone <git repo>
...


OR, if I want to install them globally:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
$ cd /usr/share/games/minetest/mods
$ sudo git clone <git repo>
...


With this script I have to do this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
$ git clone <git repo>
...
$ cd <mod name>
$ ./install
$ cd ..
$ rm -rf <mod name>


Or did I misunderstood something here?

Re: Mod (Auto) Installer

PostPosted: Sun Jul 31, 2016 22:52
by octacian
lisacvuk wrote:Would it be too big of an issue to push it to github? Thanks :P


Sorry, forgot the links were broken. Fixed now :) Git

BTW, I'm not using GitHub but a self hosted alternative known as Gogs. Hopefully that's OK though, as you can still create an account there and such in case you want to fork the installer, or anything like that.

Re: Mod (Auto) Installer

PostPosted: Tue Aug 02, 2016 15:39
by lisacvuk
Okay :D Thanks.

Re: Mod (Auto) Installer

PostPosted: Tue Aug 02, 2016 20:46
by kaeza
I don't understand why you need to "add read and execute permissions to the folder". Are you installing mods into `/usr[/local]`? You should be using `~/.minetest` unless you have a really weird setup.

Re: Mod (Auto) Installer

PostPosted: Tue Aug 02, 2016 21:59
by octacian
kaeza wrote:I don't understand why you need to "add read and execute permissions to the folder". Are you installing mods into `/usr[/local]`? You should be using `~/.minetest` unless you have a really weird setup.


I'll look it over. Can probably refine some stuff considering the fact that I did this last year :P