Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Create a .run archive installer

Posted on 2006-05-04
6
Medium Priority
?
270 Views
Last Modified: 2010-04-21
Hi experts !

  I would like to create a .run archive/installer to distribute a software that I've created.  I want something similare to the nVidia installer, which have an easy to use command-line interface.  My software is to be installed on server, so no fancy GUI, just pure command-line.  I need to check for some package on the server, to check dependency in other words.  Also, I want it to be a one-file installer, so the administrator have to copy/execute one file that will do all the job.  Don't want a .tar.bz2 archive ... something more "professional".

Thanks you very much for your help !
Have a nice day !
Xor
0
Comment
Question by:BGMi
  • 3
  • 3
6 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 2000 total points
ID: 16609705
the general method would be towrite a shell script which does all your checks and finally installs your .tar.bz2
This .tar.bz2 could be part of the shell script, the script will simply remove itself from the script which then leaves the dada for the original .tar.bz2
0
 

Author Comment

by:BGMi
ID: 16610131
Ok ! Nice solution ! So I create an archive, edit it as a text file, create my script at the top, and then, once the execution is completed, I make it remove the script part ... or I also re-create the archive from the code I suppose ?  That way, I don't modify my script and is still valid after I ran it.  Thanks a lot for the idea !

Do you know if that the method the nVidia installer use ?  Or is there another way around ?  I'll wait a little bit before accepting your answer ... but for now, your solution seem very nice !

Thanks a lot !
Xor
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16610331
> .. So I create an archive, edit it as a text file,  create my script at the top, ..
that'll be difficult (depends on your editor:)
I'd first write the script, then do:
  cat your.tar.bz >> script

> Do you know i
no, I don't


> .. or I also re-create the archive from the code I suppose ?
hmm, not sure what you mean.
Example:
  lets say your script all i n all (comments etc. but without the .tar.bz2) has exactly 42 line, then you extract the binary tar part
in that script like follows:
  sed -e '1,42 d' $0 | tar jxf -

so the sample of the script looks like:

#! /bin/sh
# line 2
# .. your script code
sed -e '1,42 d' $0 | tar jxf -
# .. more script code
# next line is nr. 42
exit

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:BGMi
ID: 16610446
Ok ! Nice ! I'll try it this weekend if I have time ! Thanks a lot !

For the "... or I also re-create the archive from the code I suppose ?" part, what I meant was the, for example, if I stock the binary value of the archive in a variable, and the, in the script, do something like:
echo $varTarBinaryValue > temp.tar.bz2

Can I create an archive that way ?  I know I can do something similair with other languages ... but in bash ... never tried !

Thanks for your help !
Xor
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16610473
> Can I create an archive that way ?
no 'cause a script most likely cannot handle binary data itself
except your data has only valid characters or you manage to escape them proper, better forget abouit it.
0
 

Author Comment

by:BGMi
ID: 16610493
Yeah ! That's true !  I did it once ... but via a MySQL database with a "binary" type field ... so that's why it worked with PHP/MySQL !

Thanks a lot for you help !
Have nice day !
Xor
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question