gpt4 book ai didi

inno-setup - Inno Setup 替换 wpFinished 页面上的按钮

转载 作者:行者123 更新时间:2023-12-04 04:36:58 44 4
gpt4 key购买 nike

我正在尝试覆盖 wpFinished 页面上的下一步/取消按钮 - NextButton 应该显示下载的文件并退出安装程序 - 它工作正常但 CancelButton 不执行任何操作 - 它应该使用标准确认关闭安装程序。我想知道标准 inno 事件是否可行,或者我需要编写自己的代码来退出应用程序并显示确认?

function NextButtonClick(CurPage: Integer): Boolean;
begin
if CurPage = wpFinished then begin
ShowDownloadedFile();
end;
Result := True;
end;


procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then begin
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall);
WizardForm.CancelButton.Caption := SetupMessage(msgButtonFinish);
WizardForm.CancelButton.Visible := True;
end;
end;

最佳答案

在这里,但不要在家里做这个 child :-)

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[Code]
procedure ExitProcess(uExitCode: UINT);
external 'ExitProcess@kernel32.dll stdcall';

function NextButtonClick(CurPage: Integer): Boolean;
begin
Result := True;
// if the fake Finish button was clicked...
if CurPage = wpFinished then
MsgBox('Welcome to the next installation!', mbInformation, MB_OK);
end;

procedure CancelButtonClickFinishedPage(Sender: TObject);
begin
// display the "Exit Setup ?" message box and if the user selects "Yes",
// then exit the process; it is currently the only way how to exit setup
// process manually
if ExitSetupMsgBox then
ExitProcess(0);
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpFinished then
begin
WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall);
WizardForm.CancelButton.Caption := SetupMessage(msgButtonFinish);
WizardForm.CancelButton.Visible := True;
// bind your own OnClick event for the Cancel button; the original one
// is already disconnected at this stage
WizardForm.CancelButton.OnClick := @CancelButtonClickFinishedPage;
end;
end;

关于inno-setup - Inno Setup 替换 wpFinished 页面上的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19584906/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com