杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2050|回复: 0

INNO 组件描述

[复制链接]
发表于 2017-2-26 14:09:29 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. ; -- Example1.iss --
  2. ; descctrl.dll 为一个 6.5 KB 的组件描述插件

  3. [Setup]
  4. AppName=My Program
  5. AppVerName=My Program version 1.5
  6. DefaultDirName={pf}\My Program
  7. DefaultGroupName=My Program
  8. UninstallDisplayIcon={app}\MyProg.exe

  9. [Components]
  10. Name: "program"; Description: "程序文件"; Types: full compact custom; Flags: fixed
  11. Name: "help"; Description: "帮助文件"; Types: full
  12. Name: "readme"; Description: "自述文件"; Types: full
  13. Name: "readme\en"; Description: "英文"; Flags: exclusive
  14. Name: "readme\de"; Description: "德文"; Flags: exclusive
  15. Name: "readme\cn"; Description: "中文"; Flags: exclusive
  16. Name: "readme\ru"; Description: "俄文"; Flags: exclusive
  17. Name: "test"; Description: "测试"; Types: full
  18. Name: "test\test1"; Description: "测试1"; Flags: checkablealone
  19. Name: "test\test2"; Description: "测试2"; Flags: checkablealone
  20. Name: "test\test3"; Description: "测试3"; Flags: checkablealone
  21. Name: "test\test4"; Description: "测试4"; Flags: checkablealone
  22. Name: "test\test5"; Description: "测试5"; Flags: checkablealone
  23. Name: "test\test6"; Description: "测试6"; Flags: checkablealone

  24. [Files]
  25. Source: "MyProg.exe"; DestDir: "{app}"; Components: program
  26. Source: "MyProg.chm"; DestDir: "{app}"; Components: help
  27. Source: "descctrl.dll"; Flags: dontcopy

  28. [Icons]
  29. Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"

  30. [Code]
  31. function enabledesc(ComponentsListHandle: HWND; DescLabelHandle: HWND; DescStrings: PChar): BOOL; external 'enabledesc@files:descctrl.dll stdcall';
  32. //ComponentsListHandle 组件框句柄
  33. //DescLabelHandle 描述TNewStaticText句柄
  34. //DescStrings 描述文字 英文分号分割“;”,如果描述中必须要有英文分号,请用“#3B”代替。

  35. function disabledesc(): BOOL; external 'disabledesc@files:descctrl.dll stdcall';

  36. var
  37.   Info: TNewStaticText;
  38.   InfoCaption: TNewStaticText;
  39.   InfoPanel: TPanel;

  40. procedure DeinitializeSetup();
  41. begin
  42.   //释放描述控制
  43.   disabledesc();
  44. end;

  45. procedure InitializeWizard();
  46. begin
  47.   // 调整组件列表的大小
  48.   WizardForm.TYPESCOMBO.Visible:= false;
  49.   WizardForm.ComponentsList.Height := WizardForm.ComponentsList.Height + WizardForm.ComponentsList.Top - WizardForm.TYPESCOMBO.Top;
  50.   WizardForm.ComponentsList.Top := WizardForm.TYPESCOMBO.Top;
  51.   WizardForm.ComponentsList.Width := ScaleX(200);
  52.   //创建一个虚拟的GroupBox,因为Inno Setup 没有啊。
  53.   InfoPanel := TPanel.Create(WizardForm);
  54.   InfoPanel.Parent := WizardForm.SelectComponentsPage;
  55.   InfoPanel.Caption := '';
  56.   InfoPanel.Top := WizardForm.ComponentsList.Top;
  57.   InfoPanel.Left := ScaleX(216);
  58.   InfoPanel.Width := ScaleX(200);
  59.   InfoPanel.Height := WizardForm.ComponentsList.Height;
  60.   InfoPanel.BevelInner := bvRaised;
  61.   InfoPanel.BevelOuter := bvLowered;
  62.   InfoCaption := TNewStaticText.Create(WizardForm);
  63.   InfoCaption.Parent := WizardForm.SelectComponentsPage;
  64.   InfoCaption.Caption := '描述';
  65.   InfoCaption.Left := ScaleX(224);
  66.   InfoCaption.Top := InfoPanel.Top - ScaleY(5);
  67.   InfoCaption.Font.Color := clActiveCaption;
  68.   // 创建描述文字
  69.   Info := TNewStaticText.Create(WizardForm);
  70.   Info.Parent := InfoPanel;
  71.   Info.AutoSize := False;
  72.   Info.Left := ScaleX(6);
  73.   Info.Width := ScaleX(188);
  74.   Info.Top := ScaleY(12);
  75.   Info.Height := WizardForm.ComponentsList.Height - ScaleY(18);
  76.   Info.Caption := '移动你的鼠标指针到组件之上,便可见到它的描述。';
  77.   Info.WordWrap := true;
  78.   //激活描述控制
  79.   enabledesc(WizardForm.ComponentsList.Handle,Info.Handle,
  80.        '程序文件描述;'+
  81.        '帮助文件描述;'+
  82.        '自述文件描述;'+
  83.        '英文描述;'+
  84.        '德文描述;'+
  85.        '中文描述;'+
  86.        '俄文描述测试#3B#3B包含#3B英文分号;'+
  87.        '测试描述;'+
  88.        '测试1描述;'+
  89.        '测试2描述;'+
  90.        '测试3描述;'+
  91.        '测试4描述;'+
  92.        '测试5描述;'+
  93.        '测试6描述;'
  94.        );
  95. end;
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-19 12:13 , Processed in 0.158419 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表