Inno设置 - 如何在自定义卸载页面中创建新的卸载页面?

时间:2017-03-01 14:53:52

标签: inno-setup

我正在使用此代码Custom Uninstall page (not MsgBox)。 (见Fr0sT的答案)。我想通过自定义卸载页面内的新功能禁用原始卸载页面。这可能吗?

1 个答案:

答案 0 :(得分:0)

首先,我认为最好修改标准卸载表单,而不是尝试从头开始实现新表单。

请参阅我对Custom Uninstall page (not MsgBox)的回答。

无论如何,要回答你的问题。是的,通过一些努力,这可能是可能的。

要隐藏主窗口并显示自定义窗口,请执行以下操作:

[Code]

var
  CustomUninstallForm: TSetupForm;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then
  begin
    UninstallProgressForm.Visible := False;
    { Move the hidden form back to the screen }
    { in a hope that eventual error messages will appear on screen }
    UninstallProgressForm.Left := CustomUninstallForm.Left;
    UninstallProgressForm.Top := CustomUninstallForm.Top;
  end;
end;

procedure InitializeUninstallProgressForm();
begin
  { Move the form away, so that it does not briefly flash on the window before the }
  { CurUninstallStepChanged(usUninstall) is called }
  UninstallProgressForm.Left := -1000;
  UninstallProgressForm.Top := -1000;

  { Create a custom form and display it }
  CustomUninstallForm := CreateCustomForm;
  CustomUninstallForm.SetBounds(
    0, 0, UninstallProgressForm.Width, UninstallProgressForm.Height);
  CustomUninstallForm.Position := poScreenCenter;  
  CustomUninstallForm.Show;
end;