What makes a program being 'installed'

Businek

New Member
Joined
Dec 13, 2021
Messages
4
Reaction score
0
Credits
35
Hello!

I want to make an installer for my game so that the game is recognised as 'installed' on the system. Just like the GOG games installers.
For that I need to know where to copy what files.

I know that the actual files of a program go generally in /usr/bin or /usr/local/bin. The user files go in /home/user/.local/share/ or similar.
There are also the .desktop files that make them appear in the menus, or something like that. Also there are the links to the executables in the /bin directory.
Am I right? Am I leaving something out?

Thank you very much for your answers :)
 


JasKinasis

Well-Known Member
Joined
Apr 25, 2017
Messages
1,519
Reaction score
2,160
Credits
10,952
As this is a game we're talking about - then if your game has external assets (scripts, images/textures, audio/video, 3D models etc.) that are dynamically loaded at runtime - you may want to consider putting the actual executable and the assets all together in a directory somewhere like /usr/share/nameOfYourGame/
Then you could put a symbolic link to the executable in /usr/games/, or /usr/share/games.
The .desktop file usually goes in /usr/share/applications.
And any user data/settings usually go in home/user/.config/nameOfYourGame/.

If everything is self-contained in the executable, then you could just put it in any of the directories in $PATH - however, because it is still a game we're talking about - then /usr/games/ or /usr/share/games/ would still be the most logical places to put it IMO.
 
OP
B

Businek

New Member
Joined
Dec 13, 2021
Messages
4
Reaction score
0
Credits
35
Yeah, I see. Thanks!
But then I need to run the installer always as root from the terminal, otherwise it will fail trying to access the /usr directory, right?
So I could make a 'choose installation destination' dialog or install it directly in the user's directory home/user/games or something similar.
 

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
1,472
Reaction score
1,074
Credits
9,160
With RPMs, and I believe also with DEBs, once you use the install tool, ( apt, rpm, yum, dnf, etc... )
It writes this to a flat metadata database on the system.

You can run something like... " dnf list installed | grep yourGame"
and it will tell you if it is installed or not.
 

joshmark

New Member
Joined
Dec 14, 2021
Messages
6
Reaction score
3
Credits
51
When you install RPMs, and I assume DEBs as well, the install tool (apt, rpm, yum, dnf, etc...) writes this to a flat metadata database on the system.

You may use a command like "dnf list installed | grep yourGame" to see if it is installed or not.
 
OP
B

Businek

New Member
Joined
Dec 13, 2021
Messages
4
Reaction score
0
Credits
35
Oh that's cool, don't you know how to write manually to that metadata databases? Or how is that database called and where it is loacated? I looked for this but I'm not sure if what I found is accurate.
 

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
1,472
Reaction score
1,074
Credits
9,160
Oh that's cool, don't you know how to write manually to that metadata databases? Or how is that database called and where it is loacated? I looked for this but I'm not sure if what I found is accurate.

It's different for each different distro. dnf/yum is different from apt/deb.
Why would you manually want to write to it? It's typically encoded or binary.
You don't have to manually write to it, whenever yum, dnf, or rpm is ran, it's get written to automatically.
The same for apt and dpkg.
 
OP
B

Businek

New Member
Joined
Dec 13, 2021
Messages
4
Reaction score
0
Credits
35
Sure, I won't write to it manually, it was a silly thought. I guess I know what I needed now to make my installer :)
Thank you guys!!
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top