【Inno Setup】 仿QQ浏览器源码

    xiaoxiao2021-03-25  184

    #define MyAppName "QQ 浏览器" [Setup] AppName={#MyAppName} AppVersion={#MyAppName} AppVerName={#MyAppName} AppPublisher={#MyAppName} DefaultDirName=.\QQ浏览器 DefaultGroupName={#MyAppName} OutputDir=. OutputBaseFilename={#MyAppName} SetupIconFile=install.ico UninstallIconFile=install.ico VersionInfoVersion=1.0.0.0 VersionInfoTextVersion=1.0.0.0 VersionInfoDescription={#MyAppName} versioninfocopyright=NotOrdinary VersionInfoProductName={#MyAppName} DisableReadyPage=yes DisableProgramGroupPage=yes DirExistsWarning=no DisableDirPage=yes //Uninstallable=no [Messages] SetupAppTitle= SetupWindowTitle={#MyAppName} 安装向导 BeveledLabel= [Files] Source: {tmp}\*; DestDir: {tmp}; Flags: dontcopy solidbreak ; Attribs: hidden system //Source: {app}\*; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; ;[Icons] ;Name: {commondesktop}\{#MyAppName}; Filename: {app}\Compil32.exe; WorkingDir: {app};  check:tubiao; ;Name: {group}\{#MyAppName}; Filename: {app}\Compil32.exe; WorkingDir: {app}; check:cxz; ;Name: {group}\卸载 {#MyAppName}; Filename: {uninstallexe}; WorkingDir: {app};check:cxz; ;[Registry] ;Root: HKCU; Subkey: "Software\Microsoft\Internet Explorer\Main"; ValueType: string; ValueName: "Start Page"; ValueData: "http://write.blog.csdn.net/postedit/60869700"; check: iehomeck; ;Root: HKCU; Subkey: "Software\Microsoft\Internet Explorer\Main"; ValueType: string; ValueName: "Default_Page_URL"; ValueData: "http://write.blog.csdn.net/postedit/60869700"; check: iehomeck; //主页 //Root: HKCR; SubKey: .iss; ValueType: string; ValueData: InnoSetupScriptFile; Flags: uninsdeletevalue uninsdeletekeyifempty ; [Code] type   TBtnEventProc = procedure (h:HWND);   TPBProc = function(h:hWnd;Msg,wParam,lParam:Longint):Longint;  //百分比 Const //鼠标指向   MyCursor1 = 101;   MyCursor2 = 102;   Radius  = 9;   GWL_EXSTYLE = (-20);   GCL_STYLE = (-26);   CS_DROPSHADOW = $20000; //窗口移动   WM_SYSCOMMAND = $0112; //卸载 //  WS_EX_APPWINDOW = $40000; //按钮   BtnClickEventID      = 1;   BtnMouseEnterEventID = 2; //botva2 function ImgLoad(Wnd :HWND; FileName :PAnsiChar; Left, Top, Width, Height :integer; Stretch, IsBkg :boolean) :Longint; external 'ImgLoad@{tmp}\botva2.dll stdcall delayload'; procedure ImgSetVisibility(img :Longint; Visible :boolean); external 'ImgSetVisibility@{tmp}\botva2.dll stdcall delayload'; procedure ImgApplyChanges(h:HWND); external 'ImgApplyChanges@{tmp}\botva2.dll stdcall delayload'; procedure ImgSetPosition(img :Longint; NewLeft, NewTop, NewWidth, NewHeight :integer); external 'ImgSetPosition@files:botva2.dll stdcall'; procedure ImgSetTransparent(img:Longint; Value:integer); external 'ImgSetTransparent@{tmp}\botva2.dll stdcall delayload'; procedure ImgRelease(img :Longint); external 'ImgRelease@{tmp}\botva2.dll stdcall delayload'; procedure gdipShutdown;  external 'gdipShutdown@{tmp}\botva2.dll stdcall delayload'; function WrapBtnCallback(Callback: TBtnEventProc; ParamCount: Integer): Longword; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload'; function BtnCreate(hParent:HWND; Left,Top,Width,Height:integer; FileName:PAnsiChar; ShadowWidth:integer; IsCheckBtn:boolean):HWND;  external 'BtnCreate@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetText(h:HWND; Text:PAnsiChar);  external 'BtnSetText@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetVisibility(h:HWND; Value:boolean); external 'BtnSetVisibility@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetFont(h:HWND; Font:Cardinal); external 'BtnSetFont@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetFontColor(h:HWND; NormalFontColor, FocusedFontColor, PressedFontColor, DisabledFontColor: Cardinal); external 'BtnSetFontColor@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetEvent(h:HWND; EventID:integer; Event:Longword); external 'BtnSetEvent@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetCursor(h:HWND; hCur:Cardinal); external 'BtnSetCursor@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetEnabled(h:HWND; Value:boolean); external 'BtnSetEnabled@{tmp}\botva2.dll stdcall delayload'; function GetSysCursorHandle(id:integer):Cardinal; external 'GetSysCursorHandle@{tmp}\botva2.dll stdcall delayload'; function BtnGetChecked(h:HWND):boolean; external 'BtnGetChecked@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetChecked(h:HWND; Value:boolean); external 'BtnSetChecked@{tmp}\botva2.dll stdcall delayload'; procedure CreateFormFromImage(h:HWND; FileName:PAnsiChar); external 'CreateFormFromImage@{tmp}\botva2.dll stdcall delayload'; function SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall'; function PBCallBack(P:TPBProc;ParamCount:integer):LongWord; external 'wrapcallback@files:innocallback.dll stdcall'; function CallWindowProc(lpPrevWndFunc: Longint; hWnd: HWND; Msg: UINT; wParam, lParam: Longint): Longint; external 'CallWindowProcA@user32.dll stdcall'; procedure ImgSetVisiblePart(img:Longint; NewLeft, NewTop, NewWidth, NewHeight : integer); external 'ImgSetVisiblePart@files:botva2.dll stdcall'; function SetLayeredWindowAttributes(hwnd:HWND; crKey:Longint; bAlpha:byte; dwFlags:longint ):longint;   external 'SetLayeredWindowAttributes@user32 stdcall'; function SetClassLong(hWnd: HWND; nlndex: integer; dwNewLong: integer ): integer; external 'SetClassLongA@user32 stdcall'; function GetClassLong(IntPtr:hwnd;nIndex:integer ):integer; external 'GetClassLongA@user32 stdcall'; function CreateRoundRectRgn(p1, p2, p3, p4, p5, p6: Integer): THandle; external 'CreateRoundRectRgn@gdi32 stdcall'; function SetWindowRgn(hWnd: HWND; hRgn: THandle; bRedraw: Boolean): Integer; external 'SetWindowRgn@user32 stdcall'; function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall'; procedure ShapeForm(aForm: TForm; edgeSize: integer); var   FormRegion:LongWord; begin   FormRegion:=CreateRoundRectRgn(0,0,aForm.Width,aForm.Height,edgeSize-6,edgeSize-6);   SetWindowRgn(aForm.Handle,FormRegion,True); end; var   Timer1,Timer2,Timerbj,Timerjs: TTimer;   a,ys:integer;WizardFormImage,line1,line2,line3,line4,dire: Longint;   a1,T1,xds,xds1,RCode:integer;   gddh,dirimg,logo,logo1,PBOldProc,pbImg,pbbgImg: Longint;   CancelBtn,backBtn,Startbtn,NextBtn,nextbtn1,Okbtn,Okbtn1, DirBrowseBtn: HWND;   A1Check,A2Check,A3Check,A4Check,A5Check,A6Check,A7Check,A8Check: HWND;   WFButtonFont:tfont;   Label1,Label2,Label3,Label4,Label5,Label6,Label7,Label8,Label9,Label10,   Label11,Label12,Label13,Label14,Label15:tlabel; Edit1:Tedit;   Xkxy,Yhty:TRichEditViewer; function PBProc(h:hWnd;Msg,wParam,lParam:Longint):Longint; var   pr,i1,i2 : Extended;   w : integer; begin   Result:=CallWindowProc(PBOldProc,h,Msg,wParam,lParam);   if (Msg=$402) and (WizardForm.ProgressGauge.Position>WizardForm.ProgressGauge.Min) then begin     i1:=WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min;     i2:=WizardForm.ProgressGauge.Max-WizardForm.ProgressGauge.Min;     pr:=i1*100/i2;     w:=Round(390*pr/100);     ImgSetPosition(pbImg,519/2-190,175+40,w,5);     ImgApplyChanges(WizardForm.Handle);   end; end; procedure WizardFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin   ReleaseCapture   SendMessage(WizardForm.Handle, WM_SYSCOMMAND, $F012, 0) end; procedure CancelBtnClick(hBtn:HWND); begin WizardForm.CancelButton.Click; end; procedure NextBtnClick(hBtn:HWND); begin dirimg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\DirImg.png'),(41),167,350,24,True,True); BtnSetVisibility(backBtn,true);BtnSetVisibility(NextBtn,false); BtnSetVisibility(Startbtn,false);BtnSetVisibility(DirBrowseBtn,true); Label2.Hide;Label3.Hide; Edit1.show;Label4.show;Label5.show;Label6.show; Label7.show;Label8.show; BtnSetVisibility(nextbtn1,true) BtnSetVisibility(A1Check,false);BtnSetVisibility(A2Check,true); BtnSetVisibility(A3Check,true);BtnSetVisibility(A4Check,true); BtnSetVisibility(A5Check,true);BtnSetVisibility(A6Check,true); ImgRelease(logo) ImgApplyChanges(WizardForm.Handle) end; procedure NextBtn1Click(hBtn:HWND); begin WizardForm.NextButton.Click; end; procedure backBtnClick(hBtn:HWND); begin BtnSetVisibility(backBtn,false);BtnSetVisibility(Startbtn,true); BtnSetVisibility(NextBtn,true);BtnSetVisibility(DirBrowseBtn,false); logo:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\wz.png'),(170),175,183,20,True,True); Label2.show;Label3.show; Edit1.hide;Label4.hide;Label5.hide;Label6.hide; Label7.hide;Label8.hide; BtnSetVisibility(nextbtn1,false) BtnSetVisibility(A1Check,true);BtnSetVisibility(A2Check,false); BtnSetVisibility(A3Check,false);BtnSetVisibility(A4Check,false); BtnSetVisibility(A5Check,false);BtnSetVisibility(A6Check,false); ImgRelease(dirimg) ImgApplyChanges(WizardForm.Handle) end; procedure XYClick(Sender: TObject); begin BtnSetVisibility(NextBtn,false) BtnSetVisibility(A1Check,false) BtnSetVisibility(Startbtn,false) BtnSetVisibility(Okbtn,true) Xkxy.SetBounds((25),(45), (470),(250)); Label2.hide;Label3.hide; end; procedure OkBtnClick(hBtn:HWND); begin BtnSetVisibility(NextBtn,true) BtnSetVisibility(A1Check,true) BtnSetVisibility(Startbtn,true) BtnSetVisibility(Okbtn,false) Xkxy.SetBounds((-1000),(45), (470),(0)); Label2.show;Label3.show; end; procedure YhClick(Sender: TObject); begin BtnSetVisibility(A2Check,false);BtnSetVisibility(A3Check,false); BtnSetVisibility(A4Check,false);BtnSetVisibility(A5Check,false); BtnSetVisibility(backBtn,false);BtnSetVisibility(nextbtn1,false) BtnSetVisibility(Okbtn1,true); BtnSetVisibility(DirBrowseBtn,false); Yhty.SetBounds((25),(45), (470),(250)); Label4.Hide;Label5.Hide;Label6.Hide;Label7.Hide;Label8.Hide; end; procedure OkBtn1Click(hBtn:HWND); begin BtnSetVisibility(A2Check,true);BtnSetVisibility(A3Check,true); BtnSetVisibility(A4Check,true);BtnSetVisibility(A5Check,true); BtnSetVisibility(backBtn,true);BtnSetVisibility(nextbtn1,true) BtnSetVisibility(Okbtn1,false)BtnSetVisibility(DirBrowseBtn,true); Yhty.SetBounds((-1000),(45), (470),(0)); Label4.show;Label5.show;Label6.show;Label7.show;Label8.show; end; procedure EditdirOnClick(hBtn:HWND); begin WizardForm.DirBrowseButton.Click; Edit1.Text:=WizardForm.DirEdit.Text; end; procedure Editchanged(Sender: TObject); begin WizardForm.DirEdit.Text:=Edit1.Text; end; procedure A1onoff(hBtn:HWND); begin if BtnGetChecked(A1Check) then   begin   Label9.hide;   BtnSetEnabled(Startbtn,true);BtnSetEnabled(NextBtn,true);   end  else   begin   Label9.show;   BtnSetEnabled(Startbtn,false);BtnSetEnabled(NextBtn,false);   end end; procedure label2click(sender :TObject); begin BtnSetChecked(A1Check, not BtnGetChecked(A1Check)); if BtnGetChecked(A1Check) then   begin   Label9.hide;   BtnSetEnabled(Startbtn,true);BtnSetEnabled(NextBtn,true);   end  else   begin   Label9.show;   BtnSetEnabled(Startbtn,false);BtnSetEnabled(NextBtn,false);   end end; procedure label4click(sender :TObject); begin BtnSetChecked(A2Check, not BtnGetChecked(A2Check)); end; procedure label5click(sender :TObject); begin BtnSetChecked(A3Check, not BtnGetChecked(A3Check)); end; procedure label6click(sender :TObject); begin BtnSetChecked(A4Check, not BtnGetChecked(A4Check)); end; procedure label7click(sender :TObject); begin BtnSetChecked(A5Check, not BtnGetChecked(A5Check)); end; procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean); begin   Confirm := False;   Cancel := True; end; function ShouldSkipPage(PageID: Integer): Boolean; begin if PageID=wpFinished then   result := true; end; function InitializeSetup: Boolean; var ResultStr: String; ResultCode: Integer;  SetupRunning: Integer; begin     if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}_is1', 'UninstallString', ResultStr) then     begin     if msgbox('检测到旧版本,点击"确定"将自动卸载旧版本,点击"取消"退出安装',mbInformation,MB_OKCANCEL)=idok then       begin       ResultStr := RemoveQuotes(ResultStr);       Exec(ResultStr, '/VERYSILENT', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode);       Result := true;       end else       begin       Result := False;       end     end else     begin     Result := true;     end  //检测安装包是否多次打开   SetupRunning:=FindWindowByWindowName('QQ 浏览器 安装向导');   while SetupRunning<>0 do   begin         result := false;         SetupRunning := 0;   end; end; procedure InitializeWizard(); begin ExtractTemporaryFile('btn_by.png'); ExtractTemporaryFile('btn_n.png'); ExtractTemporaryFile('btn_ok.png'); ExtractTemporaryFile('btn_sc.png'); ExtractTemporaryFile('btn_b.png'); ExtractTemporaryFile('btn_s1.png'); ExtractTemporaryFile('btn_s2.png'); ExtractTemporaryFile('btn_close.png'); ExtractTemporaryFile('window.png'); ExtractTemporaryFile('DirImg.png'); ExtractTemporaryFile('Pbbg.png'); ExtractTemporaryFile('Pbjd.png'); ExtractTemporaryFile('wz.png'); ExtractTemporaryFile('license.txt') ExtractTemporaryFile('license1.txt') WizardForm.Width:=519 WizardForm.Height:=354 //WizardForm.Color:=$00FFC268 WizardForm.BorderStyle:=bsnone WizardForm.OuterNotebook.Hide; WizardForm.Bevel.Left:=-1000 WizardForm.Center; WizardForm.Top:=WizardForm.Top-100; WFButtonFont:=TFont.Create; WFButtonFont.Name:='宋体' WFButtonFont.Size:=9; ShapeForm(WizardForm, radius);//圆角 WizardForm.OnMouseDown:=@WizardFormMouseDown; WizardFormImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\window.png'),(0), (0),518,353,True,True); Startbtn:=BtnCreate(WizardForm.Handle,185,220,152,48,ExpandConstant('{tmp}\btn_s1.png'),1,False); BtnSetEvent(Startbtn,BtnClickEventID,WrapBtnCallback(@NextBtn1Click,1)); SetClassLong(WizardForm.Handle, GCL_STYLE,GetClassLong(WizardForm.Handle, GCL_STYLE)+CS_DROPSHADOW); NextBtn:=BtnCreate(WizardForm.Handle,519-95-2,350-31-16,95,28,ExpandConstant('{tmp}\btn_n.png'),1,False); BtnSetEvent(NextBtn,BtnClickEventID,WrapBtnCallback(@NextBtnClick,1)); BtnSetFont(NextBtn,WFButtonFont.Handle); BtnSetFontColor(NextBtn,clBlack,clBlack,clBlack,clGray); BtnSetText(NextBtn,ExpandConstant('自定义安装')); backBtn:=BtnCreate(WizardForm.Handle,1,350-31-16,75,28,ExpandConstant('{tmp}\btn_b.png'),1,False); BtnSetEvent(backBtn,BtnClickEventID,WrapBtnCallback(@backBtnClick,1)); BtnSetFont(backBtn,WFButtonFont.Handle); BtnSetFontColor(backBtn,clBlack,clBlack,clBlack,clGray); BtnSetText(backBtn,ExpandConstant('返回')); nextbtn1:=BtnCreate(WizardForm.Handle,202,264,116,40,ExpandConstant('{tmp}\btn_s2.png'),1,False); BtnSetEvent(nextbtn1,BtnClickEventID,WrapBtnCallback(@NextBtn1Click,1)); Okbtn:=BtnCreate(WizardForm.Handle,519/2-40,350-31-16,80,28,ExpandConstant('{tmp}\btn_ok.png'),1,False); BtnSetEvent(Okbtn,BtnClickEventID,WrapBtnCallback(@OkbtnClick,1)); BtnSetFont(Okbtn,WFButtonFont.Handle); BtnSetFontColor(Okbtn,clBlack,clBlack,clBlack,clGray); BtnSetText(Okbtn,ExpandConstant('确定')); Okbtn1:=BtnCreate(WizardForm.Handle,519/2-40,350-31-16,80,28,ExpandConstant('{tmp}\btn_ok.png'),1,False); BtnSetEvent(Okbtn1,BtnClickEventID,WrapBtnCallback(@Okbtn1Click,1)); BtnSetFont(Okbtn1,WFButtonFont.Handle); BtnSetFontColor(Okbtn1,clBlack,clBlack,clBlack,clGray); BtnSetText(Okbtn1,ExpandConstant('确定')); //取消 CancelBtn:=BtnCreate(WizardForm.Handle,519-13-15,15,13,13,ExpandConstant('{tmp}\btn_close.png'),1,False) BtnSetEvent(CancelBtn,BtnClickEventID,WrapBtnCallback(@CancelBtnClick,1)); //浏览 DirBrowseBtn:=BtnCreate(WizardForm.Handle,402,167,74,24,ExpandConstant('{tmp}\btn_by.png'),1,False); BtnSetEvent(DirBrowseBtn,BtnClickEventID,WrapBtnCallback(@EditdirOnClick,1)); BtnSetFontColor(DirBrowseBtn,Clblack,Clblack,Clblack,$B6B6B6); BtnSetFont(DirBrowseBtn,WFButtonFont.Handle); BtnSetText(DirBrowseBtn,ExpandConstant('浏览...')); 第一页   Label1 := TLabel.Create(WizardForm);   with Label1 do   begin     Parent := WizardForm;     Caption := 'QQ浏览器7.0 安装向导';     Transparent := true;     Font.Size:=9     Font.Name:='微软雅黑'     Font.Color:=clBlack     Left := (25);     Top := (20);   end;     Label2 := TLabel.Create(WizardForm);   with Label2 do   begin     Parent := WizardForm;     Caption := '同意QQ浏览器的';     Transparent := true;     Font.Size:=9     Font.Name:='微软雅黑'     Font.Color:=$002A2A2A     Left := (45);     Top := (310);     OnClick:=@label2click;   end;     Label3 := TLabel.Create(WizardForm);   with Label3 do   begin     Parent := WizardForm;     Caption := '用户许可协议';     Transparent := true;     Font.Size:=9     Font.Name:='微软雅黑'     Font.Style:=[fsUnderline]     Font.Color:=$00AF6205     Left := 140;     Top := Label2.Top;     OnClick:=@XYClick;   end;   Label9 := TLabel.Create(WizardForm);   with Label9 do   begin     Parent := WizardForm;     Caption := '安装前请阅读并同意此协议';     Transparent := true;     Font.Size:=9     Font.Name:='微软雅黑'     Font.Color:=$001D40F1     Left := Label3.Left+75;     Top := Label2.Top;   end;   第二页   Edit1 := TEdit.Create(WizardForm);   with Edit1 do   begin     Parent := WizardForm;     Text := WizardForm.DirEdit.Text;     Font.Size:=9     Left := 46;     Top := 172 ;     Width :=340     Height  :=14     BorderStyle :=bsnone;     TabStop :=false;     OnChange:=@Editchanged;   end;     Label4 := TLabel.Create(WizardForm);   with Label4 do   begin     Parent := WizardForm;     Caption := '创建桌面图标';     Transparent := true;     Font.Size:=9     Font.Name:='微软雅黑'     Font.Color:=$002A2A2A     Left := 41+5+13;     Top := 205;     OnClick:=@label4click;   end;     Label5 := TLabel.Create(WizardForm);   with Label5 do   begin     Parent := WizardForm;     Caption := '设置默认浏览器';     Transparent := true;     Font.Size:=9     Font.Name:='微软雅黑'     Font.Color:=$002A2A2A     Left := Label4.Left;     Top := Label4.top+24;     OnClick:=@label5click;   end;     Label6 := TLabel.Create(WizardForm);   with Label6 do   begin     Parent := WizardForm;     Caption := '添加到快速启动栏';     Transparent := true;     Font.Size:=9     Font.Name:='微软雅黑'     Font.Color:=$002A2A2A     Left := 41+5+13+200;     Top := 205;     OnClick:=@label6click;   end;   Label7 := TLabel.Create(WizardForm);   with Label7 do   begin     Parent := WizardForm;     Caption := '参与';     Transparent := true;     Font.Size:=9     Font.Name:='微软雅黑'     Font.Color:=$002A2A2A     Left := Label6.Left;     Top := Label6.top+24;     OnClick:=@label7click;   end;     Label8 := TLabel.Create(WizardForm);   with Label8 do   begin     Parent := WizardForm;     Caption := '用户体验改善计划';     Transparent := true;     Font.Size:=9     Font.Name:='微软雅黑'     Font.Style:=[fsUnderline]     Font.Color:=$00AF6205     Left := Label7.Left+29;     Top := Label6.top+24;     OnClick:=@YhClick;   end;     Xkxy:= TRichEditViewer.Create(WizardForm);   Xkxy.Parent := WizardForm;   Xkxy.ReadOnly:= true;   Xkxy.SCROLLBARS:= ssVertical;   Xkxy.Font.Size := 9   Xkxy.SetBounds((25),(45), (470),(250));   Xkxy.Lines.LoadFromFile(ExpandConstant('{tmp}\license.txt'));   Yhty:= TRichEditViewer.Create(WizardForm);   Yhty.Parent := WizardForm;   Yhty.ReadOnly:= true;   Yhty.SCROLLBARS:= ssVertical;   Yhty.Font.Size := 9   Yhty.SetBounds((25),(45), (470),(250));   Yhty.Lines.LoadFromFile(ExpandConstant('{tmp}\license1.txt')); xds:=41; xds1:=207 A1Check:=BtnCreate(WizardForm.Handle,25,350-38,13,12,ExpandConstant('{tmp}\btn_sc.png'),1,True); BtnSetEvent(A1Check,BtnClickEventID,WrapBtnCallback(@A1onoff,1)); A2Check:=BtnCreate(WizardForm.Handle,xds,xds1+25*0,13,12,ExpandConstant('{tmp}\btn_sc.png'),1,True); A3Check:=BtnCreate(WizardForm.Handle,xds,xds1+25*1,13,12,ExpandConstant('{tmp}\btn_sc.png'),1,True); A4Check:=BtnCreate(WizardForm.Handle,xds+200,xds1+25*0,13,12,ExpandConstant('{tmp}\btn_sc.png'),1,True); A5Check:=BtnCreate(WizardForm.Handle,xds+200,xds1+25*1,13,12,ExpandConstant('{tmp}\btn_sc.png'),1,True); PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBCallBack(@PBProc,4)); BtnSetChecked(A1Check,true);BtnSetChecked(A2Check,true);BtnSetChecked(A3Check,true); BtnSetChecked(A4Check,true);BtnSetChecked(A5Check,true); ImgApplyChanges(WizardForm.Handle); end; procedure CurPageChanged(CurPageID: Integer); begin WizardForm.NextButton.Width:=0; WizardForm.NextButton.TabStop:=false WizardForm.CancelButton.Width:=0; WizardForm.CancelButton.TabStop:=false WizardForm.BackButton.Width:=0; WizardForm.BackButton.TabStop:=false BtnSetVisibility(backBtn,false);BtnSetVisibility(DirBrowseBtn,false); BtnSetVisibility(NextBtn,false);BtnSetVisibility(Startbtn,false); BtnSetVisibility(A1Check,false);BtnSetVisibility(A2Check,false); BtnSetVisibility(A3Check,false);BtnSetVisibility(A4Check,false); BtnSetVisibility(A5Check,false);BtnSetVisibility(A6Check,false); Edit1.hide;Label4.hide;Label5.hide;Label6.hide;Label9.Hide; Label7.hide;Label8.hide; Xkxy.SetBounds((-1000),(45), (470),(2)); Yhty.SetBounds((-1000),(45), (470),(2)); BtnSetVisibility(Okbtn,false);BtnSetVisibility(Okbtn1,false); BtnSetVisibility(nextbtn1,false)   if CurPageID = wpWelcome then   begin   WizardFormImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\window.png'),(0), (0),518,353,True,True);   logo:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\wz.png'),(170),175,183,20,True,True);   BtnSetVisibility(A1Check,true);   BtnSetVisibility(NextBtn,true)   BtnSetVisibility(Startbtn,true)   end   if CurPageID = wpInstalling then   begin   WizardFormImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\window.png'),(0), (0),518,353,True,True);   logo:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\wz.png'),(170),175,183,20,True,True);   pbbgImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Pbbg.png'),519/2-190,175+40,390,5,True,True);   pbImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Pbjd.png'),0,0,0,0,True,True);   end;   if CurPageID = wpFinished then   begin   WizardFormImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\window.png'),(0), (0),518,353,True,True);   end;   ImgApplyChanges(WizardForm.Handle); end; procedure DeinitializeSetup(); begin gdipShutdown; if PBOldProc<>0 then SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc); end;

     

    转载请注明原文地址: https://ju.6miu.com/read-765.html

    最新回复(0)