Commit 741531a4 authored by Tim Peters's avatar Tim Peters

Move to InnoSetup 5.

InnoSetup 4 CAN NO LONGER BE USED.

Besides that there's no future in relying on obsolete
versions of tools, version 5 introduced a vastly easier
way to manage the custom dialog pages Zope wants.  That
allowed getting rid of about 60 lines of inscrutable
Pascal code.  Of course the code that replaces them is also
inscrutable, but there's about 60 fewer lines of it to
torture future generations ;-).
parent ca7e9317
...@@ -24,10 +24,9 @@ Install Microsoft Visual C++ 7.1 (aka Visual Studio .NET 2003). This is ...@@ -24,10 +24,9 @@ Install Microsoft Visual C++ 7.1 (aka Visual Studio .NET 2003). This is
needed to compile Zope's Python C extensions compatible with Python 2.4 needed to compile Zope's Python C extensions compatible with Python 2.4
(and 2.5, when that's released). (and 2.5, when that's released).
Install InnoSetup 4.2 from www.jrsofware.org (into its default location). Install InnoSetup 5.1.5 (or later) from www.jrsoftware.org, into its
Versions earlier than 4.0.11 are known to not work; any 4.2.x release default location. Inno 4.x (or earlier) cannot work: Inno 5 introduced a
or later should be fine. Inno 5.x versions do *not* work (it appears the vastly simpler way to create the custom dialog pages we want.
Inno "custom dialog" mechanism has changed in an incompatible way)
'svn switch' to, or check out, the Zope tag for which an installer is to be 'svn switch' to, or check out, the Zope tag for which an installer is to be
built. built.
......
...@@ -69,175 +69,129 @@ Root: HKLM; Subkey: "Software\Zope Corporation\Zope\<<VERSION>>"; Flags: uninsde ...@@ -69,175 +69,129 @@ Root: HKLM; Subkey: "Software\Zope Corporation\Zope\<<VERSION>>"; Flags: uninsde
[Code] [Code]
var var
PasswordPrompts, PasswordValues: array of String; { custom dialog pages }
PasswordChars: array of char;
Password: string;
DataDirValues: array of String; { for selecting an instance home directory }
DataDir: String; InstanceDirPage: TInputDirWizardPage;
function InitializeSetup(): Boolean; { for specifying the password for the "admin" account }
begin AdminPwdPage: TInputQueryWizardPage;
{ set up password data structures }
SetArrayLength(PasswordPrompts, 2);
PasswordPrompts[0] := 'Password:';
PasswordPrompts[1] := 'Confirm password:';
SetArrayLength(PasswordValues, 2);
PasswordValues[0] := '';
PasswordValues[1] := '';
SetArrayLength(PasswordChars, 2);
PasswordChars[0] := '*';
PasswordChars[1] := '*';
Password := '';
{ set up data dir data structures }
SetArrayLength(DataDirValues, 1);
DataDir := '';
Result := True;
end;
function CollectInstanceDir(): Boolean;
var
Next: Boolean;
DirOk: Boolean;
procedure InitializeWizard;
begin begin
DirOk := True; { The instance directory page follows the standard "select additional
ScriptDlgPageSetSubCaption1('Select where Zope instance files should be installed'); tasks" page. }
ScriptDlgPageSetSubCaption2('Select the folder to which you would like Setup to install Zope "instance" files, then click Next.'); InstanceDirPage := CreateInputDirPage(wpSelectTasks,
'Instance Setup',
if DataDir = '' then DataDir := 'C:\Zope-Instance'; 'Select where Zope instance files should be installed',
if DataDirValues[0] <> '' then DataDirValues[0] := ''; 'Select the folder to which you would like Setup to install ' +
'Zope "instance" files, then click Next.',
{ Ask for a dir until the user has approved one or clicked Back or Cancel } False,
'');
Next:= InputDir(False, DataDirValues[0], DataDir); InstanceDirPage.Add('');
if Next and FileOrDirExists(DataDir) then DirOk := False; { The admin password page follows our instance directory page. }
AdminPwdPage := CreateInputQueryPage(InstanceDirPage.ID,
while Next and not DirOk do begin 'Instance Setup',
if DataDir = '' then begin 'Specify administrator password',
DirOk := False; 'The login name for your Zope administrator ' +
MsgBox(SetupMessage(msgInvalidPath), mbError, MB_OK); 'account is "admin". When you first connect to the Zope ' +
end; 'management interface, you will need to login using the ' +
if FileOrDirExists(DataDir) then begin '"admin" username and the password you specify below.');
DirOk := MsgBox('Directory Exists' #13#13 'The directory ' + AdminPwdPage.Add('Password:', True);
DataDir + ' already exists. Would you like to create ' + AdminPwdPage.Add('Confirm password:', True);
'instance files in that directory anyway?',
mbConfirmation, MB_YESNO) = idYes; { Set default values; use settings from last time when possible. }
end; InstanceDirPage.Values[0] := GetPreviousData('InstanceDir',
if not DirOk then Next := InputDir(False, DataDirValues[0], DataDir); 'C:\Zope-Instance');
end; AdminPwdPage.Values[0] := '';
AdminPwdPage.Values[1] := '';
Result := Next;
end; end;
function CollectPassword(): Boolean; procedure RegisterPreviousData(PreviousDataKey: Integer);
var
Next: Boolean;
gotPassword: Boolean;
begin begin
ScriptDlgPageSetSubCaption1('Specify administrator password'); { Store settings so we can restore them next time. }
ScriptDlgPageSetSubCaption2('The login name for your Zope administrator ' + { Note that we deliberately don't store the admin password across
'account is "admin". When you first connect to the Zope management ' + runs! We want that to vanish when the installer finishes. }
'interface, you will need to login using the "admin" username and ' + SetPreviousData(PreviousDataKey, 'InstanceDir', InstanceDirPage.Values[0]);
'the password you specify below.');
gotPassword := False;
repeat
Next := InputQueryArrayEx(PasswordPrompts, PasswordChars, PasswordValues);
if Next then begin
if PasswordValues[0] = '' then
MsgBox('You must enter an administrator password', mbError, MB_OK)
else if PasswordValues[0] <> PasswordValues[1] then
MsgBox('Please try again -- the passwords don''t match',
mbError, MB_OK)
else begin
gotPassword := True;
Password := PasswordValues[0]
end
end;
until gotPassword or not Next;
Result := Next;
end; end;
function DoInstanceHome(): Boolean; function DoInstanceHome(): Boolean;
var var
S : String; S: String;
begin begin
S := WizardSelectedComponents(False); S := WizardSelectedComponents(False);
Result := Pos('instance', S) <> 0; Result := Pos('instance', S) <> 0;
end; end;
function DoService(): Boolean; function ShouldSkipPage(PageID: Integer): Boolean;
var
S : String;
begin
S := WizardSelectedTasks(False);
Result := Pos('service', S) <> 0;
end;
function DontDoService(): Boolean;
begin begin
Result := not DoService(); { Skip pages that shouldn't be shown. }
if (PageID = InstanceDirPage.ID) or (PageID = AdminPwdPage.ID) then
Result := not DoInstanceHome()
else
Result := False;
end; end;
function ScriptDlgPages(CurPage: Integer; BackClicked: Boolean): Boolean; function NextButtonClick(CurPageID: Integer): Boolean;
var var
Next : Boolean; temp: String;
CurSubPage : Integer;
begin begin
Next:=True; { Validate pages before allowing the user to proceed. }
if ( (not BackClicked and (CurPage = wpSelectTasks)) or (BackClicked and (CurPage = wpReady)) ) Result := True; // innocent until proven guilty
and DoInstanceHome() then begin
if not BackClicked then CurSubPage:=0 else CurSubPage:=1; if CurPageID = InstanceDirPage.ID then begin
temp := InstanceDirPage.Values[0];
ScriptDlgPageOpen(); if temp = '' then begin
ScriptDlgPageSetCaption('Instance Setup'); Result := False;
MsgBox(SetupMessage(msgInvalidPath), mbError, MB_OK);
while (CurSubPage >=0) and (CurSubPage <=1) and not Terminated do begin end
case CurSubPage of else if FileOrDirExists(temp) then begin
0: Next := CollectInstanceDir(); Result := MsgBox('Directory Exists' #13#13 'The directory ' +
1: Next := CollectPassword(); temp + ' already exists. Would you like to create ' +
end; 'instance files in that directory anyway?',
if Next then CurSubPage := CurSubPage +1 else CurSubPage := CurSubPage -1; mbConfirmation, MB_YESNO) = idYes;
end; end
end
if not BackClicked then else if CurPageID = AdminPwdPage.ID then begin
Result := Next temp := AdminPwdPage.Values[0];
else if temp = '' then begin
Result := not Next; Result := False;
ScriptDlgPageClose(not Result); MsgBox('You must enter an administrator password',
end; mbError, MB_OK);
end
Result := Next; else if temp <> AdminPwdPage.Values[1] then begin
Result := False;
MsgBox('Please try again -- the passwords don''t match',
mbError, MB_OK)
end
end
end; end;
function NextButtonClick(CurPage: Integer): Boolean; function DoService(): Boolean;
var
S: String;
begin begin
Result := ScriptDlgPages(CurPage, False); S := WizardSelectedTasks(False);
Result := Pos('service', S) <> 0;
end; end;
function BackButtonClick(CurPage: Integer): Boolean; function DontDoService(): Boolean;
begin begin
Result := ScriptDlgPages(CurPage, True); Result := not DoService();
end; end;
function GetPassword(Default: String): String; function GetPassword(Default: String): String;
begin begin
Result := Password; Result := AdminPwdPage.Values[0];
end; end;
function GetDataDir(Default : String):String; function GetDataDir(Default: String):String;
begin begin
Result := DataDir; Result := InstanceDirPage.Values[0];
end; { GetInstanceDir } end;
function IsAdministrator(): Boolean; function IsAdministrator(): Boolean;
begin begin
Result := IsAdminLoggedOn(); Result := IsAdminLoggedOn();
end; end;
...@@ -39,7 +39,7 @@ TOUCH=touch ...@@ -39,7 +39,7 @@ TOUCH=touch
NMAKE=nmake NMAKE=nmake
CSCRIPT=cscript CSCRIPT=cscript
ECHO=echo ECHO=echo
ISS_DIR=$(CYGROOT)/Progra~1/Inno Setup 4 ISS_DIR=$(CYGROOT)/Progra~1/Inno Setup 5
ISS_COMPILER=$(ISS_DIR)/Compil32.exe ISS_COMPILER=$(ISS_DIR)/Compil32.exe
# We need a version that understands cygwin paths, so /bin/ # We need a version that understands cygwin paths, so /bin/
UNZIP=/bin/unzip UNZIP=/bin/unzip
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment