杉宫竹苑工作室

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

Inno Setuo 自定义图片背景图脚本

[复制链接]
发表于 2017-3-6 16:58:32 | 显示全部楼层 |阅读模式

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

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

x
48_196400_8f6439b472ba7bb.jpg

  1. [Setup]
  2. AppName=My Program
  3. AppVersion=1.5
  4. DefaultDirName={pf}My Program
  5. DefaultGroupName=My Program

  6. [Files]
  7. Source: "开始位图.bmp"; Flags: dontcopy
  8. Source: "结束位图.bmp"; Flags: dontcopy
  9. Source: "waterctrl.dll"; Flags: dontcopy
  10. Source: "MyProg.exe"; DestDir: "{app}"

  11. [Run]
  12. Filename: "{app}MyProg.exe"; Description: "运行我的程序"; Flags: postinstall

  13. [code]
  14. var
  15.   bmp: TBitmap;           
  16.   bmp1: TBitmap;              
  17.   CheckBox1: TCheckBox;

  18. function enablewater(ParentWnd: HWND; Left, Top: integer; Bmp: HBITMAP; WaterRadius, WaterHeight: integer): BOOL;
  19.   external 'enablewater@files:waterctrl.dll stdcall';
  20. function waterblob(x, y: integer; radius, height: integer): BOOL;
  21.   external 'waterblob@files:waterctrl.dll stdcall';
  22. function flattenwater(): BOOL; external 'flattenwater@files:waterctrl.dll stdcall';
  23. function disablewater(): BOOL; external 'disablewater@files:waterctrl.dll stdcall';
  24. function setwaterparent(ParentWnd: HWND): BOOL; external 'setwaterparent@files:waterctrl.dll stdcall';

  25. procedure InitializeWizard();
  26. begin
  27.   ExtractTemporaryFile('开始位图.bmp');
  28.   ExtractTemporaryFile('结束位图.bmp');
  29.   bmp := TBitmap.create;
  30.   bmp.LoadFromFile(ExpandConstant('{tmp}开始位图.bmp'));
  31.   bmp1 := TBitmap.create;
  32.   bmp1.LoadFromFile(ExpandConstant('{tmp}结束位图.bmp'));
  33.   Wizardform.WelcomeLabel1.Visible:= false;  //   屏蔽安装向导页面上面的文字
  34.   Wizardform.WelcomeLabel2.Visible:= false;  //   屏蔽安装向导页面上面的文字
  35. end;

  36. procedure CurPageChanged(CurPageID: Integer);
  37. begin
  38.   if CurPageID = wpWelcome then
  39.     begin
  40.     enablewater(WizardForm.WelcomePage.Handle, 0, 0, bmp.Handle, 3, 50);
  41.     waterblob(70, 198, 10, 1000);
  42.     end
  43.   else
  44.     if CurPageID = wpFinished then
  45.       begin
  46.       waterblob(70, 198, 10, 1000);
  47.       // 不显示原有文字
  48.       Wizardform.FinishedHeadingLabel.Visible:= false;
  49.       Wizardform.FinishedLabel.Visible:= false;
  50.       Wizardform.RunList.Visible:= false;
  51.       // 新建勾选项 1
  52.       CheckBox1 := TCheckBox.Create(WizardForm);
  53.       CheckBox1.Parent := WizardForm.FinishedPage;
  54.       CheckBox1.Left := ScaleX(180);     // 位置要根据背景图像的情况进行调整
  55.       CheckBox1.Top := ScaleY(220);      // 位置要根据背景图像的情况进行调整
  56.       CheckBox1.Width := ScaleX(100);    // 宽度要根据文字多少进行调整
  57.       CheckBox1.Height := ScaleY(15);
  58.       CheckBox1.TabOrder := 0;
  59.       CheckBox1.State := Wizardform.RunList.Checked[0];
  60.       CheckBox1.Caption:= Wizardform.RunList.Items[0];
  61.       end
  62.     else
  63.       flattenwater();
  64. end;

  65. procedure DeinitializeSetup();
  66. begin
  67.   disablewater();
  68.   bmp.Free;
  69.   bmp1.Free;
  70. end;

  71. function NextButtonClick(CurPageID : Integer): Boolean;
  72. begin
  73. result:= true;
  74. if CurPageID=wpFinished then
  75.   begin
  76.   wizardform.RunList.Checked[0] := checkbox1.Checked;
  77.   end;
  78. if CurPageID=wpReady then
  79.   begin
  80.   disablewater;                  // 关闭水波
  81.   enablewater(WizardForm.FinishedPage.Handle, 0, 0, bmp1.Handle, 3, 50); //新的水波
  82.   end;
  83. end;
复制代码


回复

使用道具 举报

 楼主| 发表于 2017-3-6 17:00:03 | 显示全部楼层

48_377_ad3b9a7d818e63c.gif
  1. [Setup]
  2. AppName=我的程序
  3. AppVerName=我的程序 1.5
  4. DefaultDirName={pf}我的程序
  5. DefaultGroupName=我的程序
  6. WizardImageFile=WizModernImage.bmp

  7. [Files]
  8. Source: "MyProg.exe"; DestDir: "{app}"

  9. [Run]
  10. Filename: "{app}MyProg.exe"; Description: "我的程序"; Flags: nowait postinstall skipifsilent

  11. [Code]
  12. var
  13. CheckBox1: TCheckBox;
  14. newlabel: TLabel;

  15. procedure InitializeWizard();
  16. begin
  17. CheckBox1 := TCheckBox.Create(WizardForm);
  18. CheckBox1.Parent := WizardForm.FinishedPage;
  19. CheckBox1.Left := 18
  20. CheckBox1.Top := ScaleY(100);
  21. CheckBox1.Width := ScaleY(15);
  22. CheckBox1.Height := ScaleY(15);
  23. CheckBox1.TabOrder := 0;
  24. CheckBox1.State := cbChecked

  25. WizardForm.WizardBitmapImage2.Width:= 479
  26. WizardForm.WizardBitmapImage2.Height:= 290

  27. // 不显示原有文字
  28. Wizardform.FinishedHeadingLabel.Visible:= false;
  29. Wizardform.FinishedLabel.Visible:= false;
  30. // 添加透明文字
  31. newlabel:= TLabel.Create(WizardForm);
  32. newlabel.Parent := WizardForm.FinishedPage;
  33. newlabel.Transparent:= true;
  34. newlabel.Top := CheckBox1.Top + ScaleY(2);
  35. newlabel.Left := CheckBox1.Left+ScaleX(20);
  36. newlabel.Caption:= '运行 你的程序';
  37. end;

  38. procedure CurPageChanged(CurPageID : Integer);
  39. begin
  40. if CurPageID=wpFinished then
  41. Wizardform.RunList.Visible:= false;
  42. end;

  43. function NextButtonClick(CurPageID : Integer): Boolean;
  44. begin
  45. result:= true;
  46. if CurPageID=wpFinished then
  47. wizardform.RunList.Checked[0]:= checkbox1.Checked;
  48. end;
复制代码


回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-18 12:18 , Processed in 0.113719 second(s), 21 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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