我试图在wpPreparing
页面上放置标签以指示在运行新安装之前已卸载现有版本。这是我的代码:
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
UninstallingLabel: TNewStaticText;
intResultCode: Integer;
begin
with UninstallingLabel do
begin
Caption := 'Uninstalling existing version...';
Left := WizardForm.StatusLabel.Left;
Top := WizardForm.StatusLabel.Top;
Parent := wpPreparing.Surface;
end;
if strExistingInstallPath <> '' then
begin
Exec(GetUninstallString, '/verysilent /suppressmsgboxes', '', SW_HIDE,
ewWaitUntilTerminated, intResultCode);
end;
end;
问题是它似乎不喜欢Parent := wpPreparing.Surface
并且编译失败并显示
预期用分号(;)
错误。将标签添加到自定义创建的页面时,此语法有效。为什么在尝试将其添加到时失败wpPreparing
?
该wpPreparing
不是一个对象,它只是一个数值不变。
将WizardForm.PreparingPage
持有的“准备安装”页面的引用。请注意,它TNewNotebookPage
已经是类型,不是TWizardPage
。因此,您可以直接将其用作父项。
另请注意,位于StatusLabel
“安装”页面上。您可能希望将新标签与关联PreparingLabel
。
并且您必须创建UninstallingLabel
。
UninstallingLabel := TNewStaticText.Create(WizardForm);
with UninstallingLabel do
begin
Caption := 'Uninstalling existing version...';
Left := WizardForm.PreparingLabel.Left;
Top := WizardForm.PreparingLabel.Top;
Parent := WizardForm.PreparingPage;
end;
虽然您确实要遮蔽PreparingLabel
(使用它的坐标)。
那如何重用呢?
WizardForm.PreparingLabel.Caption := 'Uninstalling existing version...';
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句