paradiseo/utilities/trunk/windows/paradiseo_installer_script.iss
legrand 47298125ec added windows dedicated stuff
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@786 331e1502-861f-0410-8da2-ba01fb791d7f
2007-11-15 16:37:06 +00:00

285 lines
9.3 KiB
Text

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define generatorWizardPageIndex= 7
#define launchBuildWizardPageIndex= 12
[Setup]
AppName=ParadisEO
AppVerName=ParadisEO-ix86-1.1
AppPublisher=INRIA Futurs Dolphin Project-team
AppPublisherURL=http://paradiseo.gforge.inria.fr
AppSupportURL=http://paradiseo.gforge.inria.fr
AppUpdatesURL=http://paradiseo.gforge.inria.fr
DefaultDirName={pf}\ParadisEO
DefaultGroupName=ParadisEO
LicenseFile=E:\software\paradisEO\windows installer\LICENSE.txt
InfoBeforeFile=E:\software\paradisEO\windows installer\INSTRUCTIONS.txt
InfoAfterFile=E:\software\paradisEO\windows installer\FINAL_INSTRUCTIONS.txt
OutputDir=E:\software\paradisEO\windows installer\compiler output
OutputBaseFilename=paradiseo-1.0-win32-installer
Compression=lzma
SolidCompression=yes
WizardImageFile=E:\software\paradisEO\img\paradisEO.bmp
UninstallDisplayName=ParadisEO
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
;---------------------------------------------------------------------------------------------------------------------------------
[Types]
Name: "full"; Description: "Full installation"
Name: "custom"; Description: "Custom installation"; Flags: iscustom
[Components]
Name: "eo"; Description: "EO: Evolving Objects: Library for evolutionnary computation"; Types: full custom; Flags: fixed
Name: "mo"; Description: "MO: Moving Objects: Single based mateheuristics computation"; Types: full custom ; Flags: checkablealone
Name: "mo\doc"; Description: "Documentation (html, latex, man)"; Types: full custom; Flags: dontinheritcheck
Name: "mo\tutorial"; Description: "Ready-to-use tutorials"; Types: full custom; Flags: dontinheritcheck
Name: "moeo"; Description: "MOEO: Multi Objective Evolving Objects"; Types: full ; Flags: checkablealone
Name: "moeo\doc"; Description: "Documentation (html, latex, man)"; Types: full custom; Flags: dontinheritcheck
Name: "moeo\tutorial"; Description: "Ready-to-use tutorials"; Types: full custom; Flags: dontinheritcheck
;---------------------------------------------------------------------------------------------------------------------------------
[Files]
Source: "E:\software\paradisEO\windows installer\files\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
// Source: "E:\software\paradisEO\windows installer\files\generator.config"; DestDir: "{app}"; AfterInstall: LaunchBuildProcess() ;
[Icons]
Name: "{group}\ParadisEO"; Filename: "{app}\genParadisEOSol.bat"
Name: "{commondesktop}\ParadisEO"; Filename: "{app}\genParadisEOSol.bat"; Tasks: desktopicon
[Run]
Filename: "{app}\genParadisEOSol.bat"; Description: "{cm:LaunchProgram, Lancer la compilation}"; Flags: nowait postinstall skipifsilent
[Code]
var
GeneratorPage: TWizardPage;
BuildProcessPage: TWizardPage;
ProgressPage: TOutputProgressWizardPage;
GeneratorBox: TNewCheckListBox;
Generator: String;
ProgressBarLabel: TLabel;
ProgressBar: TNewProgressBar;
procedure SetCmakeGenerator();
begin
if GeneratorBox.Checked[1] then
begin
Generator:='Visual Studio 8 2005' ;
exit;
end;
if GeneratorBox.Checked[2] then
begin
Generator:='Visual Studio 7 .NET 2003' ;
exit;
end;
if GeneratorBox.Checked[3] then
begin
Generator:='NMake' ;
exit;
end;
if GeneratorBox.Checked[4] then
begin
Generator:='MinGW' ;
exit;
end;
if GeneratorBox.Checked[5] then
begin
Generator:='Borland' ;
exit;
end;
if GeneratorBox.Checked[6] then
begin
Generator:='MSYS' ;
exit;
end;
if GeneratorBox.Checked[7] then
begin
Generator:='WMake' ;
exit;
end;
end;
procedure onErrorMsg(ErrorCode: Integer);
begin
MsgBox('An error has occured. Impossible to complete the install', mbError, mb_Ok);
exit;
end;
procedure LaunchBuildProcess();
var
ErrorCode: Integer;
FilePath: String;
begin
// Need the app path
FilePath := ExpandConstant('{app}');
// Set the Cmake generator
SetCmakeGenerator();
// launch CMake for EO
if not ShellExec('open', 'cmake.exe', ' ..\' + ' -G"' + Generator + '"', FilePath +'\paradiseo-eo\build', SW_SHOWNORMAL, ewWaitUntilTerminated, ErrorCode) then
begin
onErrorMsg(ErrorCode);
end;
// launch CMake for MO
if not ShellExec('open', 'cmake.exe', ' ..\' + ' -G"' + Generator + '"', FilePath +'\paradiseo-mo\build', SW_SHOWNORMAL, ewWaitUntilTerminated, ErrorCode) then
begin
onErrorMsg(ErrorCode);
end;
// launch CMake for MOEO
if not ShellExec('open', 'cmake.exe', ' ..\' + ' -G"' + Generator + '"' + ' -Dconfig=' + FilePath + '\install.cmake', FilePath +'\paradiseo-moeo\build', 0, ewWaitUntilTerminated, ErrorCode) then
begin
onErrorMsg(ErrorCode);
end;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
{ Skip pages that shouldn't be shown }
if (PageID = BuildProcessPage.ID) then
Result := False
else
Result := False;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
var
I: Integer;
begin
if CurPageID = BuildProcessPage.ID then begin
MsgBox('Arrived in build wizard page', mbError, mb_Ok);
ProgressPage.SetText('Launching CMake build process...', '');
ProgressPage.SetProgress(0, 0);
ProgressPage.Show;
try
for I := 0 to 10 do begin
ProgressPage.SetProgress(I, 10);
Sleep(100);
end;
finally
ProgressPage.Hide;
end;
end
Result := True;
end;
procedure CreateTheWizardPages;
begin
GeneratorPage := CreateCustomPage({#generatorWizardPageIndex}, 'ParadisEO can be compiled using several generators.', '');
GeneratorBox := TNewCheckListBox.Create(GeneratorPage);
GeneratorBox.Top := ScaleY(15);
GeneratorBox.Width := GeneratorPage.SurfaceWidth;
GeneratorBox.Height := ScaleY(200);
GeneratorBox.BorderStyle := bsNone;
GeneratorBox.ParentColor := True;
GeneratorBox.MinItemHeight := WizardForm.TasksList.MinItemHeight;
GeneratorBox.ShowLines := False;
GeneratorBox.WantTabs := True;
GeneratorBox.Parent := GeneratorPage.Surface;
GeneratorBox.AddGroup('Select the program that will be used to compile:', '', 0, nil);
GeneratorBox.AddRadioButton('Visual Studio 8 2005', '', 0, True, True, nil);
GeneratorBox.AddRadioButton('Visual Studio 7 .NET 2003', '', 0, False, True, nil);
GeneratorBox.AddRadioButton('NMake', '', 0, False, True, nil);
GeneratorBox.AddRadioButton('MinGW', '', 0, False, True, nil);
GeneratorBox.AddRadioButton('Borland', '', 0, False, True, nil);
GeneratorBox.AddRadioButton('MSYS', '', 0, False, True, nil);
GeneratorBox.AddRadioButton('WMake', '', 0, False, True, nil);
BuildProcessPage := CreateCustomPage({#launchBuildWizardPageIndex}, 'Generate CMake files', 'Build process');
Lbl := TLabel.Create(BuildProcessPage);
Lbl.Top := Memo.Top + Memo.Height + ScaleY(8);
Lbl.Caption := 'TLabel';
Lbl.AutoSize := True;
Lbl.Parent := Page.Surface;
ProgressPage := CreateOutputProgressPage('Build process',
'Generating the configuration files...');
end;
procedure AboutButtonOnClick(Sender: TObject);
begin
MsgBox('ParadisEO: An INRIA Dolphin Team project - 2007 ', mbInformation, mb_Ok);
end;
procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://paradiseo.gforge.inria.fr', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
procedure InitializeWizard();
var
AboutButton, CancelButton: TButton;
URLLabel: TNewStaticText;
BackgroundBitmapImage: TBitmapImage;
BackgroundBitmapText: TNewStaticText;
begin
CreateTheWizardPages;
CancelButton := WizardForm.CancelButton;
AboutButton := TButton.Create(WizardForm);
AboutButton.Left := WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width - ScaleX(5);
AboutButton.Top := CancelButton.Top;
AboutButton.Width := CancelButton.Width;
AboutButton.Height := CancelButton.Height;
AboutButton.Caption := '&About...';
AboutButton.OnClick := @AboutButtonOnClick;
AboutButton.Parent := WizardForm;
URLLabel := TNewStaticText.Create(WizardForm);
URLLabel.Caption := 'http://paradiseo.gforge.inria.fr';
URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := WizardForm;
{ Alter Font *after* setting Parent so the correct defaults are inherited first }
URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
URLLabel.Font.Color := clBlue;
URLLabel.Top := AboutButton.Top + AboutButton.Height - URLLabel.Height - 2;
URLLabel.Left := AboutButton.Left + AboutButton.Width + ScaleX(10);
end;
procedure DeinitializeSetup();
begin
end;
[UninstallDelete]
Type: files; Name: "{app}\*"
Type: filesandordirs; Name: "{app}\*"