From 00189780a2b0b33ffc140b3da38a17f493edc3a0 Mon Sep 17 00:00:00 2001 From: Thomas Brouard Date: Fri, 9 Dec 2016 11:28:42 +0100 Subject: [PATCH] Extraction de la fonction CheckCloseWord() --- win_setup.iss | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/win_setup.iss b/win_setup.iss index 824459c..d1c7f60 100644 --- a/win_setup.iss +++ b/win_setup.iss @@ -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 @@ -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;