by Spiros Kaftanis
How InstallerCreator created.
When you create an application in any programming language you have as a result an executive file. If you are working in windows this executive ending with “.exe”. In Linux there is no ending.
So, after so much programming work the only think you have is a single executive file. But regular applications don’t work exactly like this. You don’t search for the executable file when you want to launch an application. The application is “installed” in your system. But what is installation?
In this tutorial we will talk about installation in Linux, because #InstallerCreator is design only for this operating system.
So, when we create a computer application we need also another application, called “installer”. For Linux distributions there is a way to create “deb” for debian/ubuntu “rpm” for fedora etc. The other way is to write your own installer or to use #InstallerCreator instead.
But how #InstallerCreator works?
In Linux all the executive files placed in /usr/bin. Simple as that. When you place your executive in this folder and make it executable giving the command
chmod +x executive_name
where executive_name is the name of the executive, your application is installed. If you open a terminal and write the name of the executive as a command your application will open.
So the first idea to create #InstallerCreator is just to copy the executable in /usr/bin. This actually don’t work if the application has dependencies such as images, scripts etc. In this occasion dependences can be placed only in a specific location. So, when you run the application from /usr/bin the code can’t find images and other staff because there aren’t in right place. If applications haven’t dependencies that problem doesn’t exist.
In most cases the problem exist so the second idea is to create a simple bash script which launches the executive from the original folder and place that script in /usr/bin.
InstallerCreator creates automatically this script for us. The script has only two simple lines: a “cd” (change directory) to the directory where the real executable is placed and a command to run in (starting with “./” characters and following with executable’s name.
After that the two line executive moves in urs/bin, so it’s installed. When you type its name in command line application launches.
You can see a sample of an two lines executive.
his procedure requires of course not to move the original file.
But something missing. Application isn’t visible from menu yet. You can only run it from command line.
To make application visible from menu we need also another file with .desktop ending placed in /usr/share/application folder. In this folder you can find many similar .desktop files with the following format:.
desktop files has much more options. You can read more about them here.
InstallerCreator after “reading” from user all necessary informations (icon location etc) creates automatically this .desktop file and put it in the right place.
It’s necessary to give your password, because /usr/share folder (and /usr/bin of course) requires root privileges.
What about uninstall?
Uninstall procedure requires only to remove these to files (the executable and .desktop).
In the install script when an installation completes the name of executable placed in a hidden file in /home folder called .InstallerCreator. Uninstall script read this file and creates a list. Here user chooses between InstallerCreator’s application for the uninstall.