SEAL Forum Index SEAL
The SEAL Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SPI - SEAL Package Installation

 
Post new topic   Reply to topic    SEAL Forum Index -> Seal 3.0 Development
View previous topic :: View next topic  
Author Message
orudge
Administrator


Joined: 07 Oct 2001
Posts: 1332
Location: United Kingdom

PostPosted: Wed Jun 12, 2002 1:49 pm    Post subject: SPI - SEAL Package Installation Reply with quote

SPI should be an integrated part of Seal 3.0 - it will be the way of installing applications, kind of like Windows Installer is meant to be for recent versions of Windows.

Here is a slightly updated document (it doesn't take the new directory structure into account yet as it hasn't been fully planned yet ):

Code:
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:   orudge@users.sourceforge.net

_________________
Owen Rudge
http://www.owenrudge.net/

Currently Playing (last time I was online, anyway):
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
_xduffy_
Administrator


Joined: 15 Mar 2002
Posts: 894
Location: Sweden

PostPosted: Wed Jun 12, 2002 1:58 pm    Post subject: Reply with quote

This will be very useful if it's ever get implemented
_________________
http://xduffystuff.sourceforge.net/Desktop/
www.xduffy.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
biggyp



Joined: 16 Oct 2001
Posts: 1473
Location: England, United Kingdom

PostPosted: Thu Jun 13, 2002 2:57 am    Post subject: Reply with quote

that spec looks very interesting indeed, it'll be great /when/ it's implemented (got faith in owen)
_________________
http://www.theopencd.org/ - OpenSource for the Masses

Gallery

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
biggyp



Joined: 16 Oct 2001
Posts: 1473
Location: England, United Kingdom

PostPosted: Thu Jun 13, 2002 2:59 am    Post subject: Reply with quote

that spec looks very interesting indeed, it'll be great /when/ it's implemented (got faith in owen)
_________________
http://www.theopencd.org/ - OpenSource for the Masses

Gallery

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
WinstonEwert



Joined: 11 Jun 2002
Posts: 27
Location: Bug Land

PostPosted: Thu Jul 25, 2002 4:34 pm    Post subject: Reply with quote

How about something for an internet address at which seal could check for updates
Back to top
View user's profile Send private message
orudge
Administrator


Joined: 07 Oct 2001
Posts: 1332
Location: United Kingdom

PostPosted: Mon Jul 29, 2002 10:16 am    Post subject: Reply with quote

That's a good idea - I'll add spaces for URLs (eg, update URL, homepage, author e-mail address, etc) at some point soon, when I get back on my main computer.
_________________
Owen Rudge
http://www.owenrudge.net/

Currently Playing (last time I was online, anyway):
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ganesh



Joined: 11 Jul 2002
Posts: 133
Location: Vancouver, BC, CA

PostPosted: Mon Jul 29, 2002 12:34 pm    Post subject: Reply with quote

I am against using a binary file. It will lead to problems later on.

What I want to use is the nested INI files method. Th existing spec is good enough to be implemented as a nested INI.

The code to read nested INI files that was distributed with Preview 3 is real good. And its real fast. At least it doesnt not show up anywhere near the top time consuming functions. (source gprof)

FYI, the top time consuming functions are from the Antialiased rendering engine.

Is anybody writing this thing ? I like writing this kind of thing, so if anybody has done any ground work (atleast the header file) please let me know.
_________________
Ganesh lives @
www.iamganesh.com
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
orudge
Administrator


Joined: 07 Oct 2001
Posts: 1332
Location: United Kingdom

PostPosted: Mon Jul 29, 2002 1:51 pm    Post subject: Reply with quote

The code in that document basically is the header file. I like writing this sort of thing too, and am quite attached to SPI, considering I spent a while drafting a document about it, so I'd quite like to do this when I get the time (hopefully not too far away from now), if you don't mind.

BTW, how exactly do you store binary files in a text file without encoding them (eg, MIME encoding) and making them huge? SPI is meant to be a single install package solution, kind of like the Windows Installer MSI files can be.
_________________
Owen Rudge
http://www.owenrudge.net/

