Tutorial for MOD installer

By the way if anyone is curious on how the mod installer will work here is how.
So there will be a window that asks you various questions, like what size should the installer for your mod be, name of the mod, icon, modules, etc....
Then it will get all those things you entered and create a new installer.py which will have everything according to what you want.
This part will be more complicated, you will have to manually turn it into an EXE by installing PyInstaller. You can install PyInstaller by when you install Python also check the box that says pip, then in the CMD type pip install pyinstaller.
After that you will have to create the exe by typing:
cd path/to/the/installer/python/file
then
pyinstaller -F installer.py --icon=icon.ico
only do the icon part if you want to have an icon.
I think I'll have this finished pretty soon, just have to work a lot on the GUI (graphical user interface) of the app and of the users custom installer.
 
Honestly that sounds confusing to me. If it were me I'd just make the exe to begin with and have it read stuff like the mode name from the folder name and mod.ini
 
After that you will have to create the exe by typing:
cd path/to/the/installer/python/file
then
pyinstaller -F installer.py --icon=icon.ico
only do the icon part if you want to have an icon.
Sounds like a fail to me. If people need/want an installer, it's because they do NOT want to type anything. Your target audience is the kind who wants to double click a file, click ok and done. You need to automate steps like this.
 
Sounds like a fail to me. If people need/want an installer, it's because they do NOT want to type anything. Your target audience is the kind who wants to double click a file, click ok and done. You need to automate steps like this.
Well, till now the only way to make an installer is far more complicated then what I said.
And what I said is actually not even that complicated, you only have to type 1 line in the CMD to generate the exe and another line to install the module required to create exe's.
Basically what I'm trying to create is an app that has a screen with a bunch of options you can put in, modules, messages, desktop shortcuts, etc... and then a Python file will be generated which meets the requirements you gave it. So you can just run the Python file or you could make it into an exe, your choice.
 
In Python it is impossible to automatically generate an exe. You have to type the line that will generate it in the Cmd.
You don't get what I am saying. I am saying that you should be the one to make the exe for people. And that any customization should be done by that exe reading ini files as opposed to manual input from the end user.

I can whip you up a dirty C# prototype of the interface (no functionality, just interface) to show you what I mean if you like.

Edit: Here is what I was talking about. Whipped this exe up in about 15 minutes for you. Launch it and you'll see a bunch of generic text. Put it in any mod folder of your choice and it will automatically read from the ini file and configure it self. The play button also works. And if there is a file called Background.png in the same folder as the exe and ini file (top folder of any mod you like) it will automatically load the file and put it up as a background for the form.

Applied to an installer you could do the same thing. Just make an exe that reads the mod name from the ini and copies the whole folder to the beyond the sword mods directory. The entire process for the potential mod user would than be:
1. Download zip
2. Unzip anywhere
3. Run setup.exe
4. Play


PS. I am not trying to show you off here and make my self look superior or anything. Sorry if that's how this comes off. Rather my goal is to use my experience and knowledge to guide and inspire you in the proper direction for how these things are done so that you can do them your self, learn and grow from doing so. This is a great project for you to do so on because it really isn't that difficult and has lots of room for fun playing around with features.
 

Attachments

  • Example.zip
    11.2 KB · Views: 36
Last edited:
I'll try to make it aut
You don't get what I am saying. I am saying that you should be the one to make the exe for people. And that any customization should be done by that exe reading ini files as opposed to manual input from the end user.

I can whip you up a dirty C# prototype of the interface (no functionality, just interface) to show you what I mean if you like.

Edit: Here is what I was talking about. Whipped this exe up in about 15 minutes for you. Launch it and you'll see a bunch of generic text. Put it in any mod folder of your choice and it will automatically read from the ini file and configure it self. The play button also works. And if there is a file called Background.png in the same folder as the exe and ini file (top folder of any mod you like) it will automatically load the file and put it up as a background for the form.

