innosetup创建自定义窗体

在封装CAD插件的过程中,需要创建一个对话框,让用户选择需要安装到哪些CAD版本

// 创建自定义窗体
procedure CreateAddonPage;
begin
  myPage := CreateCustomPage(wpInfoBefore, '选择需要安装的CAD版本', '请根据您的需要选择安装的CAD版本,本程序仅支持64位中文版AutoCAD2015-2020!'); 
 
  CheckBox20 := TCheckBox.Create(myPage);
  CheckBox20.Parent := myPage.Surface;
  CheckBox20.Left := ScaleX(10);
  CheckBox20.Top := ScaleY(20);
  CheckBox20.Width := ScaleX(300);
  CheckBox20.Caption := 'AutoCAD 2020';
  CheckBox20.Enabled := ACADVersionExists('R23.1', 'ACAD-3001:804'); 
         
  CheckBox19 := TCheckBox.Create(myPage);
  CheckBox19.Parent := myPage.Surface;
  CheckBox19.Left :=CheckBox20.Left;
  CheckBox19.Top := CheckBox20.Top + ScaleY(30);
  CheckBox19.Width := ScaleX(300);
  CheckBox19.Caption := 'AutoCAD 2019';
  CheckBox19.Enabled := ACADVersionExists('R23.0', 'ACAD-2001:804'); 
         
  CheckBox18 := TCheckBox.Create(myPage);
  CheckBox18.Parent := myPage.Surface;
  CheckBox18.Left := CheckBox20.Left;
  CheckBox18.Top := CheckBox19.Top + ScaleY(30);
  CheckBox18.Width := ScaleX(300);
  CheckBox18.Caption := 'AutoCAD 2018';
  CheckBox18.Enabled := ACADVersionExists('R22.0', 'ACAD-1001:804'); 
          
  CheckBox17 := TCheckBox.Create(myPage);
  CheckBox17.Parent := myPage.Surface;
  CheckBox17.Left := ScaleX(200);
  CheckBox17.Top := CheckBox20.Top;
  CheckBox17.Width := ScaleX(300);
  CheckBox17.Caption := 'AutoCAD 2017';
  CheckBox17.Enabled := ACADVersionExists('R21.0', 'ACAD-0001:804');  
          
  CheckBox16 := TCheckBox.Create(myPage);
  CheckBox16.Parent := myPage.Surface;
  CheckBox16.Left := CheckBox17.Left;
  CheckBox16.Top := CheckBox19.Top;
  CheckBox16.Width := ScaleX(300);
  CheckBox16.Caption := 'AutoCAD 2016';
  CheckBox16.Enabled := ACADVersionExists('R20.1', 'ACAD-F001:804');   
            
  CheckBox15 := TCheckBox.Create(myPage);
  CheckBox15.Parent := myPage.Surface;
  CheckBox15.Left := CheckBox17.Left;
  CheckBox15.Top := CheckBox18.Top;
  CheckBox15.Width := ScaleX(300);
  CheckBox15.Caption := 'AutoCAD 2015';
  CheckBox15.Enabled := ACADVersionExists('R20.0', 'ACAD-E001:804');   
end;

效果如下

20250518083947493376

 

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容