Self extracting archive for Linux and windows


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Self extracting archive for Linux and windows
# 1  
Old 07-14-2013
Self extracting archive for Linux and windows

Is there a way to create a self extracting archive that works in both linux and windows? And if so how? Everything I have read on google only works in either Linux or Windows but not both.
# 2  
Old 07-14-2013
AFAIK a self extracting archive is an executeable file that, when run, put the files contained in it into the respective target directories.
You can't have an executeable program for *nix running on Windows nor vice versa.
# 3  
Old 07-14-2013
The file format of executable images varies across platforms, with flavors named: COFF, PE, ELF, Mach-O, and others.

COFF is an old Unix format (from MS-DOS and Xenix, an MS Unix in the 1980's) that MS now has morphed into the Portable Executable (PE) format -- a very much changed format. The Extensible Firmware Interface (EFI) defines PE as the standard format in EFI environments.

Mach-O is the format on OS X boxes.

Linux executables are ELF format. Solaris 10 uses ELF as well on both sparc and x86 platforms. PE+ and ELF64 are the formats in 64 bit format. ELF64 is usually just called ELF, which is confusing.

This is what RudiC is talking about. It is the same idea as 'why does a Windows virus not infect a linux system'. Answer: the file format is garbage as far as the OS image activator can tell.
# 4  
Old 07-14-2013
As already said, self-extracting implies an executable program which you can just run on either platform and it will unpack. On x86 this is not impossible but would need thorough testing on the platforms involved.

However, many times I have found that creating a 'tar' file on Sys V followed by 'compress' (creating a .Z), followed by 'ftp' to a Windows platform, can be unpacked by WinZip or WinRAR quite easily. Again, testing on the specific platforms and specific tar and zip versions is necessary.

It's then possible to script the operation both on Sys V and Windows to unpack the data after detecting which platform it is on and calling the correct utility to unpack the data.

Hope that helps.
# 5  
Old 07-14-2013
Quote:
Originally Posted by RudiC
AFAIK a self extracting archive is an executeable file that, when run, put the files contained in it into the respective target directories.
You can't have an executeable program for *nix running on Windows nor vice versa.
Thank you I didn't realize that.

Quote:
Originally Posted by jim mcnamara
The file format of executable images varies across platforms, with flavors named: COFF, PE, ELF, Mach-O, and others.

COFF is an old Unix format (from MS-DOS and Xenix, an MS Unix in the 1980's) that MS now has morphed into the Portable Executable (PE) format -- a very much changed format. The Extensible Firmware Interface (EFI) defines PE as the standard format in EFI environments.

Mach-O is the format on OS X boxes.

Linux executables are ELF format. Solaris 10 uses ELF as well on both sparc and x86 platforms. PE+ and ELF64 are the formats in 64 bit format. ELF64 is usually just called ELF, which is confusing.

This is what RudiC is talking about. It is the same idea as 'why does a Windows virus not infect a linux system'. Answer: the file format is garbage as far as the OS image activator can tell.
Thank you for the detailed explanation.

Quote:
Originally Posted by hicksd8
As already said, self-extracting implies an executable program which you can just run on either platform and it will unpack. On x86 this is not impossible but would need thorough testing on the platforms involved.

However, many times I have found that creating a 'tar' file on Sys V followed by 'compress' (creating a .Z), followed by 'ftp' to a Windows platform, can be unpacked by WinZip or WinRAR quite easily. Again, testing on the specific platforms and specific tar and zip versions is necessary.

It's then possible to script the operation both on Sys V and Windows to unpack the data after detecting which platform it is on and calling the correct utility to unpack the data.

Hope that helps.
What program creates .Z files? Is that 7z?
# 6  
Old 07-14-2013
UNIX compress creates .Z files.
# 7  
Old 07-15-2013
I've seen perl/python/etc scripts floating around that will take a list of files and write a single file containing both the compressed and encoded data and the perl/python/etc code necessary to extract it. If using perl/python/etc is an option, you may want to search for them.

Regards,
Alister
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Seen Windows pc, having all the features of Linux, could exe, read and edit save like windows

Hi, totally new to linux base using windows when started learning and using computers. but i remember that one pc was there , look alike windows desktop, but could not do the task as windows just click and open and view edit etc. But, you could do a little differently even saving in and opening... (8 Replies)
Discussion started by: jraju
8 Replies

2. Shell Programming and Scripting

Script to archive logs and sftp to another archive server

Requirement: Under fuse application we have placeholders called containers; Every container has their logs under: <container1>/data/log/fuse.log <container1>/data/log/fuse.log.1 <container1>/data/log/fuse.log.XX <container2>/data/log/fuse.log... (6 Replies)
Discussion started by: Arjun Goswami
6 Replies

3. Homework & Coursework Questions

Creating and extracting archive file

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi there, I wish to create a single .tar file of the current directory but have literally no idea on where to... (8 Replies)
Discussion started by: Banned
8 Replies

4. Linux

Linux make bootable archive

Can anybody suggest me software to backup Linux server and to make them boot able (1 Reply)
Discussion started by: Vit0_Corleone
1 Replies

5. Shell Programming and Scripting

Extracting from archive | compressing to new archive

Hi there, I have one huge archive (it's a system image). I need sometime to create smaller archives with only one or two file from my big archive. So I'm looking for a command that extracts files from an archive and pipe them to another one. I tried the following : tar -xzOf oldarchive.tgz... (5 Replies)
Discussion started by: chebarbudo
5 Replies

6. Linux

What's better for running Windows software in Linux, Wine or Windows VMware?

What are the differences, advantages, and disadvantages? (1 Reply)
Discussion started by: Advice Pro
1 Replies

7. Shell Programming and Scripting

Read specific file from a zip archive without extracting

Hi All, I would like to extract specific file from a zip archive. I have a zip archive "sample.zip". sample.zip contains few text files and images... text1.txt, text2.txt, pic.jpg etc... I need to read specific file "text2.txt" from "sample.zip" WITHOUT EXTRACTING the zip file. ... (4 Replies)
Discussion started by: sridharg
4 Replies

8. UNIX for Dummies Questions & Answers

Extracting from a tar archive file

Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory? For example the archive files may have a filename of /SrcFiles/XXX/filename.dat and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file was... (1 Reply)
Discussion started by: nmalencia
1 Replies

9. Linux Benchmarks

Original (Archive) Site for Linux Benchmarks

FYI: Here is the archive site for the original Linux benchmarks (1994 - 1996) http://linux.silkroad.com/ Neo (3 Replies)
Discussion started by: Neo
3 Replies
Login or Register to Ask a Question