1

当我尝试更改TasksList'sParent时,我得到一个空列表作为结果。

WizardForm.TasksList.Parent := WizardForm.DirEdit.Parent;
WizardForm.TasksList.Top := WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + ScaleY(8);
WizardForm.TasksList.Left := WizardForm.DirEdit.Left;
WizardForm.TasksList.Height := ScaleY(100);
4

1 回答 1

2

另一种解决方案是为任务创建自己的复选框:

[Icons]
Name: "{group}\{#MyAppName1}"; Filename: "{app}\{#MyAppName1}\{#MyAppExeName}"; WorkingDir: "{app}\{#MyAppName1}"; Check: menuicons; Components: G3EE;
Name: "{group}\{#MyAppName2}"; Filename: "{app}\{#MyAppName2}\{#MyAppExeName2}"; WorkingDir: "{app}\{#MyAppName2}"; Check: menuicons; Components: G3ZBEE;
Name: "{commondesktop}\{#MyAppName2}"; Filename: "{app}\{#MyAppName2}\{#MyAppExeName2}"; WorkingDir: "{app}\{#MyAppName2}"; Check: desktopicon; Components: G3ZBEE;
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName2}"; Filename: "{app}\{#MyAppName2}\{#MyAppExeName2}"; WorkingDir: "{app}\{#MyAppName2}"; Check: quicklaunchicon; Components: G3ZBEE;

[Code]
Var
DesktopIconCheckBox: TCheckBox;
StartMenuCheckBox: TCheckBox;
QuickStartCheckBox: TCheckBox;

function desktopicon(): Boolean;
begin
    Result := DesktopIconCheckBox.Checked;
end;

function menuicons(): Boolean;
begin
    Result := StartMenuCheckBox.Checked;
end;

function quicklaunchicon(): Boolean;
begin
  if GetWindowsVersion < $06000000 then  begin
      Result := QuickStartCheckBox.Checked;
  end;
end;

procedure InitializeWizard();
var
  ItemsGap: Integer;
 begin
    ItemsGap := WizardForm.DirBrowseButton.Left - (WizardForm.DirEdit.Left + WizardForm.DirEdit.Width);
    DesktopIconCheckBox := TCheckBox.Create(WizardForm.DirEdit.Owner);
    DesktopIconCheckBox.Visible := true;
    DesktopIconCheckBox.Checked := true;
    StartMenuCheckBox := TCheckBox.Create(WizardForm.DirEdit.Owner);
    StartMenuCheckBox.Visible := true;
    StartMenuCheckBox.Checked := true;
  if GetWindowsVersion < $06000000 then  begin
      QuickStartCheckBox := TCheckBox.Create(WizardForm.DirEdit.Owner);
    QuickStartCheckBox.Visible := true;
      QuickStartCheckBox.Checked := false;  
end;
    if true then
    begin
    DesktopIconCheckBox.Top := WizardForm.DirEdit.Top + WizardForm.DirEdit.Height + ItemsGap / 2;
    DesktopIconCheckBox.Width := WizardForm.DirEdit.Width;
        DesktopIconCheckBox.Caption := ExpandConstant('{cm:CreateDesktopIcon}');
        DesktopIconCheckBox.Parent := WizardForm.DirEdit.Parent;
        StartMenuCheckBox.Top := DesktopIconCheckBox.Top + DesktopIconCheckBox.Height + ItemsGap / 2;
    StartMenuCheckBox.Width := WizardForm.DirEdit.Width;
        StartMenuCheckBox.Caption := ExpandConstant('{cm:MenuStartIcons}');
        StartMenuCheckBox.Parent := WizardForm.DirEdit.Parent;
      if GetWindowsVersion < $06000000 then  begin
            QuickStartCheckBox.Top := StartMenuCheckBox.Top + StartMenuCheckBox.Height + ItemsGap / 2;
        QuickStartCheckBox.Width := WizardForm.DirEdit.Width;
            QuickStartCheckBox.Caption := ExpandConstant('{cm:CreateQuickLaunchIcon}');//SetupMessage(msgNoProgramGroupCheck2);
            QuickStartCheckBox.Parent := WizardForm.DirEdit.Parent;  
      end;
    end;
end;
于 2013-03-01T13:01:33.093 回答