原文 http://zwkufo.blog.163.com/blog/static/25882512010816049549/
在InnoSetup中,我们很容易用 function ShouldSkipPage(CurPage: Integer): Boolean; 来跳过一些页面,但是Welcome Page是无法用这个函数来跳过的。如果一定要实现这样的功能,可以用消息来模拟鼠标按键,参考下面例程:
[Code]
const
WM_LBUTTONDOWN = 513;
WM_LBUTTONUP = 514;
procedure InitializeWizard();
begin
if (Pos('/SP-', UpperCase(GetCmdTail)) > 0) then
begin
PostMessage(WizardForm.NextButton.Handle,WM_LBUTTONDOWN,0,0);
PostMessage(WizardForm.NextButton.Handle,WM_LBUTTONUP,0,0);
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if (Pos('/SP-', UpperCase(GetCmdTail)) > 0) and
(CurPageID = wpSelectComponents) then
WizardForm.BackButton.Visible := False;
end;
或者:方案二:
[Code]
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpWelcome then
WizardForm.NextButton.OnClick(WizardForm);
end;