Applied to an installer you could do the same thing. Just make an exe that reads the mod name from the ini and copies the whole folder to the beyond the sword mods directory. The entire process for the potential mod user would than be:
1. Download zip
2. Unzip anywhere
3. Run setup.exe
4. Play


PS. I am not trying to show you off here and make my self look superior or anything. Sorry if that's how this comes off. Rather my goal is to use my experience and knowledge to guide and inspire you in the proper direction for how these things are done so that you can do them your self, learn and grow from doing so. This is a great project for you to do so on because it really isn't that difficult and has lots of room for fun playing around with features.
I thought about it more and I realized that the idea you had with the mod.ini is a good option. So yeah, the exe will already be there and it will be renamed to your mod name, then the.ini will be filled out automatically according to what options you said.
 
No need to rename the exe. Remember, with a thing like this ideally you want something that can be dropped into any mod with zero modifications or preparation to the end user.
 
No need to rename the exe. Remember, with a thing like this ideally you want something that can be dropped into any mod with zero modifications or preparation to the end user.
No, the exe should be renamed to the mod installer! So that when someone downloads the mod they can see the name of it.
Anyway there will be 2 exe's. One will be the application with which you create modules, messages, etc... and the other exe will be the mod installer which will read stuff from the ini which will be modified according to what options the user puts in the app.
So this will make it easier for people to distribute their mods and create installers for them.
 
Just remember that the goal is to ensure both the mod creator and the player must be able to do it whilst being completely computer illiterate. That's a universal rule with almost all programs. So any customization you ask of them needs to be something that can either be done very easily like editing a text file or be done through a wizard. Otherwise people will become frustrated and fail.
 
Just remember that the goal is to ensure both the mod creator and the player must be able to do it whilst being completely computer illiterate. That's a universal rule with almost all programs. So any customization you ask of them needs to be something that can either be done very easily like editing a text file or be done through a wizard. Otherwise people will become frustrated and fail.
The mod creator will simply have to fill out a form with options, if the option is required I will put a * next to it.
Then an ini file will be created automatically which will fill out all the arguments given by the mod creator. The mod creator will have to create a folder in which there is his mod (the folder, not zipped), the exe which when opened will basically be the mod installer, so it will ask you if you want a desktop shortcut, what modules you want etc...
and the ini file with which without the mod installer exe will be nothing.
Also in the mod installer it will ask you to put a path to where you want the mod to be installed, you can choose a custom path or use the one given which is the Steam path.
 
That sounds about right. Speaking of which, if you get the time and think you are up to the challenge there is a way to get the path to any application directly from windows by having your program dig through the registry. And there is, presumably, a linux equivalent you can do. That would cover non standard paths automatically as well as those of us fossils that still actually use their CD copies. And yes, I do in fact still have my precious BTS cd. :)
 
That sounds about right. Speaking of which, if you get the time and think you are up to the challenge there is a way to get the path to any application directly from windows by having your program dig through the registry. And there is, presumably, a linux equivalent you can do. That would cover non standard paths automatically as well as those of us fossils that still actually use their CD copies. And yes, I do in fact still have my precious BTS cd. :)
Yeah, I also have a BTS cd, I used to play on the cd version long ago.
But I don't know how to make it get the automatic path, my idea was to make a screen similar to this:
upload_2020-12-24_16-13-1.png

so the user could just copy the path and paste it
 
At that point you might just want to add a button next to each with the word "select" written on it. :) Also, remember that the CD path is utterly variable as anyone can and will have installed their games anywhere they want. Either way I advise you to look up the registry method as a learning experience if nothing else.
 
Ah, yeah, that's a good idea.
But what's the path to the CD version? When I used to play on the CD version I was just a kid who wasn't interested in paths and all that kind of stuff
There is no set path. You just manually enter what ever folder you want it to be in.
 
I mean the mod folder for the CD installation. I think it's something like C:/2k/Sid Meier's Civilization/beyond the sword/mods
Again, there is no definied folder. You can literally tell the CD installer to put it in H://Pokemon/Horse/Dragon/whatever
 
Top Bottom