Installation 只读或禁用灰色任务复选框?

Installation 只读或禁用灰色任务复选框?,installation,inno-setup,pascal,pascalscript,Installation,Inno Setup,Pascal,Pascalscript,我想禁用并设置为灰色,或设置为只读,一些任务复选框,这些复选框在此图像中被选中: 我不是在寻找其他方法,我想让这些任务可见,但让它们的复选框不可勾选,就是这样,用户可以看到将要安装的内容以及默认限制的内容 我的安装脚本如下所示: [Tasks] ; VS Optional Features Name: blend; Description: Blend; GroupDescription: VS Optional Features:; Flags: Unchecked Name: found

我想禁用并设置为灰色,或设置为只读,一些任务复选框,这些复选框在此图像中被选中:

我不是在寻找其他方法,我想让这些任务可见,但让它们的复选框不可勾选,就是这样,用户可以看到将要安装的内容以及默认限制的内容

我的安装脚本如下所示:

[Tasks]

; VS Optional Features
Name: blend; Description: Blend; GroupDescription: VS Optional Features:; Flags: Unchecked
Name: foundationclass; Description: Microsoft Foundation Classes for C++; GroupDescription: VS Optional Features:; Flags: Unchecked
Name: lightswitch; Description: Microsoft LightSwitch; GroupDescription: VS Optional Features:; Flags: Unchecked
Name: officedevelopertools; Description: Microsoft Office Developer Tools; GroupDescription: VS Optional Features:; Flags: Unchecked
Name: sqldatatools; Description: Microsoft SQL Server Data Tools; GroupDescription: VS Optional Features:; Flags: Unchecked
Name: webdevelopertools; Description: Microsoft Web Developer Tools; GroupDescription: VS Optional Features:; Flags: Unchecked
Name: silverlightsdk; Description: SilverLight Developer Kit; GroupDescription: VS Optional Features:; Flags: Unchecked
Name: Win8SDK; Description: Tools For Maintaining Store Apps For Windows 8; GroupDescription: VS Optional Features:; Flags: Unchecked
Name: WindowsPhone80; Description: Windows Phone 8.0 SDK; GroupDescription: VS Optional Features:; Flags: Unchecked

; VS Hidden Features
Name: netfx4; Description: .NET FX 4; GroupDescription: VS Hidden Features:
Name: netfx45; Description: .NET FX 4.5; GroupDescription: VS Hidden Features:
Name: bliss; Description: Bliss; GroupDescription: VS Hidden Features:
Name: helpviewer; Description: Microsoft Help Viewer 2.1; GroupDescription: VS Hidden Features:
Name: portablelibrary; Description: Microsoft Portable Library Multi-Targeting Pack; GroupDescription: VS Hidden Features:
Name: report; Description: Microsoft Report Viewer Add-On for Visual Studio 2013; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: silverlight; Description: Microsoft Silverlight 5 SDK; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: sqldac; Description: Microsoft SQL DAC; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: sqldom; Description: Microsoft SQL DOM; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: sqllocaldb; Description: Microsoft SQL Server 2013 Express LocalDB; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: sqlmanagementobjects; Description: Microsoft SQL Server 2013 Management Objects; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: sqlclr; Description: Microsoft SQL Server 2013 System CLR Types; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: sqltran; Description: Microsoft SQL Server 2013 Transact-SQL; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: sqlce; Description: Microsoft SQL Server Compact Edition; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: c_compilers; Description: Microsoft Visual C++ 2013 Compilers; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: c_core; Description: Microsoft Visual C++ 2013 Core Libraries; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: c_debug; Description: Microsoft Visual C++ 2013 Debug Runtime; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: c_designtime; Description: Microsoft Visual C++ 2013 Designtime; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: c_extendedlibraries; Description: Microsoft Visual C++ 2013 Extended Libraries; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: intellitrace; Description: Microsoft Visual Studio 2013 IntelliTrace; GroupDescription: VS Hidden Features:
Name: storyboarding; Description: Microsoft Visual Studio Team Foundation Server 2013 Storyboarding; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: sdk3; Description: SDK Tools 3; GroupDescription: VS Hidden Features:
Name: sdk4; Description: SDK Tools 4; GroupDescription: VS Hidden Features:
Name: analytics; Description: Visual Studio Analytics; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: dotfuscator; Description: Visual Studio Dotfuscator; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: javascript; Description: Visual Studio Extensions for Windows Library for JavaScript; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: profiler; Description: Visual Studio Profiler; GroupDescription: VS Hidden Features:; Flags: Unchecked
Name: winsdk; Description: Windows Software Development Kit; GroupDescription: VS Hidden Features:; Flags: Unchecked
这可能实现吗?

另一方面,我在StackOverflow中看到了其他问题,但与只读复选框相关,它使用pascal脚本代码,我不是pascal脚本代码,我不确定这是否是我需要做的,因为我没有在表单中手动创建和实例化复选框,我的意思是,我对那些复选框+标签没有任何控制权,我只是在
Task
部分添加任务

更新

我正在使用下面的pascal脚本代码来禁用所需的项,但是当我运行安装程序时,我得到了这个错误,它说索引超出了范围,为什么?我正在使用正确的chekbox索引,并且我已经在结果任务页中验证了索引。。。我认为问题在于wpSelectTasks,它是一个集成常量?无论如何,我试图用tasks页面的页码指定一个常量,但仍然得到相同的错误,当我使用“下一步”按钮(而不是“上一步”)更改所选页面时,会发生错误:

我有更多的UI自定义代码,我不知道是否有什么东西与其他过程冲突,整个
[code]
部分如下:

[Code]





// Disable Tasks

procedure CurPageChanged(CurPageID: Integer);
begin

  // if we have entered the tasks selection page, disable the specified Tasks.
  if CurPageID = wpSelectTasks then
    WizardForm.TasksList.ItemEnabled[11] := False;
    WizardForm.TasksList.ItemEnabled[12] := False;
    WizardForm.TasksList.ItemEnabled[13] := False;
    WizardForm.TasksList.ItemEnabled[14] := False;
    WizardForm.TasksList.ItemEnabled[15] := False;
    WizardForm.TasksList.ItemEnabled[30] := False;
    WizardForm.TasksList.ItemEnabled[32] := False;
    WizardForm.TasksList.ItemEnabled[33] := False;

end;

// Disable Tasks - END





// Installer UI Customizations

const
  Custom_Height = 570;
  Page_Color = $7b2b68;
  Page_Color_Alternative1 = clblack;
  Page_Color_Alternative2 = clwhite;
  Font_Color = $fffbff;


var
  DefaultTop,
  DefaultLeft,
  DefaultHeight,
  DefaultBackTop,
  DefaultNextTop,
  DefaultCancelTop,
  DefaultBevelTop,
  DefaultOuterHeight: Integer;


procedure InitializeWizard();

begin


  DefaultTop := WizardForm.Top;
  DefaultLeft := WizardForm.Left;
  DefaultHeight := WizardForm.Height;
  DefaultBackTop := WizardForm.BackButton.Top;
  DefaultNextTop := WizardForm.NextButton.Top;
  DefaultCancelTop := WizardForm.CancelButton.Top;
  DefaultBevelTop := WizardForm.Bevel.Top;
  DefaultOuterHeight := WizardForm.OuterNotebook.Height;


// Page sizes
  WizardForm.Height := Custom_Height;
  WizardForm.InnerPage.Height := WizardForm.InnerPage.Height + (Custom_Height - DefaultHeight);
  WizardForm.LicensePage.Height := WizardForm.LicensePage.Height + (Custom_Height - DefaultHeight);


// Control locations
  WizardForm.BackButton.Top := DefaultBackTop + (Custom_Height - DefaultHeight);
  WizardForm.Bevel.Top := DefaultBevelTop + (Custom_Height - DefaultHeight);
  WizardForm.CancelButton.Top := DefaultCancelTop + (Custom_Height - DefaultHeight);
  WizardForm.LicenseAcceptedRadio.Top := WizardForm.LicenseAcceptedRadio.Top + (Custom_Height - DefaultHeight);
  WizardForm.LicenseNotAcceptedRadio.Top := WizardForm.LicenseNotAcceptedRadio.Top + (Custom_Height - DefaultHeight);
  WizardForm.NextButton.Top := DefaultNextTop + (Custom_Height - DefaultHeight);
  WizardForm.Top := DefaultTop - (Custom_Height - DefaultHeight) div 2;


// Control Sizes
  WizardForm.InfoBeforeMemo.Height := (Custom_Height - (DefaultHeight / 2));
  WizardForm.InnerNotebook.Height :=  WizardForm.InnerNotebook.Height + (Custom_Height - DefaultHeight);
  WizardForm.LicenseMemo.Height := WizardForm.LicenseMemo.Height + (Custom_Height - DefaultHeight);
  WizardForm.OuterNotebook.Height := WizardForm.OuterNotebook.Height + (Custom_Height - DefaultHeight);
  WizardForm.Taskslist.Height := (Custom_Height - (DefaultHeight / 2));
  WizardForm.WizardBitmapImage.Height := (Custom_Height - (DefaultHeight / 5));


// Page colos
  WizardForm.color := Page_Color_Alternative1;
  WizardForm.FinishedPage.Color  := Page_Color;
  WizardForm.InfoBeforeMemo.Color := clGray;
  WizardForm.InnerPage.Color := Page_Color;
  WizardForm.LicensePage.Color := Page_Color;
  WizardForm.MainPanel.Color := Page_Color;
  WizardForm.SelectComponentsPage.Color  := Page_Color;
  WizardForm.SelectDirPage.Color  := Page_Color;
  WizardForm.Taskslist.Color := Page_Color;
  WizardForm.WelcomePage.color := Page_Color;


// Font colors
  WizardForm.Font.color := Font_Color;
  //WizardForm.InfoBeforeMemo.font.Color  := Font_Color;
  WizardForm.Licensememo.font.Color  := Font_Color;
  WizardForm.MainPanel.font.Color := Font_Color;
  WizardForm.PageDescriptionLabel.font.color  := Font_Color;
  WizardForm.PageNameLabel.font.color  := Font_Color;
  WizardForm.Taskslist.font.Color  := Font_Color;
  WizardForm.WelcomeLabel1.font.color  := Font_Color;
  WizardForm.WelcomeLabel2.font.color  := Font_Color;


end;

// Installer UI Customizations - END

当前的解决方案由@Tlama在问题中的回答指定。

我能找到的唯一方法(在源代码中)是(在行下)。@Tlama谢谢!现在,我可以禁用指定的项,但由于此代码,我出现了一个错误,您能看到我的问题更新吗?好的,if块需要一个begin/end操作符,这种语言很奇怪,因为我看到其他没有begin/end的if块似乎可以工作@TLama请随时发布答案,将其标记为已接受,谢谢again@ElektroStudios我认为写索引号应该是[9]、[10]、[11]、[12]、[13]、[28]、[30]、[31](根据图片)。第一个索引以[0]开头。这就是它导致“列表索引越界”的原因。
[Code]





// Disable Tasks

procedure CurPageChanged(CurPageID: Integer);
begin

  // if we have entered the tasks selection page, disable the specified Tasks.
  if CurPageID = wpSelectTasks then
    WizardForm.TasksList.ItemEnabled[11] := False;
    WizardForm.TasksList.ItemEnabled[12] := False;
    WizardForm.TasksList.ItemEnabled[13] := False;
    WizardForm.TasksList.ItemEnabled[14] := False;
    WizardForm.TasksList.ItemEnabled[15] := False;
    WizardForm.TasksList.ItemEnabled[30] := False;
    WizardForm.TasksList.ItemEnabled[32] := False;
    WizardForm.TasksList.ItemEnabled[33] := False;

end;

// Disable Tasks - END





// Installer UI Customizations

const
  Custom_Height = 570;
  Page_Color = $7b2b68;
  Page_Color_Alternative1 = clblack;
  Page_Color_Alternative2 = clwhite;
  Font_Color = $fffbff;


var
  DefaultTop,
  DefaultLeft,
  DefaultHeight,
  DefaultBackTop,
  DefaultNextTop,
  DefaultCancelTop,
  DefaultBevelTop,
  DefaultOuterHeight: Integer;


procedure InitializeWizard();

begin


  DefaultTop := WizardForm.Top;
  DefaultLeft := WizardForm.Left;
  DefaultHeight := WizardForm.Height;
  DefaultBackTop := WizardForm.BackButton.Top;
  DefaultNextTop := WizardForm.NextButton.Top;
  DefaultCancelTop := WizardForm.CancelButton.Top;
  DefaultBevelTop := WizardForm.Bevel.Top;
  DefaultOuterHeight := WizardForm.OuterNotebook.Height;


// Page sizes
  WizardForm.Height := Custom_Height;
  WizardForm.InnerPage.Height := WizardForm.InnerPage.Height + (Custom_Height - DefaultHeight);
  WizardForm.LicensePage.Height := WizardForm.LicensePage.Height + (Custom_Height - DefaultHeight);


// Control locations
  WizardForm.BackButton.Top := DefaultBackTop + (Custom_Height - DefaultHeight);
  WizardForm.Bevel.Top := DefaultBevelTop + (Custom_Height - DefaultHeight);
  WizardForm.CancelButton.Top := DefaultCancelTop + (Custom_Height - DefaultHeight);
  WizardForm.LicenseAcceptedRadio.Top := WizardForm.LicenseAcceptedRadio.Top + (Custom_Height - DefaultHeight);
  WizardForm.LicenseNotAcceptedRadio.Top := WizardForm.LicenseNotAcceptedRadio.Top + (Custom_Height - DefaultHeight);
  WizardForm.NextButton.Top := DefaultNextTop + (Custom_Height - DefaultHeight);
  WizardForm.Top := DefaultTop - (Custom_Height - DefaultHeight) div 2;


// Control Sizes
  WizardForm.InfoBeforeMemo.Height := (Custom_Height - (DefaultHeight / 2));
  WizardForm.InnerNotebook.Height :=  WizardForm.InnerNotebook.Height + (Custom_Height - DefaultHeight);
  WizardForm.LicenseMemo.Height := WizardForm.LicenseMemo.Height + (Custom_Height - DefaultHeight);
  WizardForm.OuterNotebook.Height := WizardForm.OuterNotebook.Height + (Custom_Height - DefaultHeight);
  WizardForm.Taskslist.Height := (Custom_Height - (DefaultHeight / 2));
  WizardForm.WizardBitmapImage.Height := (Custom_Height - (DefaultHeight / 5));


// Page colos
  WizardForm.color := Page_Color_Alternative1;
  WizardForm.FinishedPage.Color  := Page_Color;
  WizardForm.InfoBeforeMemo.Color := clGray;
  WizardForm.InnerPage.Color := Page_Color;
  WizardForm.LicensePage.Color := Page_Color;
  WizardForm.MainPanel.Color := Page_Color;
  WizardForm.SelectComponentsPage.Color  := Page_Color;
  WizardForm.SelectDirPage.Color  := Page_Color;
  WizardForm.Taskslist.Color := Page_Color;
  WizardForm.WelcomePage.color := Page_Color;


// Font colors
  WizardForm.Font.color := Font_Color;
  //WizardForm.InfoBeforeMemo.font.Color  := Font_Color;
  WizardForm.Licensememo.font.Color  := Font_Color;
  WizardForm.MainPanel.font.Color := Font_Color;
  WizardForm.PageDescriptionLabel.font.color  := Font_Color;
  WizardForm.PageNameLabel.font.color  := Font_Color;
  WizardForm.Taskslist.font.Color  := Font_Color;
  WizardForm.WelcomeLabel1.font.color  := Font_Color;
  WizardForm.WelcomeLabel2.font.color  := Font_Color;


end;

// Installer UI Customizations - END