杉宫竹苑工作室

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

Inno Setup 美化安装界面

[复制链接]
发表于 2017-5-5 20:34:05 | 显示全部楼层 |阅读模式

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

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

x

    实现该功能需要增强版。
  1. ; Script generated by the Inno Setup Script Wizard.
  2. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
  3. ; 该执行目录为 setup.iss 所在的目录,请注意拼接相对目录

  4. #define MyAppName "_name_"
  5. #define MyAppNameZh "_appName_"
  6. #define MyAppVersion "_version_"
  7. #define MyAppPublisher "_appPublisher_"
  8. #define MyAppURL "_appURL_"
  9. #define MyAppExeName "_name_.exe"
  10. #define OutputPath "_outputPath_"
  11. #define OutputFileName "_outputFileName_"
  12. #define SourceMain "_filesPath_\_name_.exe"
  13. #define SourceFolder "_filesPath_\*"
  14. #define LicenseFilePath "_resourcesPath_\license.txt"
  15. #define SetupIconFilePath "_resourcesPath_\logo.ico"
  16. #define MyAppId "_appId_"
  17. #define ResourcesPath "_resourcesPath_\*"

  18. [setup]
  19. ; NOTE: The value of AppId uniquely identifies this application.
  20. ; Do not use the same AppId value in installers for other applications.
  21. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
  22. AppId={#MyAppId}
  23. AppName={#MyAppName}
  24. AppVersion={#MyAppVersion}
  25. AppVerName={#MyAppName}
  26. AppPublisher={#MyAppPublisher}
  27. AppPublisherURL={#MyAppURL}
  28. AppSupportURL={#MyAppURL}
  29. AppUpdatesURL={#MyAppURL}
  30. DefaultDirName={pf}\{#MyAppName}
  31. LicenseFile={#LicenseFilePath}
  32. OutputDir={#OutputPath}
  33. OutputBaseFilename={#OutputFileName}
  34. SetupIconFile={#SetupIconFilePath}
  35. Compression=lzma
  36. SolidCompression=yes
  37. PrivilegesRequired=admin
  38. Uninstallable=yes
  39. UninstallDisplayName={#MyAppNameZh}
  40. DefaultGroupName={#MyAppNameZh}
  41. UninstallIconFile={#SetupIconFilePath}
  42. Versioninfodescription={#MyAppName} 安装程序
  43. versioninfocopyright=Copyright(c) 2017
  44. VersionInfoProductName={#MyAppName}
  45. DisableReadyPage=yes
  46. DisableProgramGroupPage=yes
  47. DirExistsWarning=no
  48. DisableDirPage=yes

  49. [Tasks]
  50. Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce

  51. [Files]
  52. Source: {#ResourcesPath}; DestDir: {tmp}; Flags: dontcopy solidbreak ; Attribs: hidden system
  53. Source: {#SourceMain}; DestDir: "{app}"; Flags: ignoreversion
  54. Source: {#SourceFolder}; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

  55. [Messages]
  56. SetupAppTitle={#MyAppName} 安装向导
  57. SetupWindowTitle={#MyAppName} 安装向导

  58. [Icons]
  59. Name: "{commondesktop}\{#MyAppNameZh}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
  60. Name: "{group}\{#MyAppNameZh}"; Filename: "{app}\{#MyAppExeName}"
  61. Name: "{group}\卸载{#MyAppNameZh}"; Filename: "{uninstallexe}"

  62. ; 中文汉化语言包
  63. ; [Languages]
  64. ; Name: "chinese"; MessagesFile: "_resourcesPath_\ChineseSimp.isl"

  65. [Code]
  66. // for dll
  67. type
  68.   TBtnEventProc = procedure (h:HWND);
  69.   TPBProc = function(h:hWnd;Msg,wParam,lParam:Longint):Longint;  //百分比
  70.   TTimerProc = procedure(h:longword; msg:longword; idevent:longword; dwTime:longword);
  71. const
  72.   Radius  = 9;
  73.   GWL_EXSTYLE = (-20);
  74.   //窗口移动
  75.   WM_SYSCOMMAND = $0112;
  76.   WS_EX_LAYERED = $80000;
  77.   WS_EX_TRANSPARENT = $20;
  78.   LWA_COLORKEY = 1;
  79.   TransparentColor = clLime;  //要去掉的图片底色
  80.   TransparentPercent = 80;
  81.   BTN_MAX_PATH = 1024;

  82.   BtnClickEventID      = 1;
  83.   BtnMouseEnterEventID = 2;
  84.   BtnMouseLeaveEventID = 3;
  85.   BtnMouseMoveEventID  = 4;
  86.   BtnMouseDownEventID  = 5;
  87.   BtnMouseUpEventID    = 6;

  88. //function WrapBtnCallback(Callback: TBtnEventProc; ParamCount: Integer): Longword;  external 'wrapcallback@files:innocallback.dll stdcall';
  89. function  WrapTimerProc(callback: TTimerProc; Paramcount: Integer): Longword; external 'wrapcallback@files:innocallback.dll stdcall';

  90. function  LoadCursorFromFile(FileName: String): Cardinal; external 'LoadCursorFromFile{#A}@user32 stdcall';
  91. function  DeleteObject(p1: Longword): BOOL; external 'DeleteObject@gdi32.dll stdcall';
  92. function  GetPM(nIndex:Integer):Integer; external 'GetSystemMetrics@user32.dll stdcall';
  93. //botva2
  94. function  ImgLoad(Wnd :HWND; FileName :PAnsiChar; Left, Top, Width, Height :integer; Stretch, IsBkg :boolean) :Longint; external 'ImgLoad@{tmp}\botva2.dll stdcall delayload';
  95. procedure ImgSetVisibility(img :Longint; Visible :boolean); external 'ImgSetVisibility@{tmp}\botva2.dll stdcall delayload';
  96. procedure ImgApplyChanges(h:HWND); external 'ImgApplyChanges@{tmp}\botva2.dll stdcall delayload';
  97. procedure ImgSetPosition(img :Longint; NewLeft, NewTop, NewWidth, NewHeight :integer); external 'ImgSetPosition@files:botva2.dll stdcall';
  98. procedure ImgRelease(img :Longint); external 'ImgRelease@{tmp}\botva2.dll stdcall delayload';
  99. procedure gdipShutdown;  external 'gdipShutdown@{tmp}\botva2.dll stdcall delayload';
  100. function  WrapBtnCallback(Callback: TBtnEventProc; ParamCount: Integer): Longword; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload';
  101. function  BtnCreate(hParent:HWND; Left,Top,Width,Height:integer; FileName:PAnsiChar; ShadowWidth:integer; IsCheckBtn:boolean):HWND;  external 'BtnCreate@{tmp}\botva2.dll stdcall delayload';
  102. procedure BtnSetText(h:HWND; Text:PAnsiChar);  external 'BtnSetText@{tmp}\botva2.dll stdcall delayload';
  103. procedure BtnSetVisibility(h:HWND; Value:boolean); external 'BtnSetVisibility@{tmp}\botva2.dll stdcall delayload';
  104. procedure BtnSetFont(h:HWND; Font:Cardinal); external 'BtnSetFont@{tmp}\botva2.dll stdcall delayload';
  105. procedure BtnSetFontColor(h:HWND; NormalFontColor, FocusedFontColor, PressedFontColor, DisabledFontColor: Cardinal); external 'BtnSetFontColor@{tmp}\botva2.dll stdcall delayload';
  106. procedure BtnSetEvent(h:HWND; EventID:integer; Event:Longword); external 'BtnSetEvent@{tmp}\botva2.dll stdcall delayload';
  107. procedure BtnSetCursor(h:HWND; hCur:Cardinal); external 'BtnSetCursor@{tmp}\botva2.dll stdcall delayload';
  108. procedure BtnSetEnabled(h:HWND; Value:boolean); external 'BtnSetEnabled@{tmp}\botva2.dll stdcall delayload';
  109. function  GetSysCursorHandle(id:integer):Cardinal; external 'GetSysCursorHandle@{tmp}\botva2.dll stdcall delayload';
  110. function  BtnGetChecked(h:HWND):boolean; external 'BtnGetChecked@{tmp}\botva2.dll stdcall delayload';
  111. procedure BtnSetChecked(h:HWND; Value:boolean); external 'BtnSetChecked@{tmp}\botva2.dll stdcall delayload';
  112. procedure CreateFormFromImage(h:HWND; FileName:PAnsiChar); external 'CreateFormFromImage@{tmp}\botva2.dll stdcall delayload';
  113. procedure BtnSetPosition(h:HWND; NewLeft, NewTop, NewWidth, NewHeight: integer);  external 'BtnSetPosition@{tmp}\botva2.dll stdcall delayload';
  114. function  SetLayeredWindowAttributes(hwnd:HWND; crKey:Longint; bAlpha:byte; dwFlags:longint ):longint;
  115. external  'SetLayeredWindowAttributes@user32 stdcall'; //函数声明
  116. function  SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
  117. function  PBCallBack(P:TPBProc;ParamCount:integer):LongWord; external 'wrapcallback@files:innocallback.dll stdcall';
  118. function  CallWindowProc(lpPrevWndFunc: Longint; hWnd: HWND; Msg: UINT; wParam, lParam: Longint): Longint; external 'CallWindowProcA@user32.dll stdcall';
  119. procedure ImgSetVisiblePart(img:Longint; NewLeft, NewTop, NewWidth, NewHeight : integer); external 'ImgSetVisiblePart@files:botva2.dll stdcall';
  120. function  SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
  121. function  KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';
  122. function  GetWindowLong(Wnd: HWnd; Index: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall';
  123. function  ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall';
  124. function  CreateRoundRectRgn(p1, p2, p3, p4, p5, p6: Integer): THandle; external 'CreateRoundRectRgn@gdi32 stdcall';
  125. function  SetWindowRgn(hWnd: HWND; hRgn: THandle; bRedraw: Boolean): Integer; external 'SetWindowRgn@user32 stdcall';
  126. procedure ShapeForm(aForm: TForm; edgeSize: integer); //圆角
  127.   var
  128.     FormRegion:LongWord;
  129.   begin
  130.     FormRegion:=CreateRoundRectRgn(0,0,aForm.Width,aForm.Height,edgeSize,edgeSize);
  131.     SetWindowRgn(aForm.Handle,FormRegion,True);
  132.   end;

  133. // 安装前强制杀进
  134. // 该函数在安装程序初始化时调用,返回False 将中断安装,True则继续安装.程
  135. function InitializeSetup(): Boolean;
  136.   var ErrorCode: Integer;
  137.   begin
  138.     ShellExec('open','taskkill.exe','/f /im {#MyAppExeName}','',SW_HIDE,ewNoWait,ErrorCode);
  139.     ShellExec('open','tskill.exe',' {#MyAppName}','',SW_HIDE,ewNoWait,ErrorCode);
  140.     result := True;
  141.   end;

  142. // 卸载前强制杀进程
  143. function InitializeUninstall(): Boolean;
  144.   var ErrorCode: Integer;
  145.   begin
  146.     ShellExec('open','taskkill.exe','/f /im {#MyAppExeName}','',SW_HIDE,ewNoWait,ErrorCode);
  147.     ShellExec('open','tskill.exe',' {#MyAppName}','',SW_HIDE,ewNoWait,ErrorCode);
  148.     result := True;
  149.   end;

  150. var
  151.   BGimg:longint;
  152.   btnShowLicense,MinBtn,CancelBtn,btnBrowser,btnSetup,btnBack:HWND;
  153.   isWelcomePage:boolean;
  154.   pathEdit:tedit;
  155.   labelReadImg,licenseImg,progressbgImg,PBOldProc,labelAutoRunImg:longint;
  156.   checkboxLicense,checkboxAutoRun:HWND;
  157.   licenseRich:TRichEditViewer;

  158. // 向导调用这个事件函数确定是否在所有页或不在一个特殊页 (用PageID 指定) 显示。如果返回True,将跳过该页;如果你返回False,该页被显示。
  159. // 注意: 这个事件函数不被wpWelcome、wpPreparing 和wpInstalling 页调用,还有安装程序已经确定要跳过的页也不会调用
  160. // wpWelcome, wpLicense, wpPassword, wpInfoBefore, wpUserInfo, wpSelectDir, wpSelectComponents, wpSelectProgramGroup, wpSelectTasks, wpReady, wpPreparing, wpInstalling, wpInfoAfter, wpFinished
  161. function ShouldSkipPage(PageID: Integer): Boolean;
  162.   begin
  163.     if PageID=wpLicense then
  164.       result:=true;
  165.     if PageID=wpInfoBefore then
  166.       result:=true;
  167.     if PageID=wpUserInfo then
  168.       result:=true;
  169.     if PageID=wpSelectDir then
  170.       result:=true;
  171.     if PageID=wpSelectComponents then
  172.       result:=true;
  173.     if PageID=wpSelectProgramGroup then
  174.       result:=true;
  175.     if PageID=wpSelectTasks then
  176.       result:=true;
  177.   end;

  178. // 关闭按钮
  179. procedure CancelBtnOnClick(hBtn:HWND);
  180.   begin
  181.     WizardForm.CancelButton.Click;
  182.   end;

  183. // 最小化按钮
  184. procedure MinBtnOnClick(hBtn:HWND);
  185.   begin
  186.     SendMessage(WizardForm.Handle,WM_SYSCOMMAND,61472,0);
  187.   end;

  188. // 浏览文件夹按钮
  189. procedure btnBrowserclick(hBtn:HWND);
  190.   begin
  191.     WizardForm.DirBrowseButton.Click;
  192.     pathEdit.text := WizardForm.DirEdit.text;
  193.   end;

  194. // 路径选择器 change
  195. procedure pathEditChange(Sender: TObject);
  196.   begin
  197.     WizardForm.DirEdit.text:=pathEdit.Text ;
  198.   end;

  199. // 立即安装等按钮的操作就是不断地下一步
  200. procedure nextSetpBtnClick(hBtn:HWND);
  201.   begin
  202.     WizardForm.NextButton.Click;
  203.   end;

  204. // 安装的进度条
  205. function PBProc(h:hWnd;Msg,wParam,lParam:Longint):Longint;
  206.   var
  207.     pr,i1,i2 : Extended;
  208.     w : integer;
  209.   begin
  210.     Result:=CallWindowProc(PBOldProc,h,Msg,wParam,lParam);
  211.     if (Msg=$402) and (WizardForm.ProgressGauge.Position>WizardForm.ProgressGauge.Min) then
  212.     begin
  213.       i1:=WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min;
  214.       i2:=WizardForm.ProgressGauge.Max-WizardForm.ProgressGauge.Min;
  215.       pr:=i1*100/i2;
  216.       w:=Round(650*pr/100);
  217.       ImgSetPosition(progressbgImg,0,320,w,15);
  218.       ImgSetVisiblePart(progressbgImg,0,0,w,15);
  219.       ImgApplyChanges(WizardForm.Handle);
  220.     end;
  221.   end;

  222. // 鼠标拖动
  223. procedure WizardMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  224.   begin
  225.     ReleaseCapture
  226.     SendMessage(WizardForm.Handle, $0112, $F012, 0)
  227.   end;

  228. // 查看 license
  229. procedure btnShowLicenseClick(hBtn:HWND);
  230.   begin
  231.     if isWelcomePage=true then
  232.     begin
  233.       licenseImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_license.png'),0,0,650,450,false,false);
  234.       isWelcomePage:=false
  235.       licenseRich.Height:=295
  236.       BtnSetVisibility(checkboxLicense,false)
  237.       BtnSetVisibility(btnShowLicense,false)
  238.       BtnSetVisibility(btnSetup,false)
  239.       BtnSetVisibility(btnBrowser,false)
  240.       pathEdit.Hide
  241.       BtnSetVisibility(btnBack,true)
  242.     end else
  243.     begin
  244.       isWelcomePage:=true
  245.       BGimg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_welcome.png'),0,0,650,450,false,true);
  246.       labelReadImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\label_read.png'),243,398,72,20,false,true);
  247.       licenseRich.Height:=0
  248.       BtnSetVisibility(checkboxLicense,true)
  249.       BtnSetVisibility(btnShowLicense,true)
  250.       BtnSetVisibility(btnSetup,true)
  251.       ImgRelease(licenseImg)
  252.       BtnSetVisibility(btnBrowser,true)
  253.       pathEdit.show
  254.       BtnSetVisibility(btnBack,false)
  255.     end
  256.       ImgApplyChanges(WizardForm.Handle)
  257.   end;

  258. // 勾选查看 license
  259. procedure checkboxLicenseClick(hBtn:HWND);
  260.   begin
  261.     if BtnGetChecked(checkboxLicense)=true then
  262.     begin
  263.       BtnSetEnabled(btnSetup,true)
  264.     end else
  265.     begin
  266.       BtnSetEnabled(btnSetup,false)
  267.     end
  268.   end;

  269. // 该过程在开始的时候改变向导或者向导页,不要指望使用InitializeSetup函数实现改变向导页的功能,因为InitializeSetup函数触发时向导窗口并不存在。
  270. procedure InitializeWizard();
  271.   begin
  272.     // 设置欢迎向导页的尺寸大小
  273.     WizardForm.OuterNotebook.hide;
  274.     WizardForm.Bevel.Hide;
  275.     WizardForm.BorderStyle:=bsnone;
  276.     WizardForm.Position:=poDesktopCenter;
  277.     // WizardForm.Center;
  278.     WizardForm.Width:=650;
  279.     WizardForm.Height:=450;
  280.     // WizardForm.Color:=clWhite;
  281.     WizardForm.OnMouseDown:=@WizardMouseDown
  282.     isWelcomePage:=true;
  283.     // WizardForm.InnerNotebook.Hide;
  284.     // wizardform.Color:=TransparentColor;

  285.     // 加载资源到 tmp 临时目录
  286.     ExtractTemporaryFile('bg_welcome.png');
  287.     ExtractTemporaryFile('bg_installing.png');
  288.     ExtractTemporaryFile('bg_license.png');
  289.     ExtractTemporaryFile('label_read.png');
  290.     ExtractTemporaryFile('label_license.png');
  291.     ExtractTemporaryFile('license.txt');
  292.     ExtractTemporaryFile('btn_close.png');
  293.     ExtractTemporaryFile('btn_min.png');
  294.     ExtractTemporaryFile('btn_back.png');
  295.     ExtractTemporaryFile('btn_setup.png');
  296.     ExtractTemporaryFile('btn_browser.png');
  297.     ExtractTemporaryFile('checkbox.png');
  298.     ExtractTemporaryFile('bg_finished.png');
  299.     ExtractTemporaryFile('btn_complete.png');
  300.     ExtractTemporaryFile('loading.png');
  301.     ExtractTemporaryFile('label_autorun.png');

  302.     // 关闭按钮样式
  303.     CancelBtn:=BtnCreate(WizardForm.Handle,627,8,12,12,ExpandConstant('{tmp}\btn_close.png'),1,False)
  304.     BtnSetEvent(CancelBtn,BtnClickEventID,WrapBtnCallback(@CancelBtnOnClick,1));
  305.    
  306.     // 最小化按钮样式
  307.     MinBtn:=BtnCreate(WizardForm.Handle,607,8,12,12,ExpandConstant('{tmp}\btn_min.png'),1,False)
  308.     BtnSetEvent(MinBtn,BtnClickEventID,WrapBtnCallback(@MinBtnOnClick,1));
  309.    
  310.     // 立即安装按钮样式
  311.     btnSetup:=BtnCreate(WizardForm.Handle,195,340,260,44,ExpandConstant('{tmp}\btn_setup.png'),1,False)
  312.     BtnSetEvent(btnSetup,BtnClickEventID,WrapBtnCallback(@nextSetpBtnClick,1));
  313.    
  314.     // 返回按钮样式
  315.     btnBack:=BtnCreate(WizardForm.Handle,285,390,80,32,ExpandConstant('{tmp}\btn_back.png'),1,False)
  316.     BtnSetEvent(btnBack,BtnClickEventID,WrapBtnCallback(@btnShowLicenseClick,1));
  317.     BtnSetVisibility(btnBack,false)
  318.    
  319.     pathEdit:= TEdit.Create(WizardForm);
  320.     with pathEdit do
  321.     begin
  322.       Parent:=WizardForm;
  323.       text:=WizardForm.DirEdit.text;
  324.       Font.Name:='宋体'
  325.       BorderStyle:=bsNone;
  326.       SetBounds(110,272,340,15)
  327.       OnChange:=@pathEditChange;
  328.       TabStop:=false;
  329.     end;

  330.     // 浏览按钮样式
  331.     btnBrowser:=BtnCreate(WizardForm.Handle,470,262,80,32,ExpandConstant('{tmp}\btn_browser.png'),1,False)
  332.     BtnSetEvent(btnBrowser,BtnClickEventID,WrapBtnCallback(@btnBrowserclick,1));

  333.     PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBCallBack(@PBProc,4));

  334.     // 查看 license 的文本区域
  335.     licenseRich:= TRichEditViewer.Create(WizardForm);
  336.     with licenseRich do
  337.     begin
  338.       Parent:=WizardForm;
  339.       ReadOnly:=true;
  340.       SCROLLBARS:=ssVertical;
  341.       font.Name:='宋体'
  342.       Color:=clWhite;
  343.       BorderStyle:=bsNone;
  344.       SetBounds(40,65,570,0)
  345.       Lines.LoadFromFile(ExpandConstant('{tmp}\license.txt'));
  346.       TabStop:=false;
  347.     end;
  348.    
  349.     ImgApplyChanges(WizardForm.Handle)
  350.   end;

  351. // 该过程在安装终止时被调用,注意及时在用户没有安装任何文件之前退出也会被调用。
  352. procedure DeinitializeSetup();
  353.   var RCode: Integer;
  354.   begin
  355.     // 检查是否需要自动运行
  356.     if BtngetChecked(checkboxAutoRun)=true then
  357.     begin
  358.       Exec(ExpandConstant('{app}\{#MyAppExeName}'),'','',SW_SHOW, ewNoWait,RCode);
  359.     end

  360.     gdipShutdown;
  361.   end;

  362. // 在新向导页 (由CurPageID 指定) 显示后调用。
  363. procedure CurPageChanged(CurPageID: Integer);
  364.   begin
  365.     // 默认的流程按钮隐藏掉
  366.     WizardForm.NextButton.Visible:=false;
  367.     WizardForm.CancelButton.Height:=0;
  368.     WizardForm.BackButton.Height:=0;

  369.     if CurPageID=wpWelcome then
  370.       begin
  371.         BGimg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_welcome.png'),0,0,650,450,true,true);

  372.         // license 提示
  373.         checkboxLicense:=BtnCreate(WizardForm.Handle,220,400,16,16,ExpandConstant('{tmp}\checkbox.png'),1,true)
  374.         BtnSetEvent(checkboxLicense,BtnClickEventID,WrapBtnCallback(@checkboxLicenseClick,1))

  375.         // 默认勾选 阅读并同意
  376.         BtnSetChecked(checkboxLicense,true)
  377.         labelReadImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\label_read.png'),243,398,72,20,false,true);
  378.         btnShowLicense:=BtnCreate(WizardForm.Handle,320,398,117,20,ExpandConstant('{tmp}\label_license.png'),4,false)
  379.         BtnSetEvent(btnShowLicense,BtnClickEventID,WrapBtnCallback(@btnShowLicenseClick,1))
  380.         
  381.         WizardForm.Width:=650;
  382.         WizardForm.Height:=450;
  383.         WizardForm.Show;
  384.       end

  385.     if CurPageID = wpInstalling then
  386.       begin
  387.         BtnSetPosition(checkboxLicense,560,421,75,15);
  388.         pathEdit.Hide;
  389.         BtnSetVisibility(btnBrowser,false)
  390.         WizardForm.Height:=450
  391.         BtnSetVisibility(btnShowLicense,false);
  392.         BtnSetVisibility(checkboxLicense,false);
  393.         BGimg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_installing.png'),0,0,650,450,false,true);
  394.         
  395.         progressbgImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\loading.png'),0,320,0,0,True,True);

  396.         BtnSetVisibility(btnSetup,false);
  397.       end

  398.     if CurPageID = wpFinished then
  399.       begin
  400.         ImgSetVisibility(progressbgImg,false)
  401.         btnSetup:=BtnCreate(WizardForm.Handle,195,340,260,44,ExpandConstant('{tmp}\btn_complete.png'),1,False)
  402.         BtnSetEvent(btnSetup,BtnClickEventID,WrapBtnCallback(@nextSetpBtnClick,1));

  403.         BGimg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg_finished.png'),0,0,650,450,false,true);

  404.         // 是否自动运行
  405.         checkboxAutoRun:=BtnCreate(WizardForm.Handle,275,400,16,16,ExpandConstant('{tmp}\checkbox.png'),1,true)
  406.         labelAutoRunImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\label_autorun.png'),295,398,84,20,false,true);

  407.         // 默认勾选
  408.         BtnSetChecked(checkboxAutoRun,true)

  409.       end

  410.     ImgApplyChanges(WizardForm.Handle)
  411.   end;
复制代码


回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-18 15:26 , Processed in 0.106095 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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