Hi all!

As all you saw, I posted a tree of things that must be done by a
complete installer.

Eugene Wong recommended me to have a kickstart, as Red Hat, that is, a
script that guide the installer through that tree of things.

Eric Auer said about using a mixture of a text description file and a
standard zip for packages, at least for a starting point.

I suggest using ncurses for designing the installer interface...

Owen Rudge is making an installer for SEAL with TUI and its own package
formate (attached SPI.TXT)

Maybe here are some people making also an installer or for an entire
FreeDOS distro, or for some packages (such as FreeGEM, OpenGEM, SEAL,
etc, etc)... I think that all these people must contribute in making an
only and official installer joining all of our efforts

If any of you have an idea or want to contribute coding (this is the
most needed, because ideas without coders are NOTHING), please reply to
these message.

Regards,
Natasha Portillo

----------
list options/archives/etc.: http://www.topica.com/lists/fd-dev
unsubscribe: send blank email to: [EMAIL PROTECTED]

==^================================================================
This email was sent to: [email protected]

EASY UNSUBSCRIBE click here: http://topica.com/u/?bz8Rv5.bbRv4l.YXJjaGl2
Or send an email to: [EMAIL PROTECTED]

T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================
SPI File Format
Version 1.0

Copyright (c) Owen Rudge 2002. All Rights Reserved.
---------------------------------------------------

This file refers to version 1.0 of the SPI file format. THIS IS A PRELIMENTARY 
DOCUMENT. THE
FILE FORMAT MAY CHANGE BETWEEN NOW AND THE OFFICIAL RELEASE OF SPI 1.0.

The SPI (SEAL Package Installation) file format is detailed in the following document.
Please note that in this document, a char is one byte long, a short is two bytes long, 
and
both an int and a long are four bytes long. A long long uses eight bytes. All numbers 
are
written using Intel byte order, ie, little-endian. All strings should use the Latin-1 
codepage.

SPI supports long filenames, but you should be careful in using them as many SEAL 
installations
would not be running under Windows and would not have a long filename driver loaded.

This document was last updated on 2nd June 2002.

TABLE OF CONTENTS
-----------------

1. Main Header
2. Directories and Files
3. Registry Entries
4. INI File Modifications
5. Shortcut Creation (for Programs menu)
6. Conclusion

Main Header
-----------

At the start of a SPI file, you have the main header. This is as follows:

char compress_magic[4];     // Allegro packfile compression header

typedef struct
{
   char hdr[3];                // Header: "SPI"
   unsigned char major;        // Major version of SPI required
   unsigned char minor;        // Minor version of SPI required
   unsigned char revision;     // Revision of SPI required
} SPI_MAINHEADER;

If compress_magic is set to 0x736C6821L ("!hls"), the file is packed using Allegro's 
compression
routines. This means that every file operation uses the pack_* functions. Even 
zlib-compressed
data is written using the Allegro packing routines. The use of the Allegro compression 
routines
can significantly reduce the size of SPI files that contains many files, registry 
entries,
directories and so on, as the various structures are then compressed too.

If compress_magic is set to 0x736C682EL (".hls"), the file is not packed, and the usual
fopen, fread, fwrite, etc, functions can be used to read the file.

Directories and Files
---------------------

After the main header, you will find the Directory Header. This consists of an 
unsigned integer
value specifying how many directories will need to be created by the installation, and 
then a
number of SPI_DIRECTORYHEADER structures:

typedef struct
{
   char dirname[200];           // Directory name, up to 200 chars in length (8.3 if 
no LFNs)
   char path[200];              // Directory that dirname should be created in, 
relative to base
   unsigned short path_base;    // Path 'base' - see below
} SPI_DIRECTORYHEADER;

This is followed by an unsigned integer value specifying how many files there are in 
the SPI
package. This is then followed by a File Header for each file:

typedef struct
{
   char filename[200];          // Filename, up to 200 characters in length (8.3 if no 
LFNs)
   char path[200];              // Path file should be extracted to, relative to 
path_base
   unsigned short path_base;    // Path 'base' - see below

   unsigned char day;           // Day to set file date to
   unsigned char month;         // Month to set file date to
   unsigned short year;         // Year to set file date to

   unsigned char hour;          // Hour to set file date to
   unsigned char minute;        // Minute to set file date to
   unsigned char second;        // Second to set file date to

   unsigned char attributes;    // File attributes - see below

   unsigned long filesize;      // Size of uncompressed file
   unsigned long filesize_comp; // Size of compressed data
} SPI_FILEHEADER;

