1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
[Setup]
AppName=AppXXX
AppVerName=AppXXX version 1.9
DefaultDirName={pf}\AppXXX
DefaultGroupName=AppXXX
;AppMutex= // http://www.jrsoftware.org/iskb.php?mutexsessions
UninstallDisplayIcon=IconeApp16x16_xp.ico
AllowNoIcons=yes
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes
;AppModifyPath="{app}\AppXXX-setup.exe" /modify=1
WizardImageFile=compiler:WizModernImage-IS.bmp
WizardSmallImageFile=compiler:WizModernSmallImage-IS.bmp
SetupIconFile=Setup.ico
LanguageDetectionMethod=none
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}
[Files]
Source: AppXXX.exe; DestDir: {app}
Source: Interop.Excel.dll; DestDir: {app}
Source: Interop.Office.dll; DestDir: {app}
Source: Interop.VBIDE.dll; DestDir: {app}
Source: ZedGraph.dll; DestDir: {app}
Source: pays_iso3.csv; DestDir: {app}
Source: dotnetfx.exe; DestDir: {app}\utils
[Icons]
Name: {userdesktop}\AppXXX; Filename: {app}\AppXXX.exe; WorkingDir: {app}; Tasks: desktopicon
Name: {group}\AppXXX; Filename: {app}\AppXXX.exe
[Dirs]
Name: {app}\utils
Name: {app}\don; Flags: uninsalwaysuninstall
[Languages]
Name: en; MessagesFile: compiler:Default.isl
Name: fr; MessagesFile: compiler:Languages\French.isl
[CustomMessages]
fr.PageDotNetTitre=Installation de Microsoft Framework .Net 1.1
fr.PageDotNetInfo=Le Framework .Net 1.1 est un composant obligatoire pour le fonctionnement de AppXXX.
fr.PageDotNetWait=Merci de patientez quelques minutes, le temps de l'installation du composant.
fr.MsgDotNetL1=L'installation du composant Framework .Net a échouée.
fr.MsgDotNetL2=L'installation de AppXXX est interrompue. Si le problème persiste, contacter votre support technique.
en.PageDotNetTitre=Microsoft .Net Framework 1.1 Installation
en.PageDotNetInfo=.Net Framework is mandatory for AppXXX to run
en.PageDotNetWait=Please wait, it may takes a few minutes.
en.MsgDotNetL1=Framework .Net installation failed.
en.MsgDotNetL2=AppXXX installation is aborted, contact your helpdesk if the problem persist.
[UninstallDelete]
Name: {app}; Type: filesandordirs
[INI]
Filename: AppXXX.ini; Section: Default Value; Key: Dir; String: {app}\don
Filename: AppXXX.ini; Section: Default Value; Key: seuilP; String: 0,2
Filename: AppXXX.ini; Section: Default Value; Key: seuilV; String: 5000
;Replacer le crochet ouvrant devant 'Code]'
Code[]
var
frameworkOK: boolean;
exitSetup: boolean;
DotNetPage: TInputQueryWizardPage;
ProgressPage: TOutputProgressWizardPage;
function InitializeSetup(): Boolean;
begin
frameworkOK := True;
exitSetup := False;
Result := True;
end;
procedure InitializeWizard;
begin
{ Create the custom pages }
DotNetPage := CreateInputQueryPage(wpWelcome, ExpandConstant('{cm:PageDotNetTitre}'), '',
ExpandConstant('{cm:PageDotNetInfo}') + #13#13 + ExpandConstant('{cm:PageDotNetWait}') );
ProgressPage := CreateOutputProgressPage(ExpandConstant('{cm:PageDotNetTitre}'), '');
end;
procedure frameworkInstalled();
var
ResultCode: Integer;
begin
// Check for required netfx 1.1 installation
if not RegKeyExists(HKLM, 'Software\Microsoft\.NETFramework\policy\v1.1') then
begin
Exec(ExpandConstant('{tmp}\dotnetfx.exe'), '/q /c:"install /l /q"', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
if ResultCode = 0 then
begin
//Execution réussie
frameworkOK := True;
end else begin
//Execution echouée, ResultCode contient le code d'erreur de l'application
frameworkOK := False;
end;
end;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
case CurPageID of
DotNetPage.ID:
begin
ProgressPage.SetText(ExpandConstant('{cm:PageDotNetWait}'), '');
ProgressPage.SetProgress(1, 100);
ProgressPage.Show;
try
ExtractTemporaryFile('dotnetfx.exe');
ProgressPage.SetProgress(35, 100);
frameworkInstalled();
if not frameworkOK then
begin
exitSetup := True;
end;
ProgressPage.SetProgress(99, 100);
finally
ProgressPage.Hide;
end;
end;
end;
Result := True
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
case PageID of
wpSelectDir:
Result := exitSetup;
wpSelectProgramGroup:
Result := exitSetup;
wpSelectTasks:
Result := exitSetup;
wpReady:
Result := exitSetup;
wpFinished:
Result := exitSetup;
else
Result := False;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
if exitSetup = True then
begin
MsgBox(ExpandConstant('{cm:MsgDotNetL1}') + #13#13 + ExpandConstant('{cm:MsgDotNetL2}'), mbInformation, MB_OK);
Abort();
end;
end;
end; |
Partager