Self Extracting exe

My VB application should extract an exe which contains list of files
( .gif, .jpeg, shockwave etc.) and store the extracted files in a folder.
Expecting Answer at the earliest.
Thank You
USHASHIAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

VbmasterCommented:
You can add any binary data to a resource file and at run-time you can extract that data and save it to disk.
0
VbmasterCommented:
I found the resource editor I use, it's at

http://www.planetwide.co.uk/vbaddins.htm

It's a VB addin so you will have to install it and activate it in the Addin Manager, but when you have done that it's a peace of cake, really.

You will get a new button in the toolbar push it and add all the files you wanna add, then save it (important! because there is NO autosave). You can load custom data using

  Dim ByteArray() As Byte
 
  ByteArray = LoadResData(101, "CUSTOM")
  Open testfilename For Binary As #1
  Put #1, , ByteArray
  Close #1

Check the helpfile for loading resource bitmaps.
0
LeXienCommented:
a problem will arise from using Resources - ithink.
RES files are limited as how big files can be - 64k is the maximum. So if you planning to put big stuff in them - think again.

I recommand StructuredStrorage - checkout - www.desaware.com and look at their StorageTools component.


hope this helps,

regards,

thanks
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

VbmasterCommented:
And if you want to do it without paying $149.00 you can use you head and split the big files (if you have any) into 64kb chunks. When you are to save the files to data, just read chunk by chunk and append to the files. Is that kinda hard labour really worth $149? ;)
0
mark2150Commented:
Alternately use PKUNZIP...

M
0
USHASHIAuthor Commented:
Reseditl.exe in http://www.planetwide.co.uk/vbaddins.htm
is for VB5. I am working in vb6.
  So, I added files using resource editor available in vb Application wizard and I used vbMaster's 4 lines code. It works fine. But this will help if U'r adding resources statically. I have 2 problems in this.
1.I want to add resources dynamically.
 Is it possible?
2. When using LoadResData(101,"CUSTOM") the type of file is not known. Is there any way to know the file type. (FOr ex. whether 101 id denotes
to .gif, .jpeg, .avi etc.) It will be nice if I can have the full filename too.
Thank You,  
 

0
mcriderCommented:
Try this link:

WinZip Self-Extractor 2.1
http://www.winzip.com/winzipse.htm?wzt 
 
With winzip self-extractor, you can build a zip file and have the self-extractor extract the zip file and actually run a program after the extraction is complete.

There are 2 methods WinZip uses...

Build a self-extractor for software installation, and self-extractor only...

There is a FREE demo of the product at the site I gave you, and if you want to register it, it's only about $49.


If you use this solution please select this comment as the solution...



Cheers!
0
VbmasterCommented:
I don't think it's possible to change the resources dynamically during run-time because it's a part of the exe file that is running, and no changes can be made of a running file.

A solution for 2. would be to store the filenames and perhaps the filetype too as a string and use LoadResString to load it (use the same index that way you know that 101 in LoadResData has the 'definition' in 101 in LoadResString.).

If you want to change the data dynamically then resource files are not the way to go, you can save the files on disk in the program directory and read from there instead (you can use ZLib compressions if you want to add compression for free).
0
USHASHIAuthor Commented:
The winzip self extractor is a stand alone application. The files to be zipped are to be selected from the vbaplication itself. Could you please tell me if winzip has any distribution dll's so that i can add thro' reference and use. And I also would like to know about Zlib compressions which vbmaster has mentioned.
Thank You,
0
USHASHIAuthor Commented:
The winzip self extractor is a stand alone application. The files to be zipped are to be selected from the vbaplication itself. Could you please tell me if winzip has any distribution dll's so that i can add thro' reference and use. And I also would like to know about Zlib compressions which vbmaster has mentioned.
Thank You,
0
mark2150Commented:
You can get a copy of PKZIP/PKUNZIP for free from PKWARE.COM. It includes ZIP2EXE which will convert a .ZIP into a .EXE. Once you have the .EXE you can use the command line switches to tell it what and how to extract. No .DLL's needed. Simply use SHELL to pull out whatever you need. If you need your app to *wait* for the extraction to complete use the ExecCmd (Source code on my web page - www.cyberchute.com/rvbus/madmark ) instead of SHELL.

M
0
VbmasterCommented:
The official homepage of the ZLib compression is at..

   http://www.cdrom.com/pub/infozip/zlib/

You will need a 52kb DLL file, and I have made a class file (that is really easy to use) as a wrapper around the functionality, you can find the dll and cls file at..

  http://www.cyd.liu.se/~freqv416/zlib/

You can compress byte arrays using the class just remember that you need to store the actual size (size before compression) because when you uncompress the dll needs the size of the uncompressed data. The class members parameter says it all I think.
0
hakanwaagCommented:
0
hakanwaagCommented:
http://www.geocities.com/SiliconValley/Foothills/9940/

At the site that i provided an address for above, you can find a typelib that you can use for structured storage files. Just look at the typelibs section when you get there and download the "Storage Interfaces" file. It says "read and write office documents" but it should work with whatever format you want.
0
hakanwaagCommented:
Sorry for the double post, there was some kind of error in my browser when I posted it.
0
hakanwaagCommented:
I forgot to say this in my last posting, if you visit the source code area there you can find an example of how to use the typelib.
0
datacopCommented:
I use IExpress from the IEAK to create all of my self extracting .exe's..  the order of operations is this (for me anyway) use P&D wizard to create the setup, then use IExpress to roll them all up into a self extracting .exe
0
USHASHIAuthor Commented:
MCRIDER & MARK2150 ANSWERS HAS WORKED. CALLING WINZIP SELF EXTRACTOR FROM SHELL PROVED TO BE A GOOD SOLUTION.
THANK YOU.
0
mark2150Commented:
and the points go to...?

(grin)

M
0
mcriderCommented:
Well, I mentioned the WinZip Self-Extractor and where to get it... mark2150 suggested PKZIP...

Cheers!
0
USHASHIAuthor Commented:
50 points to mcrider and 25 to mark2150
0
mcriderCommented:
USHASHI,

To split points, you need to open two new questions with the titles "For MCRIDER ONLY" and "For MARK2150 ONLY".

Assign the points to the questions and then go to http://www.experts-exchange.com/Customer_Service/Experts_Exchange/ and post a question there to have customer service refund the points for this question.

Don't for get to mention this question number: "Q.10253478"


Cheers!
0
mcriderCommented:
USHASHI, You still there???
0
mcriderCommented:
USHASHI, You still there???
0
ianBCommented:
Hi,

I am answering this question so it can be saved as a PAQ.

mcrider and mark2150 will find their question in this topic area to answer for points.

IAn
Community Support @ Experts Exchange
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.