Currently Playing (last time I was online, anyway):
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ganesh



Joined: 11 Jul 2002
Posts: 133
Location: Vancouver, BC, CA

PostPosted: Tue Jul 30, 2002 8:21 am    Post subject: Reply with quote

Header file it is.

Quote:

I am against using a binary file.


didnt complete the sentence. ....for the installer data. Th icon texts, shortcuts, registry entries, et al.. must be in a text file within the binary file. My mistake

So your
Code:


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;


will become

Code:

 /MainHeader/
  major=3
  minor =00
  revision=00


The / is a square bracket.

OK, the spec ( or header ) was distributed with Preview 3 as a doc, It will now be in the include folder.

Ok, no probs. Ill concentrate on other things. You cant install "nothing"
_________________
Ganesh lives @
www.iamganesh.com
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
orudge
Administrator


Joined: 07 Oct 2001
Posts: 1332
Location: United Kingdom

PostPosted: Tue Jul 30, 2002 2:14 pm    Post subject: Reply with quote

Well, the installation script will start as a text file, but the plan is to have a 'compiler' to build the SPI file, which converts the text data into binary data, compresses the files, and generates the finished product.
_________________
Owen Rudge
http://www.owenrudge.net/

Currently Playing (last time I was online, anyway):
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
w_w_n_uk



Joined: 25 Oct 2001
Posts: 177
Location: England, Hemel Hempstead

PostPosted: Mon Sep 02, 2002 4:52 am    Post subject: Reply with quote

well you could make an interface so you select all the options in a window plus the files to include the get the app to find all the files get there file size and name then make a list of them in order eg

help.hlp 1114112
app.sxl 690176
reg.dat 690176
then write the files to a single file eg app.spi in the order of the list then you write the file data at the top eg that list then you put all the
major=3
minor =00
revision=00
stuff at the top as well then compress it that way you have all the data in one file and small.
_________________
leon pegg
W_W_N_UK@YAHOO.CO.UK
When Hell is full, the dead will walk the earth...
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
orudge
Administrator


Joined: 07 Oct 2001
Posts: 1332
Location: United Kingdom

PostPosted: Mon Sep 02, 2002 8:22 am    Post subject: Reply with quote

Well, the way everything is going to be done is set out in the document above!
_________________
Owen Rudge
http://www.owenrudge.net/

Currently Playing (last time I was online, anyway):
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
biggyp



Joined: 16 Oct 2001
Posts: 1473
Location: England, United Kingdom

PostPosted: Fri Sep 06, 2002 2:38 am    Post subject: Reply with quote

sounds like it should be called SealPM or RPM (R)udge (P)ackage (M)anagement :^P

not that the idea sounds familiar or anything

anyhow, once you've finished your PHP project are we gonna see a large chunk of new software from the rudgemeister?
_________________
http://www.theopencd.org/ - OpenSource for the Masses

Gallery

Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
DaNo



Joined: 29 Jun 2002
Posts: 102
Location: The Netherlands

PostPosted: Fri Sep 06, 2002 6:54 am    Post subject: Reply with quote

Quote:
SealPM


Seal Private Messenger Mr Green
_________________
The name is DaNo, and he's got a licence to program in VB, C and Assembly Language.
What more can we say about a living legend?

Programmer of the DaNoOS: http://home.planet.nl/~esch0090
Back to top
View user's profile Send private message Send e-mail MSN Messenger
orudge
Administrator


Joined: 07 Oct 2001
Posts: 1332
Location: United Kingdom

PostPosted: Fri Sep 06, 2002 10:43 am    Post subject: Reply with quote

biggyp wrote:
anyhow, once you've finished your PHP project are we gonna see a large chunk of new software from the rudgemeister?


Not straight away, as I have another small PHP project to do, and then I want to redesign owenrudge.co.uk perhaps and move it to a different server (perhaps to owenrudge.net). But eventually I will get around to doing/finishing all these things I've promised.
_________________
Owen Rudge
http://www.owenrudge.net/

Currently Playing (last time I was online, anyway):
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    SEAL Forum Index -> Seal 3.0 Development All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group