The File Header is followed by the compressed data. The data is compressed using the 
zlib
compress() function, and should be decompressed with the zlib uncompress() function.

path_base should be set to one of the following constants:

#define SPI_ROOT             0    // Root directory (/)
#define SPI_SEAL_DIR         1    // SEAL base directory (/system/ in VFS)
#define SPI_SEAL_DOCS_DIR    2    // Documents directory (/documents/ in VFS, or 
/system/docs/)
#define SPI_SEAL_FONTS_DIR   3    // Fonts directory (/system/fonts/)
#define SPI_SEAL_APPS_DIR    4    // Applications directory (/programs/ in VFS, or 
/system/apps/)
#define SPI_SEAL_LIBS_DIR    5    // Libraries directory (/system/libs/)
#define SPI_SEAL_SKIN_DIR    6    // Skin directory (/system/skin/)
#define SPI_SEAL_HELP_DIR    7    // Help directory (/system/help/)
#define SPI_APPLICATION_DIR  8    // Application directory specified by user
#define SPI_DRIVE_C          100  // C:\ (or /c/ in VFS)
#define SPI_DRIVE_D          101  // D:\ (or /d/ in VFS)
#define SPI_DRIVE_E          102  // E:\ (or /e/ in VFS)
#define SPI_DRIVE_F          103  // F:\ (or /f/ in VFS)
#define SPI_DRIVE_G          104  // G:\ (or /g/ in VFS)
#define SPI_DRIVE_H          105  // H:\ (or /h/ in VFS)
#define SPI_DRIVE_I          106  // I:\ (or /i/ in VFS)
#define SPI_DRIVE_J          107  // J:\ (or /j/ in VFS)
#define SPI_DRIVE_K          108  // K:\ (or /k/ in VFS)
#define SPI_DRIVE_L          109  // L:\ (or /l/ in VFS)
#define SPI_DRIVE_M          110  // M:\ (or /m/ in VFS)
#define SPI_DRIVE_N          111  // N:\ (or /n/ in VFS)
#define SPI_DRIVE_O          112  // O:\ (or /o/ in VFS)
#define SPI_DRIVE_P          113  // P:\ (or /p/ in VFS)
#define SPI_DRIVE_Q          114  // Q:\ (or /q/ in VFS)
#define SPI_DRIVE_R          115  // R:\ (or /r/ in VFS)
#define SPI_DRIVE_S          116  // S:\ (or /s/ in VFS)
#define SPI_DRIVE_T          117  // T:\ (or /t/ in VFS)
#define SPI_DRIVE_U          118  // U:\ (or /u/ in VFS)
#define SPI_DRIVE_V          119  // V:\ (or /v/ in VFS)
#define SPI_DRIVE_W          120  // W:\ (or /w/ in VFS)
#define SPI_DRIVE_X          121  // X:\ (or /x/ in VFS)
#define SPI_DRIVE_Y          122  // Y:\ (or /y/ in VFS)
#define SPI_DRIVE_Z          123  // Z:\ (or /z/ in VFS)

At the moment, no other constants are defined. You are not limited to installing in 
the above
directories however - you can install into sub-directories of them by setting the path 
value in
the SPI_FILEHEADER structure. It is not recommended to directly install into drives 
C-Z - you
should ask the user for a directory or use the SEAL system directories.

The file attributes is a variable made up of the following bits, which are included in 
IO.H in
DJGPP:

#define FA_NORMAL   0x00        // Normal file, no attributes
#define FA_RDONLY   0x01        // Read only attribute
#define FA_HIDDEN   0x02        // Hidden file
#define FA_SYSTEM   0x04        // System file
#define FA_LABEL    0x08        // Volume label
#define FA_DIREC    0x10        // Directory
#define FA_ARCH     0x20        // Archive

You should not use the FA_LABEL or FA_DIREC constants with files.

Registry Entries
----------------

Next in the SPI file comes an unsigned integer specifying the number of registry 
entries to be
created as part of the Setup process. Following this are a number of SPI_REGISTRYENTRY
structures, as follows:

