2017-02-22 15 views
2

일정 시간이 지나면 "Finished"페이지에서 설치 프로그램을 닫는 방법은 무엇입니까?Inno Setup - 일정 시간이 지난 후 완성 된 설치 프로그램을 닫는 방법?

다음과 같이 해석 할 수도 있습니다. 일정 시간 동안 사용하지 않으면 설치 프로그램을 닫는 방법? (닫기/설치 취소). 이것이 가능한가?

+0

왜 하시겠습니까? –

+0

@MartinPrikryl MessageBoxTimeout과 비슷한 기능을 사용하고 싶습니다. 기본적으로 페이지가 완성되어 일단 설치가 완료되면 완료된 페이지가 잠시 후에 닫힙니다. –

답변

3

"완료되었습니다"페이지가 표시되면 InnoTools InnoCallback 라이브러리를 사용하여 타이머를 설정하십시오.

[Files] 
Source: "InnoCallback.dll"; Flags: dontcopy 

[Code] 

type 
    TTimerProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord); 

function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; 
    external '[email protected] stdcall'; 
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; 
    external '[email protected] stdcall'; 

function WrapTimerProc(Callback: TTimerProc; ParamCount: Integer): LongWord; 
    external '[email protected]:InnoCallback.dll stdcall delayload'; 

var 
    PageTimeoutTimer: LongWord; 
    PageTimeout: Integer; 

procedure UpdateFinishButton; 
begin 
    WizardForm.NextButton.Caption := 
    Format(SetupMessage(msgButtonFinish) + ' - %ds', [PageTimeout]); 
end; 

procedure PageTimeoutProc(
    H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord); 
begin 
    if PageTimeout > 1 then 
    begin 
    Dec(PageTimeout); 
    UpdateFinishButton; 
    end 
    else 
    begin 
    WizardForm.NextButton.OnClick(WizardForm.NextButton); 
    end; 
end; 

procedure CurPageChanged(CurPageID: Integer); 
begin 
    if CurPageID = wpFinished then 
    begin 
    PageTimeout := 10; 
    UpdateFinishButton; 
    PageTimeoutTimer := SetTimer(0, 0, 1000, WrapTimerProc(@PageTimeoutProc, 4)); 
    end; 
end; 

function NextButtonClick(CurPageID: Integer): Boolean; 
begin 
    if CurPageID = wpFinished then 
    begin 
    KillTimer(0, PageTimeoutTimer); 
    PageTimeoutTimer := 0; 
    end; 
    Result := True; 
end; 

Timeout of Finished page


관련 질문 :