Automating the install of a program

Hello!

So I have a program I want to automate the installation of, it is basically just an archive of the program that is ready to be used, I can just unpack it somewhere and run its shell script to start using the program.

This is the program: https://www.scilab.org/download/2023.1.0/scilab-2023.1.0.bin.x86_64-linux-gnu.tar.xz

But I want to have a desktop shortcut for it so that I can run it anywhere instead of navigating through files just to run its shell script. So I found this thing to create a desktop shortcut:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/usr/bin/gedit
Name=gedit
Comment=gedit
Icon=/home/linuxconfig/Downloads/icon.png

I just add it to usr/share/applications and then edit the details. However I want to automate this process, I would like to know if there is a way of doing this? Like maybe a script to unpack the archive to a certain place then create a .desktop file for it too?

as per the destop file you are posting that will only open gedit. any simple script can automate the process. I’m assuming you don’t have to install it everytime? you just need a desktop file for the binary to execute by clicking am I understanding you correctly?

If you know the commands to type in a terminal to do the steps you want, then creating a script is easy. Begin the script with a standard sh bang and just insert each command.

#!/bin/bash

make a directory:

mkdir /opt/scilab

command to untar the file:

tar -xf scilab-2023.1.0.bin.x86_64-linux-gnu.tar.xz -C /opt/scilab/

command to create a desktop shortcut:

cat > /usr/share/applications/scilab.desktop << EOF
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/opt/scilab/scilab-2023.1.0/bin/scilab
Name=scilab
Comment=scilab
Icon=/opt/scilab/scilab-2023.1.0/share/icons/hicolor/48x48/apps/scilab.png
EOF

Since this script is writing to system directories, use sudo to run the script.

2 Likes

Why not create a PKGBUILD for it? You don’t have to upload it to the AUR if you don’t want to. I maintain a few non aur PKGBUILDs myself.

That is actually a good point.

Here is a quick PKGBUILD for it:

pkgname=scilab
pkgver=2023.1.0
pkgrel=1
pkgdesc='A scientific software package for numerical computations.'
arch=('i686' 'x86_64')
url='https://www.scilab.org'
license=('BSD' 'custom:CeCILL' 'GPL2')
depends=()
makedepends=()
options=(!strip)

source=("https://www.scilab.org/download/2023.1.0/scilab-2023.1.0.bin.x86_64-linux-gnu.tar.xz")
sha256sums=('8abcd28bc560f47a48479c37d3aaf9a976156611f1ca238cda1ac4ad866fa8c5')

package(){
  mkdir -p ${pkgdir}/usr/local/
  cp -r ${srcdir}/${pkgname}-${pkgver} ${pkgdir}/usr/local/
}

This will take the latest binary tar archive and create an arch package named: scilab-2023.1.0-1-x86_64.pkg.tar.zst

This will install the software in the folder /usr/local/scilab-2023.1.0

And the program can be started with command: /usr/local/scilab-2023.1.0/bin/scilab

PS
The installation is big (600 MB). If you allow stripping of the binaries it will become a little smaller (470 MB). To do so, just remove the options line.

2 Likes
yay scilab      
5 aur/jupyter-scilab_kernel-git 135.git.b2e9069-1 (+0 0.00) 
    A Jupyter kernel for Scilab
4 aur/python-sciscipy 1.0.1-1 (+1 0.00) (Orphaned) 
    A Scilab API for Python
3 aur/scilab-git 6.2.0.r216.g81a9cc04933-1 (+8 0.00) 
    A scientific software package for numerical computations.
2 aur/scilab-bin 2023.1.0-1 (+30 0.10) 
    A software package for numerical computation, providing a powerful computing environment for engineering and scientific applications.
1 aur/scilab 6.1.1-1 (+85 0.11) (Out-of-date: 2023-03-11) 
    A scientific software package for numerical computations.
1 Like

Looks like I was not doing the neccessary due dilligence :wink:

2 Likes

So there are many ways to do it :open_mouth: I’m gonna try doing each of them, I am still pretty new to this things. Thank you all!

you misinterpreted the last posts.

All you need to do is

yay -S scilab-bin

it is already scripted in the AUR

3 Likes