typedef struct
{
   char keyname[200];              // The name of the key to create
   char parentkey[200];            // The "path" to the parent key

   unsigned char link;             // 1 if key is a link, 0 otherwise
   char linkkey[200];              // The key that the created key should link to, if 
applicable

   unsigned char datatype;         // The type of the data - see below
   char keydata[200];              // The data of the key, if text

   union
   {
      unsigned char keydata_byte;  // Data of key if byte
      short keydata_small;         // Data of key if small
      long keydata_integer;        // Data of key if integer
      long long keydata_big;       // Data of key if big
      float keydata_float;         // Data of key if float
   };
} SPI_REGISTRYENTRY;

The SPI installer looks for the following items in the keydata variable and if found, 
replaces
them with other strings:

 Value               Replacement
 --------------------------------------------------------------------------------------
 %APPDIR%            Application directory, including trailing slash (eg, 
/programs/myapp/)
 %SEALDIR%           SEAL system directory (usually, if not always, /system/)
 %LIBSDIR%           SEAL libraries directory (usually /system/libs/)
 %HELPDIR%           SEAL help directory (usually /system/help/)
 %SKINDIR%           SEAL skin directory (usually /system/skin/)
 %FONTDIR%           SEAL fonts directory (usually /system/fonts/)

The datatype variable is one of the following constants:

#define SPI_REGKEY_BYTE      1    // Key data is in the form of a byte
#define SPI_REGKEY_SMALL     2    // Key data is in the form of a short integer
#define SPI_REGKEY_INTEGER   3    // Key data is in the form of an integer
#define SPI_REGKEY_BIG       4    // Key data is in the form of a 64-bit integer
#define SPI_REGKEY_FLOAT     5    // Key data is in the form of a floating-point number
#define SPI_REGKEY_TEXT      6    // Key data is text

The appropriate item in the union is used depending on the value of datatype.

INI File Modifications
----------------------

After the registry entries, you will find an unsigned integer specifying the number of 
INI file
modifications that should be made as part of the Setup process. Following this are a 
number of
SPI_INIMODIFICATION structures, as follows:

typedef struct
{
   char filename[200];             // The filename of the INI file
   char path[200];                 // The path to the INI file, relative to the base
   unsigned short path_base;       // Path 'base' - see "Directories and Files" above

   char section[200];              // The section of the INI to update
   char entry[200];                // The name of the entry to update
   char value[200];                // The value to set the entry to
} SPI_INIMODIFICATION;

Shortcut Creation (for Programs menu)
-------------------------------------

SPI can automatically create shortcuts. Version 1.0 of the SPI installer supports both 
the
Desktop V and Bad Desktop 0.55 systems of links. As Bad Desktop 0.55 supports the 
Desktop V
system, the Desktop V system is what's used, with the exception of folder descriptions 
and
icons - DESKTOP.INF is still used for this.

After the SPI_INIMODIFICATION structures, you will find an unsigned integer specifying 
the
number of shortcut folders to create. Following this value you will find an 
SPI_SHORTCUTITEM
structure for each folder:

typedef struct
{
   char itemname[200];              // The name of the folder/shortcut item
   char friendlyname[200];          // The friendly name written to DESKTOP.INF for 
Bad Desktop
                                    // and/or the shortcut file

   char destpath[200];              // The path to the program/item to be executed (if 
applic.)

   char icon32[200];                // The path to the 32x32 icon (if applicable)
   char icon16[200];                // The path to the 16x16 icon (if applicable)
} SPI_SHORTCUTITEM;

destpath should be set to NULL for shortcut folders - they will be ignored anyway. If 
you don't
want a custom icon, fill icon32 and icon16 with NULL values.

After these structures, you will find another unsigned integer. This specifies the 
number of
shortcut icons to create. After this you will find an SPI_SHORTCUTITEM structure for 
each icon.

The destpath, icon32 and icon16 values support the replaceable variables mentioned 
above in
"Registry Entries".

Conclusion
----------

I hope you find this document useful. Keep an eye on future SPI developments at the 
official
SEAL web site: http://sealsystem.sourceforge.net/.

If you have any queries or problems, please e-mail me at the address below.

Owen Rudge
30th April 2002

Web site: http://www.owenrudge.co.uk/
E-mail:   [EMAIL PROTECTED]

Reply via email to