In this blog we all see that how we can create a shell script to install jar package from tar.gz file. Below is the steps we need to follow for package jar file into tar.gz.
Step 1 : First we need put all required jar files and .desktop file and other related file like icon and images required in one folder.
Step 2 : Then compress folder to create .tar.gz.
Step 3 : Now create the bash script which extract tar.gz file and install it in one specified location. Below is the script which is used in my case.
#!/bin/bash
if which java >/dev/null; then
sudo tar xvfz CaptionLabs.tar.gz -C /opt #(Path for Extract Files)
mkdir ~/.local/share/applications/
sudo tar xvfz CaptionLabs.tar.gz -C ~/.local/share/applications
sudo cp ~/.local/share/applications/CaptionLabs/CaptionLabs.desktop ~/Desktop/CaptionLabs.desktop
sudo chmod 777 ~/Desktop/CaptionLabs.desktop
echo "Program installed.!"
else
echo "JRE Not Installed..!"
fi
read
exit
Step 4 : At last you need to change chmod +x of script to make it executable and run it.
This will create the .desktop file in desktop and you can run the application by double click on that icon.
THANKS
More From Oodles
Ready to innovate? Let's get in touch
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Raman Joshi
Raman is a bright web app developer with experience in Java , Groovy and Grails frameworks