Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot extract application packed by makeself... #207

Open
wxguy opened this issue Apr 15, 2020 · 13 comments
Open

Cannot extract application packed by makeself... #207

wxguy opened this issue Apr 15, 2020 · 13 comments

Comments

@wxguy
Copy link

wxguy commented Apr 15, 2020

I am using Cent OS 7.3 with up to date packages. I have developed a python application using miniconda. Now I would like to distribute my application as a self contained directory to users. Therefore, trying to make the self contained archive using makeself. It has install.sh file within the application directory. Using the latest makeself application from github to pack my application. Here is the command I executed from terminal:-

makeself.sh --notemp ./application_dir ./application.sh “APP Linux installer” ./install.sh

After packing the directory makeself didn't report any error. Here is the last line after packing the application:-
Self-extractable archive "./application.sh" successfully created.

But when the application was extracted using sh ./application.sh it produced following error

./application.sh: line 493: Linux: command not found

While everything seems to be perfect, I am struck at distributing the application. Can someone help me.

@megastep
Copy link
Owner

What version of Makeself are you using? Could you do sh -x application.sh to see the details of the execution?

@wxguy
Copy link
Author

wxguy commented Apr 15, 2020

Just downloaded from release at github (version 2.4.0). I have done this command sh -x application.sh bofore reporting here.

@megastep
Copy link
Owner

Well you kinda need to paste at least the last few lines of the output to give me a clue... -x enables a trace of all the commands being called by the script.

@wxguy
Copy link
Author

wxguy commented Apr 15, 2020

Well you kinda need to paste at least the last few lines of the output to give me a clue... -x enables a trace of all the commands being called by the script.

Doing it right away...

@wxguy
Copy link
Author

wxguy commented Apr 15, 2020

It appear to be bug with space. Now I changed the “APP Linux installer” with only "APP" and it successfully extracted the application. I will redo the test with and without space and post the output here. Last few lines of working output with debug enabled:-

+ pcent=6596542
++ expr 654311424 / 6596542
+ pcent=99
+ test 99 -lt 100
+ MS_Printf '\b\b\b\b\b\b\b'
+ printf '\b\b\b\b\b\b\b'
+ test 99 -lt 10
+ MS_Printf '   99%% '
+ printf '   99%% '
   99% ++ expr 654311424 + 4194304
+ pos=658505728
+ test 658505728 -le 659654288
+ dd bs=4194304 count=1
++ expr 659654288 / 100
+ pcent=6596542
++ expr 658505728 / 6596542
+ pcent=99
+ test 99 -lt 100
+ MS_Printf '\b\b\b\b\b\b\b'
+ printf '\b\b\b\b\b\b\b'
+ test 99 -lt 10
+ MS_Printf '   99%% '
+ printf '   99%% '
   99% ++ expr 658505728 + 4194304
+ pos=662700032
+ test 662700032 -le 659654288
+ test 1148560 -gt 0
+ dd bs=1148560 count=1
+ MS_Printf '\b\b\b\b\b\b\b'
+ printf '\b\b\b\b\b\b\b'
+ MS_Printf ' 100%%  '
+ printf ' 100%%  '
 100%  + test xy = xy
+ cd insdvp
++ id -u
+ chown -R 1000 .
++ id -g
+ chgrp -R 1000 .
++ expr 14990 + 659654288
+ offset=659669278
+ test xn = xn
+ echo

+ cd insdvp
+ res=0
+ test xecho '!=' x
+ test xn = xy
+ test xn = xy
+ eval '"echo" Successfully extracted the application... ./install.sh "$@"'
++ echo Successfully extracted the application... ./install.sh
Successfully extracted the application... ./install.sh
+ res=0
+ test 0 -ne 0
+ test xy = xn
+ eval true
++ true
+ exit 0

@wxguy
Copy link
Author

wxguy commented Apr 15, 2020

I can confirm that It is a bug. Here is the last few lines of debug enabled report with a general message I provided "APP Linux Installer" as part of makeself command:-

+ test 99 -lt 10
+ MS_Printf '   99%% '
+ printf '   99%% '
   99% ++ expr 654311424 + 4194304
