its rather simple to do it, when you have seen the source once.
uhm he packs the data and injects it into a stub, then adding the size of the packed file.
So the final exe is like this:
|-------------|
|EXE data---|
|Packfile----|
|Size(long)-|
|-------------|
Then the stub does this:
reads the 4 numbers from the end of itself to get the size of the packed file, then it copys all the packed data to disk and extracts it. You can examine the source of his great packer

else, there is some source on this forum somewhere, that does it.
then you can easly make your own self extractors and exe builders and that stuff.
Thats also a good way if you have made your own script language, and now want a kind of interpretter that the user can put down in 1 exe.
uhm num3 dont get angry because i post your code here
but geotrail, heres the extractor source in the stub:
Code: Select all
ReadFile(0, filename)
FileSeek(Lof()-4)
filelen.l = ReadLong()
If filelen>0
mem=AllocateMemory(filelen)
FileSeek(Lof()-4 - filelen)
ReadData(mem, filelen)
CreateFile(1, "~tmp")
WriteData(mem, filelen)
CloseFile(1)
CloseFile(0)
so you see it does what i've told
the code for injecting the file:
Code: Select all
If OpenFile(0,"Install_Libary.exe")
WriteData(?installer,?installer_end-?installer)
WriteData(mem, len)
WriteLong(len)
CloseFile(0)
EndIf
Opens install_library.exe
injects the installer stub
writes the packed file
and then the lenght of the packed file.
Num3: Thanks for the source that i have posted here. If i shall remove it please say, but you have put the source to your installer, so i guess its ok.
But anyway num3, its a great app, even though i dont make userlibs. But if people would use this, it would be better than copying and pasting. Could be nice with a lib administration program, where it could list the installed libs and then you choose to remove them, and then all files the lib installes is also removed (help files etc). But thats just a dream
