【Inno Setup】 仿QQ浏览器源码

#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;

 

  • 7
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Inno Setup是一个功能强大的安装程序制作工具,它可以帮助开发人员制作自己的安装程序。仿QQ音乐可以通过使用Inno Setup来创建一个类似的安装程序。 首先,我们需要收集QQ音乐的所有必要文件和组件。这些可以包括安装程序本身、QQ音乐的可执行文件、音乐文件和其他必要的库文件。 然后,我们可以使用Inno Setup的脚本语言来编写安装程序的脚本。脚本语言可以定义安装程序的界面、安装路径、安装过程中的操作等。我们可以自定义安装界面,例如添加欢迎页面、选择安装路径页面和完成安装页面。 接下来,我们可以在脚本中添加一些自定义逻辑,以便在安装过程中执行一些操作。例如,我们可以添加一个自动运行QQ音乐的选项,在安装完成后自动启动QQ音乐。 在脚本编写完成后,我们可以使用Inno Setup的编译器将脚本编译成可执行的安装程序。编译后的安装程序可以在Windows操作系统上运行,并按照我们在脚本中定义的方式进行安装。 最后,我们可以测试安装程序,确保它可以正常安装和运行。如果有任何错误或问题,我们可以修改脚本,并重新编译安装程序。 总的来说,使用Inno Setup可以非常方便地制作一个仿QQ音乐的安装程序。通过定义安装界面、安装路径和自定义操作,我们可以创建一个与QQ音乐类似的安装程序,使用户能够轻松安装和享受音乐。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

NotOrdinary

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值