[fpc-pascal] creating a standalone executable (eg: application installation file)

Rainer Stratmann RainerStratmann at t-online.de
Tue Jan 12 14:34:52 CET 2010


Am Tuesday 12 January 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?
>
A similar question I posted already (23.03.2009 15:37)
   
The simplest way would be like this:

// include binary data of the file 'myfile.dat' to the var mydata
{$incdata myfile.dat mydata}

// fpc compiler makes this
const
 mydata : array[ 0 .. filesizeof( myfile.dat ) - 1 ] of byte =
 ( d1, d2, d3, d4, d5, ... , dn );

Easy, and userfriendly.

Rainer



More information about the fpc-pascal mailing list