+ pos=658505728
+ test 658505728 -le 659654288
+ dd bs=4194304 count=1
++ expr 659654288 / 100
+ pcent=6596542
++ expr 658505728 / 6596542
+ pcent=99
+ test 99 -lt 100
+ MS_Printf '\b\b\b\b\b\b\b'
+ printf '\b\b\b\b\b\b\b'
+ test 99 -lt 10
+ MS_Printf '   99%% '
+ printf '   99%% '
   99% ++ expr 658505728 + 4194304
+ pos=662700032
+ test 662700032 -le 659654288
+ test 1148560 -gt 0
+ dd bs=1148560 count=1
+ MS_Printf '\b\b\b\b\b\b\b'
+ printf '\b\b\b\b\b\b\b'
+ MS_Printf ' 100%%  '
+ printf ' 100%%  '
 100%  + test xy = xy
+ cd insdvp_org
++ id -u
+ chown -R 1000 .
++ id -g
+ chgrp -R 1000 .
++ expr 14933 + 659654288
+ offset=659669221
+ test xn = xn
+ echo

+ cd insdvp_org
+ res=0
+ test xLinux '!=' x
+ test xn = xy
+ test xn = xy
+ eval '"Linux" installer” ./install.sh "$@"'
++ Linux installer” ./install.sh
./insdvp.sh: line 580: Linux: command not found
+ res=127
+ test 127 -ne 0
+ test xn = xy
+ test xy = xn
+ eval true
++ true
+ exit 127

Here is the complete command I have used:-

sh ~/Downloads/makeself-2.4.0/makeself.sh --notemp ./application ./application.sh  “APP Linux installer” ./install.sh

@megastep
Copy link
Owner

I think this is probably happening inside your embedded script though: ./insdvp.sh: line 580: Linux: command not found

For one thing Makeself itself is not that big...

@wxguy
Copy link
Author

wxguy commented Apr 16, 2020

I think this is probably happening inside your embedded script though: ./insdvp.sh: line 580: Linux: command not found

For one thing Makeself itself is not that big...

/insdvp.sh is my real application name. I am pretty sure that it is not my embedded (only) script install.sh which is just four lines code checks for path in ~/.bashrc and append it accordingly. In any case makeshelf works fine if I don't provide any space in the general message. Even though my issue is solved by removing space in the general message, you may want to look at the issue.

@megastep
Copy link
Owner

The error is clearly coming from within that insdvp.sh script though, so I suggest you poke around line 580 there...

@wxguy
Copy link
Author

wxguy commented Apr 16, 2020

The error is clearly coming from within that insdvp.sh script though, so I suggest you poke around line 580 there...

Haha. Where will I poke when I don't have 580th line. Moreover I told you that insdvp.sh is my application name which I would like to distribute to others.

@megastep
Copy link
Owner

Ok, it seems I misspoke. The current Makeself header is actually over 600 lines right now (guess it grew quite a bit over the years!). So I believe your issues are probably related to the convoluted eval lines we have in there:

eval "\"\$script\" \$scriptargs \"\\\$@\""; res=\$?

@megastep
Copy link
Owner

What does your ./application.sh --info return?

@wxguy
Copy link
Author

wxguy commented Apr 16, 2020

What does your ./application.sh --info return?

Sure. Her is what the full real command I issued:-

$ sh ~/Downloads/makeself-2.4.0/makeself.sh --nox11 --notemp ./insdvp ./insdvp.sh “INSDVP Linux Installer” ./install.sh

Here is the --info output:-

$ ./insdvp.sh --info
Identification: “INSDVP
Target directory: insdvp
Uncompressed size: 1966408 KB
Compression: gzip
Date of packaging: Thu Apr 16 16:52:20 IST 2020
Built with Makeself version 2.4.0 on linux-gnu
Build command was: /home/sundar/Downloads/makeself-2.4.0/makeself.sh \
    "--nox11" \
    "--notemp" \
    "./insdvp" \
    "./insdvp.sh" \
    "“INSDVP" \
    "Linux" \
    "Installer”" \
    "./install.sh"
Script run after extraction:
     Linux Installer” ./install.sh
directory insdvp is permanent

Here is the output of flag --check:-

$ sh ./insdvp.run --check
Verifying archive integrity... ./insdvp.run does not contain an embedded SHA256 checksum.
  100%   MD5 checksums are OK. All good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants