|
Post by munchi on May 9, 2007 3:31:00 GMT -5
Hi!
I spend a while trying to create SFX files, but I was not able to figure out how it really works.
procedure MakeSFX(SFXStub: string; ModHeaders: Boolean);
The help says: "Use your own sfx stub or you may use one of the ones supplied by VCLZip".
I used the zipsfx32.bin from your demo and it works fine. But what exactly is a SFXStub? What is it good for? Does the Stub control the selfextracting GUI? How ca I create my own Stub?
I find it very unhandy that the Stub (whatever it is) has to be stored in a file which path is used as parameter for MakeSFX. Wouldn't it be possible to pass the data it self as a variable to the MakeSFX methode?
Sure, the file could be shipped with a program and stored in the installation dirctory. But because of the strict user restrictions under Vista I would like to minimize the number of files that has to be accessed. For that purpose it would be better if the Stub could some how be compiled directly into the program itself.
Thank you very much!
|
|
|
Post by Kevin on May 9, 2007 16:43:08 GMT -5
Munchi,
An sfx stub is a Self Extracting program that manipulates (unzips) files in a zip archive. Once you have the program working the way you want, the archive is attached to the program so that the program and zip archive are all contained in the same EXE file, so your data is actually self contained inside your program.
MakeSFX is just the tool that you, the developer would use to attach your zip archive containing your data to your program that will unzip that data (for instance an installation program).
To create your own stub in Delphi, just initially write your program (your stub) to open up your zip archive as a separate file. Then when everything is working as you want it to, just change the code that you have that sets the ZipName property so that your program sets ZipName to point at itself. So if your program is called Install.exe, you will set ZipName := Install.exe. Compile it, then run MakeSFX which will attach the zip archive, which essentially makes your EXE program a zip archive and it opens itself up while it is running.
Kevin
|
|
|
Post by munchi on May 11, 2007 4:51:44 GMT -5
Thank you for your explanation. If I have understood everything correctly it works like this:
1. A SFX Stub is a program, maybe MyStub.exe, that unzipps files to some directory. 2. The only difference to a "real" unzipper is, that the zip data is contained in the MyStub.exe itself. 3. I Have to use MakeSFX in a second program, maybe CreateMySFXZip.exe, to attach the zip data to the MyStub.exe 4. When calling the MyStub.exe I have to use ZipName:="MyStub.exe" to tell the program to unzipp the files from that file.
Is that correct?
Is the source code of the zipsfx32.bin/exe available as demo?
|
|
|
Post by Kevin on May 12, 2007 11:16:42 GMT -5
You've got it!!! ;D
The source code for the stub is available, but it is not a VCL program, it is a native windows program. This is so that it can be very small. These days it really isn't that important to have small stubs like it used to be.
The source for the stub is on the VCLZip registered version download page. There is also an example project there that you can download that will do the MakeSFX.
Kevin
|
|
|
Post by flekler on Apr 29, 2008 4:39:21 GMT -5
You writes that the SFX stub is available at VCLZip registered version download page. I can nowhere find it. Can you please write an URL to this dowload page?
|
|
|
Post by Kevin on Apr 29, 2008 7:01:14 GMT -5
The SFX stub itself is included in the distribution of VCLZip. The source code is on the registered version download page. Look near the bottom of the page, there are 3 different files related to SFX stubs.
I also sent you an email about it just a bit ago.
Let me know if you have any other questions.
Thanks,
Kevin
|
|