Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Commit

Permalink
Extraction de la fonction CheckCloseWord()
Browse files Browse the repository at this point in the history
  • Loading branch information
brrd committed Dec 9, 2016
1 parent 3abda16 commit 0018978
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions win_setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,26 @@ begin
FSWbemLocator := Unassigned;
end;
function InitializeSetup(): Boolean;
function CheckCloseWord(): Boolean;
var
AskCloseWord: Boolean;
KeepAsking: Boolean;
begin
Result := True;
KeepAsking := True;
while (IsAppRunning('winword.exe') and KeepAsking) do
begin
Msg := CustomMessage('PleaseCloseWord');
if MsgBox(Msg, mbConfirmation, MB_OKCANCEL) = IDCANCEL then
begin
KeepAsking := False;
Result := False;
end;
end;
end;
function InitializeSetup(): Boolean;
begin
Log('InitializeSetup called');
// Detection des templates
Result := True;
if WordExists() = False then
Expand All @@ -106,19 +119,6 @@ begin
Result := True;
end;
end;
// Ne pas installer si process winword en cours
if Result then
begin
AskCloseWord := True;
while (IsAppRunning('winword.exe') and AskCloseWord) do
begin
Msg := CustomMessage('PleaseCloseWord');
if MsgBox(Msg, mbConfirmation, MB_OKCANCEL) = IDCANCEL then
begin
AskCloseWord := False;
Result := False;
end;
end;
end;
// Detection processus word en cours
Result := Result and CheckCloseWord();
end;

0 comments on commit 0018978

Please sign in to comment.