You are not logged in.

#1 2018-09-02 22:04:02

Batou
Member
Registered: 2017-01-03
Posts: 262

How to deal with an "install.sh" script which installs files all over?

Hi guys,

I'm trying to build a PKGBUILD for thinkorswim which is a very popular stock charting/tracking application written in Java. They have OSX/Win/Linux versions and Linux version comes as an install script, thinkorswim_installer.sh, which is basically a shell script with some binary data just appended to the end of it (it's not even base64 data). So when this thing starts, it creates a temp folder, does all the dependency checks (Java version etc), decodes the binary, dumps binaries into a temp and then brings up the GUI installer. GUI installer then contacts the remote server and downloads some more data and installs it.

I have no experience writing a PKGBUILD for something like this and have no idea how to approach it. Some serious guidance would be much appreciated! smile
Thanks!

Last edited by Batou (2018-09-02 22:04:45)


Please vote for all the AUR packages you're using. You can mass-vote for all of them by doing: "pacman -Qqm | xargs aurvote -v" (make sure to run "aurvote --configure"  first)

Offline

#2 2018-09-03 00:19:17

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to deal with an "install.sh" script which installs files all over?

I guess the first step is to see what this binary data looks like. Where did you get the shellscript from? Does it have options to extract without running? (Many do, especially if they use https://makeself.io/.)

Can you trace the network request it makes to find out if there is a predictable location where the main code is downloaded from? Is that second download the only bit which is installed?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2018-09-03 00:57:45

Batou
Member
Registered: 2017-01-03
Posts: 262

Re: How to deal with an "install.sh" script which installs files all over?

Eschwartz wrote:

I guess the first step is to see what this binary data looks like. Where did you get the shellscript from? Does it have options to extract without running? (Many do, especially if they use https://makeself.io/.)

Can you trace the network request it makes to find out if there is a predictable location where the main code is downloaded from? Is that second download the only bit which is installed?

Data is basically a few jar files, few images and a tar file.

total 2.5M
-rw-r--r-- 1 batou  67K Apr 24  2015 user.jar
-rw-r--r-- 1 batou  310 Apr 24  2015 stats.properties
-rw-r--r-- 1 batou  32K Apr 24  2015 MessagesDefault
-rw-r--r-- 1 batou 950K Apr 24  2015 i4jruntime.jar
-rw-r--r-- 1 batou  72K Apr 24  2015 i4jparams.conf
-rw-r--r-- 1 batou  64K Apr 24  2015 i4j_extf_4_7caten_1viz8uq.ico
-rw-r--r-- 1 batou  329 Apr 24  2015 i4j_extf_3_7caten.html
-rw-r--r-- 1 batou  11K Apr 24  2015 i4j_extf_2_7caten_19wf0jq.png
-rw-r--r-- 1 batou 1.4K Apr 24  2015 i4j_extf_1_7caten_18g079x.png
-rw-r--r-- 1 batou  32K Apr 24  2015 i4j_extf_0_7caten.utf8
-rw-r--r-- 1 batou 1.3M Sep  2 20:47 sfx_archive.tar

Extracted data: https://file.io/s1PQxj  (tar.gz, should download without any captchas etc)

Official installer is here: https://mediaserver.thinkorswim.com/ins … stall.html  but I've had trouble running it under my install (could be something specific to my machine) so I found an older one which runs fine. If you want to try it and can't get this one working, let me know and I'll upload an older one.


Please vote for all the AUR packages you're using. You can mass-vote for all of them by doing: "pacman -Qqm | xargs aurvote -v" (make sure to run "aurvote --configure"  first)

Offline

#4 2018-09-03 04:21:40

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to deal with an "install.sh" script which installs files all over?

I've tried reading the shellscript and running the tail command it uses to extract data -- no luck, doesn't seem to be a valid gzipped file. Honestly, it seems to be broken since it ignores most of the 14MB contents.

Your file.io link is a 404 not found error.

Last edited by eschwartz (2018-09-03 04:22:35)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2018-09-03 04:43:02

Batou
Member
Registered: 2017-01-03
Posts: 262

Re: How to deal with an "install.sh" script which installs files all over?

Eschwartz, give this one a try: https://file.io/2CFwFH  this is the installer that works for me.


Please vote for all the AUR packages you're using. You can mass-vote for all of them by doing: "pacman -Qqm | xargs aurvote -v" (make sure to run "aurvote --configure"  first)

Offline

#6 2018-09-03 04:56:44

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to deal with an "install.sh" script which installs files all over?

Once again, 404 Page not found

I suggest trying a better file host. wink


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2018-09-03 05:09:52

Batou
Member
Registered: 2017-01-03
Posts: 262

Re: How to deal with an "install.sh" script which installs files all over?

Eschwartz wrote:

Once again, 404 Page not found

I suggest trying a better file host. wink

This file host is ephemeral... after someone downloads the file, it's not available anymore. Someone was downloading files before you got to them smile

Please give this a try: https://www.dropbox.com/s/9rgo99agw4fx6 … sh.gz?dl=0


Please vote for all the AUR packages you're using. You can mass-vote for all of them by doing: "pacman -Qqm | xargs aurvote -v" (make sure to run "aurvote --configure"  first)

Offline

#8 2018-09-03 14:45:08

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to deal with an "install.sh" script which installs files all over?

The file still does not seem to be a valid gz or tarball... not really sure what to do with the data in it.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#9 2018-09-03 19:00:31

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,852

Re: How to deal with an "install.sh" script which installs files all over?

tar and unzip couldn't handle the archive , but gunzip is able to unpack it .

The ./thinkorswim_installer.sh starts a gui, a quick peek into it doesn't reveal any commandline parameters.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#10 2018-09-03 19:28:28

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: How to deal with an "install.sh" script which installs files all over?

Might have done something wrong before, because that file is valid now... prolly looked at an old copy. big_smile

So...

$ grep -a tail thinkorswim_installer.sh
tail -c 933495 "$prg_dir/${progname}" > sfx_archive.tar.gz 2> /dev/null
$ tail -c 933495 thinkorswim_installer.sh > thinkorswim_payload.tar.gz
$ mkdir thinkorswim_payload/
$ bsdtar -xf thinkorswim_payload.tar.gz -C thinkorswim_payload
$ ls thinkorswim_payload/
i4j_extf_0_7caten.utf8         i4j_extf_2_7caten_19wf0jq.png  i4j_extf_4_7caten_1viz8uq.ico  i4jruntime.jar   stats.properties
i4j_extf_1_7caten_18g079x.png  i4j_extf_3_7caten.html         i4jparams.conf                 MessagesDefault  user.jar

Seems like it just runs i4jruntime.jar:user.jar with some fancy java options. If you read the shellscript, the end of it will just run:

$INSTALL4J_JAVA_PREFIX "$app_java_home/bin/java" -Dinstall4j.jvmDir="$app_java_home" -Dexe4j.moduleName="$prg_dir/$progname" "$vmov_1" "$vmov_2" "$vmo
v_3" "$vmov_4" "$vmov_5" $INSTALL4J_ADD_VM_PARAMS -classpath "$local_classpath" com.install4j.runtime.launcher.Launcher launch com.install4j.runtime.i
nstaller.Uninstaller true false "" "" true true false "" true true 0 0 "" 20 20 "Arial" "0,0,0" 8 500 "version desktop" 20 40 "Arial" "0,0,0" 8 500 -1

That would be the -classpath "$local_classpath" part. big_smile


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

Board footer

Powered by FluxBB