问题描述
我的安装程序设置中包含以下几行
procedure CurPageChanged(CurPageID: Integer);
begin
if IsAdmin then
WizardForm.SelectDirbrowseLabel.Caption := 'Installation directory:'
else
WizardForm.SelectDirbrowseLabel.Caption := 'Restart installer as Administrator to install {#AppName} system wide.' #13#10 + #13#10 + 'Installation directory:';
end;
问题在于新行中的文本被目录输入框剪切掉,因此它们不可见。
解决方法
我将在编辑框下面添加信息标签:
procedure InitializeWizard();
var
InfoLabel: TNewStaticText;
begin
InfoLabel := TNewStaticText.Create(WizardForm);
InfoLabel.Parent := WizardForm.SelectDirPage;
InfoLabel.Left := WizardForm.SelectDirLabel.Left;
InfoLabel.Top := WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + ScaleY(16);
InfoLabel.Caption :=
'Restart installer as Administrator to install {#AppName} system wide'
end;
虽然这将是更好的解决方案?
Make Inno Setup installer request privileges elevation only when needed