Shell What is the magic under this?

  • Thread starter Deleted member 66267
  • Start date
D

Deleted member 66267

Guest
A megabytes in size shell script that could be used like an installer on Windows! I don't know how could they do that! What is the technique they used? Could I apply the same technique to produce similar shell scripts like that on FreeBSD? I liked the idea of an installer like on Windows very much. If it's possible I think I should provide just one giant shell script that is a universal installer, it will depend on the OS it's running to install the correct binary packed with itself. This way I don't have to depend on each OS's own package manager. Of course I will install to /opt and not mess with the software managed by the OS's package managers.
 
That's the page. The actual size is 379 MB.
It means that you even didn't try to test it.
No. I really used this big shell script to install NetBeans on Linux. But I think it's wrong to link Linux software here so I only linked the page with download links.
 
  • Thanks
Reactions: a6h
It's just an slightly more advanced version of shar(1). Principle is the same though.
I should think about this before I come up with the universal installer idea:
It is easy to insert trojan horses into shar files. It is strongly rec-
ommended that all shell archive files be examined before running them
through sh(1). Archives produced using this implementation of shar may
be easily examined with the command:

egrep -av '^[X#]' shar.file
Going with each OS's own package manager is much safer.
 
Isn't this becoming fashion again in the Linux world, just called ".run" instead of ".shar"?

Usually there are ways to look into the contents and extract without having to run such self-extracting installers.
 
Eh just pipe curl to a root shell like all the cool kids do. What could possibly go wrong?

Wow, Rust still wants you to install like this

Even though they got called out for it
 
My experience is these kinds of shar installers end up in an error message that Zenity or some other scriptable UI wrapper isn't found. And then I would cringe knowing it was going to run that as as root.

Honestly for 3rd party software, just a zip or tarball that I can extract to /opt is always a better solution.
 
Back
Top