Inno Setup 1.3.26
Copyright (C) 1998-2000 Jordan Russell. All rights reserved.
For conditions of distribution and use, see LICENSE.TXT.

Source code README


1. Intro
========

First I would like to say that the source code is provided for educational
purposes only. Because of its complexity, you probably will not be able to
make any serious modificiations to it. Though I've tried to simplify and
comment the code as much as possible, on lot of it you'll just have to
figure out what it does because I don't have time to thoroughly comment
everything.

I compile Inno Setup with Delphi 2.0 (the original 2.0; I never got the
2.01 update). Although it is compilable in later Delphi versions also, I
still use Delphi 2 because of the significantly smaller code size footprint
of its VCL compared to the later versions. You cannot compile the projects
under Delphi 1.x; 16-bit support has been dropped beginning with Inno Setup
1.3.

If you intend to view or modify Inno Setup's forms, you must install 4
components that Inno Setup uses. The components are named NewBevel,
NewGauge, NewFCtrl, and RichEditViewer, and are located in the Components
directory. If you only want to edit code, then you may skip installation
of the components, and choose "Cancel" when Delphi tells you a class can't
be found.


2. Overview
===========

Inno Setup consists of six projects:

Compil32.dpr - This is the GUI front-end for the compiler. Compil32 does not
do the actual compilation itself; it relegates it to ISCmplr.dll. If the
ISCmplr project is changed, you normally don't need to recompile Compil32
since it's essentially a text editor, and is not affected by internal
changes to the compiler.

ISCmplr.dpr - This is a DLL which is loaded by Compil32 to compile scripts.
The actual compiler code is in Compile.pas. See CompInt.pas for the various
structures and function declarations used to interface to the DLL.

Setup.dpr - This is the actual "Setup" program. It displays the wizard, and
performs all installation-related tasks.

SetupLdr.dpr - This is the "setup loader." It extracts a compressed Setup
program into the user's TEMP directory and runs it from there. It also
displays the "This will install..." message box.

Uninst.dpr - This is the uninstaller. Keep in mind that installations can
append to other installations' uninstall logs, so you should not make
changes to the internal file formats.

RegSvr.dpr - This program is compiled into installations which use the
"restartreplace" flag in the [Files] section along with "regserver" or
"regtypelib". It is used to register DLL/OCXes and type libraries on the
next reboot. This project rarely, if ever, needs to be recompiled.

How do the projects link together?

- ISCmplr, Setup, SetupLdr, and Uninst share the unit Struct.pas. This unit
  contains various data structures and constants shared by the projects. If
  Struct.pas is changed, you usually will need to recompile ISCmplr, Setup,
  and SetupLdr so that everything is in synch. Uninst may also need to be
  recompiled in some cases.

- Setup and Uninst share the unit Undo.pas. Undo performs all uninstallation
  tasks. If Undo is changed, normally both Setup and Uninst need to be
  recompiled.

- There are more units which are shared between projects. Search the 'uses'
  clauses of the projects and units if you aren't sure if a project uses a
  particular unit.



3. Delphi 2.0x users ONLY
=========================

Before you can successfully compile the projects in Delphi 2.0, you must 
do two things:

- Install the latest version of SYSTEM.DCU if you haven't already done so.
  It can be downloaded from Inprise's site at:

  http://www.borland.com/devsupport/delphi/downloads/index.html

  Look for "System.zip" in the "Delphi 2 Items" section.

  If you do not do this, you will probably get an "I/O Error" message
  when trying to run the projects.

- Copy the two DCU files from the LIB directory, SHLOBJ.DCU and 
  REGSTR.DCU, to your Delphi\Lib directory *only* if they do not already
  exist. (I believe Delphi 2.01 comes with these already.) 


4. Source code tips
===================

- If you modify one of these project's source code: Setup, SetupLdr, RegSvr,
  or Uninst, and want to be able to compile your installations with it,
  you'll need to copy the new EXE file(s) to the Setup Compiler directory
  under the extension .E32.

- Some of the units in here are shared by more than one of the projects, so
  changes in one project could affect another project. So if you modify one
  of the projects it's a good idea to recompile all of them.

- When debugging the SETUP project you should set UseSetupLdr=0 in your
  script, and copy the resulting SETUP.0, SETUP.1, and SETUP.MSG files to
  the source code directory. This way you can simulate an actual installation
  while running under the Delphi debugger.

- When I release new versions, you can tell which source code files have
  changed by checking their date/time stamps. You can then use a file
  comparison utility such as DOS's "FC" or Microsoft's WinDiff to show the
  differences between an old version of a file and a new version.

- All of the forms in the Setup project, with the exception of Main.dfm, have
  Scaled set to False. This is because they dynamically scale themselves at
  run-time by calling a function named SetFormFont.

- A note for those curious: The Setup Compiler creates single EXE Setups by
  first creating the SETUP.EXE as usual, then concatenating the SETUP.0 and
  SETUP.1 to the end of the SETUP.EXE, and finally modifying an internal data
  block in SETUP.EXE so it knows it's in "single EXE" form.

- Starting with the 32-bit version of Inno Setup 1.12.7, I am using my own
  "StripReloc" utility to decrease the size of COMPIL32.EXE, SETUP.E32,
  SETUPLDR.E32, REGSVR.E32, and UNINST.E32.

  To download StripReloc, go to:
  http://www.jrsoftware.org/striprlc.htm
