[fpc-pascal] creating a standalone executable (eg: application installation file)
Andreas Schneider
aksdb at gmx.de
Tue Jan 12 13:59:39 CET 2010
Hi,
that works the same as in Windows and can probably be done with every
executable format. Simply append the data to the end of the file and store the
offset or length of that data at the end. All you have to do then is to let
the program open "itself" (ParamStr(0)), seek to the end - SizeOf(Integer),
read that integer to know the offset of the data, seek to that position, and
read all you need from there. So essentially your file looks like:
<original executable><install data><data offset>
(Of course you can also include the data offset "hardcoded" into the
executable, but that's a bit harder to manage ... first compile to know the
exe size, then change the constant storing that size, and recompile again ...)
Best regards,
Andreas.
Am Dienstag 12 Januar 2010 13:37:26 schrieb Graeme Geldenhuys:
> Hi,
>
> I have seen a few Linux application that have standalone executables
> that are installation programs. Once run, it installs the application
> in the appropriate directory location, can run as root or normal user
> and creates a desktop and Application menu icon. Similar to Windows's
> setup.exe idea. An example of such a Linux application is
> 'installpixel32' from the Pixel32 project, or Kylix 3 installation.
>
> * How does one create such a standalone application?
> * How do you include the application executable and other resources
> (text, image, sound files etc) inside such an installation executable?
>
>
> I'm trying to create (mainly for our company, but probably open-source
> in the end) such a standalone setup creation for our projects. This
> way it will be Linux distro independent. I also don't want to go the
> route of projects like AutoPackage that first requires a setup runtime
> to be installed. I want a installation file like what Pixel32 did. One
> installation executable without any installation runtime etc. and
> after the installation, I can simply click on 'uninstall' or run
> 'setup -u' and a graphical uninstaller is launched.
>
> I'm going to look at Loki Games's setup program to see if I can port
> it to fpGUI Toolkit, or at least get some ideas of how to create such
> a setup application. Basically I'm trying to create a "InstallShield
> Lite" but for Linux. :-) The nice thing of Loki Games is that it run
> run as a console installation or a GUI installation - again, no idea
> how they managed that, but it was possible (Kylix 3 installation did
> that).
>
> Anybody have pointers or internet links I can read up on the subject?
>
More information about the fpc-pascal
mailing list