inno setup pplive yang
#defineMyAppName"PPTV"
#defineMyAppExeName"PPTV"
#defineMyAppVersion"1.0.0.0"
[Setup]
AppName={#MyAppName}
AppVersion={#MyAppName}
AppVerName={#MyAppName}
AppPublisher={#MyAppName}
DefaultDirName={pf}\PPLive\PPTV
DefaultGroupName={#MyAppName}
OutputDir=.
OutputBaseFilename={#MyAppName}
SetupIconFile=install.ico
UninstallIconFile=install.ico
VersionInfoVersion={#MyAppVersion}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoDescription=《{#MyAppName}》安装包
versioninfocopyright=逆风丶蔷薇花瓣出品
VersionInfoProductName={#MyAppName}
VersionInfoProductTextVersion={#MyAppVersion}
VersionInfoProductVersion={#MyAppVersion}
VersionInfoCompany=逆风丶蔷薇花瓣版权所有
DisableReadyPage=yes
DisableProgramGroupPage=yes
DirExistsWarning=no
DisableDirPage=yes
//压缩级别
//InternalCompressLevel=ultra64
//压缩算法
Compression=lzma2/ultra64
[Messages]
BeveledLabel=Copyright(C)2012-2015逆风丶蔷薇花瓣
SetupWindowTitle={#MyAppName}
[Icons]
Name:C:\ProgramData\Microsoft\Windows\StartMenu\Programs\PPLive\{#MyAppName}\{#MyAppName};Filename:{app}\Program\Thunder.exe;WorkingDir:{app};Check:StartMenu;
//开始菜单快捷方式
Name:C:\ProgramData\Microsoft\Windows\StartMenu\Programs\PPLive\{#MyAppName}\卸载{#MyAppName};Filename:{uninstallexe};WorkingDir:{app};Check:StartMenu;
//开始菜单卸载程序
Name:{commondesktop}\{#MyAppName};Filename:{app}\Program\Thunder.exe;WorkingDir:{app};Check:desktop;
//桌面快捷方式
Name:{userappdata}\Microsoft\InternetExplorer\QuickLaunch\UserPinned\TaskBar\{#MyAppName};Filename:{app}\Thunder.exe;WorkingDir:{app};Check:StartMenu;
//开始菜单快速引导栏
[registry]
Root:HKLM;Subkey:"SOFTWARE\Microsoft\Windows\CurrentVersion\Run";ValueType:string;ValueName:"PPTV";ValueData:"{app}\Program\Thunder.exe";check:regedit;
//开机自启动注册表
[Files]
Source:{tmp}\*;DestDir:{tmp};Flags:dontcopysolidbreak;Attribs:hiddensystem
//Source:"D:\软件\迅雷7\*";DestDir:"{app}";Flags:ignoreversionrecursesubdirscreateallsubdirs
//以上是包含文件夹的目录
//包含文件夹recursesubdirscreateallsubdirs卸载时不删除uninsneveruninstall卸载时删除ignoreversion
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
functionImgLoad(Wnd:HWND;FileNameAnsiChar;Left,Top,Width,Height:integer;Stretch,IsBkg:boolean):Longint;external'ImgLoad@{tmp}\botva2.dllstdcalldelayload';
procedureImgSetVisibility(img:Longint;Visible:boolean);external'ImgSetVisibility@{tmp}\botva2.dllstdcalldelayload';
procedureImgApplyChanges(h:HWND);external'ImgApplyChanges@{tmp}\botva2.dllstdcalldelayload';
procedureImgSetPosition(img:Longint;NewLeft,NewTop,NewWidth,NewHeight:integer);external'ImgSetPosition@files:botva2.dllstdcall';
procedureImgSetTransparent(img:Longint;Value:integer);external'ImgSetTransparent@{tmp}\botva2.dllstdcalldelayload';
procedureImgRelease(img:Longint);external'ImgRelease@{tmp}\botva2.dllstdcalldelayload';
proceduregdipShutdown;external'gdipShutdown@{tmp}\botva2.dllstdcalldelayload';
functionWrapBtnCallback(Callback:TBtnEventProc;ParamCount:Integer):Longword;external'wrapcallback@{tmp}\innocallback.dllstdcalldelayload';
functionBtnCreate(hParent:HWND;Left,Top,Width,Height:integer;FileName:PAnsiChar;ShadowWidth:integer;IsCheckBtn:boolean):HWND;external'BtnCreate@{tmp}\botva2.dllstdcalldelayload';
procedureBtnSetText(h:HWND;Text:PAnsiChar);external'BtnSetText@{tmp}\botva2.dllstdcalldelayload';
procedureBtnSetVisibility(h:HWND;Value:boolean);external'BtnSetVisibility@{tmp}\botva2.dllstdcalldelayload';
procedureBtnSetFont(h:HWND;Font:Cardinal);external'BtnSetFont@{tmp}\botva2.dllstdcalldelayload';
procedureBtnSetFontColor(h:HWND;NormalFontColor,FocusedFontColor,PressedFontColor,DisabledFontColor:Cardinal);external'BtnSetFontColor@{tmp}\botva2.dllstdcalldelayload';
procedureBtnSetEvent(h:HWND;EventID:integer;Event:Longword);external'BtnSetEvent@{tmp}\botva2.dllstdcalldelayload';
procedureBtnSetCursor(h:HWND;hCur:Cardinal);external'BtnSetCursor@{tmp}\botva2.dllstdcalldelayload';
procedureBtnSetEnabled(h:HWND;Value:boolean);external'BtnSetEnabled@{tmp}\botva2.dllstdcalldelayload';
functionGetSysCursorHandle(id:integer):Cardinal;external'GetSysCursorHandle@{tmp}\botva2.dllstdcalldelayload';
functionBtnGetChecked(h:HWND):boolean;external'BtnGetChecked@{tmp}\botva2.dllstdcalldelayload';
procedureBtnSetChecked(h:HWND;Value:boolean);external'BtnSetChecked@{tmp}\botva2.dllstdcalldelayload';
procedureCreateFormFromImage(h:HWND;FileName:PAnsiChar);external'CreateFormFromImage@{tmp}\botva2.dllstdcalldelayload';
functionSetWindowLong(Wnd:HWnd;Index:Integer;NewLong:Longint):Longint;external'[email protected]';
functionPBCallBack(P:TPBProc;ParamCount:integer):LongWord;external'wrapcallback@files:innocallback.dllstdcall';
functionCallWindowProc(lpPrevWndFunc:Longint;hWnd:HWND;Msg:UINT;wParam,lParam:Longint):Longint;external'[email protected]';
procedureImgSetVisiblePart(img:Longint;NewLeft,NewTop,NewWidth,NewHeight:integer);external'ImgSetVisiblePart@files:botva2.dllstdcall';
functionSetLayeredWindowAttributes(hwnd:HWND;crKey:Longint;bAlpha:byte;dwFlags:longint):longint;
external'SetLayeredWindowAttributes@user32stdcall';
functionSetClassLong(hWnd:HWND;nlndex:integer;dwNewLong:integer):integer;external'SetClassLongA@user32stdcall';
functionGetClassLong(IntPtr:hwnd;nIndex:integer):integer;external'GetClassLongA@user32stdcall';
functionCreateRoundRectRgn(p1,p2,p3,p4,p5,p6:Integer):THandle;external'CreateRoundRectRgn@gdi32stdcall';
functionSetWindowRgn(hWnd:HWND;hRgn:THandle;bRedraw:Boolean):Integer;external'SetWindowRgn@user32stdcall';
functionReleaseCapture():Longint;external'[email protected]';
//安装过程图片轮播
functionNewWebWnd(hWndParent:HWND;X,Y,nWidth,nHeight:Integer):HWND;external'newwebwnd@files:webctrl.dllstdcall';
functionFreeAllWebWnd():Boolean;external'freeallwebwnd@files:webctrl.dllstdcall';
functionWebWndSetParent(hWndWeb:HWND;hWndParent:HWND):Boolean;external'webwndsetparent@files:webctrl.dllstdcall';
functionDisplayHTMLPage(hWndWeb:HWND;lpsURL:PChar):Boolean;external'displayhtmlpage@files:webctrl.dllstdcall';
//窗口圆角
procedureShapeForm(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
//取消窗口
CancelImage:Longint;
CancelForm:TSetupForm;
OKButton:TButton;
//右上角按钮+取消窗口
CloseBtn,CancelCloseBtn:HWND;
IconI:HWND;
//最小化窗口按钮
MinBtn:HWND;
//按钮
OKBtn,CancelFormBtn:HWND;
//窗口
WizardFormImage:Longint;
gddh,pbImg,pbbgImg:Longint;
//按钮
CancelBtn,backBtn,Startbtn,NextBtn,nextbtn1,DirBrowseBtn,Finbtn:HWND;
//勾选框
A2Check,A3Check,A4Check,A5Check,A6Check,A7Check,A8Check:HWND;
//文字标签
Label1,Label2,Label3,Label4,Label5,Label6,Label7,Label8,Label9,Label10:tlabel;
Label11,Label12,Label13:tlabel;
Edit1:Tedit;
WelTx1,WelTx2,PrLabel,PrLabel1:Tlabel;
//硬盘显示
FreeMB,TotalMB:Cardinal;
PBOldProc:Longint;
//阴影框
IsFrameDragging:boolean;
dx,dy,dh1:integer;
Frame:TForm;
//按钮文字
WFButtonFont:tfont;
//安装过程图片
InstallingImage:HWND;
//百分比
functionPBProc(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)thenbegin
i1:=WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min;
i2:=WizardForm.ProgressGauge.Max-WizardForm.ProgressGauge.Min;
pr:=i1*100/i2;
PrLabel.Caption:=IntToStr(Round(pr))+'%';
w:=Round(451*pr/100);
ifw<460then
begin
ImgSetPosition(pbImg,18+w,327,99,25);
end;
ImgSetPosition(pbImg,20,327,w,25);
//ImgSetVisiblePart(pbImg,0,0,w,25);
ImgApplyChanges(WizardForm.Handle);
end;
end;
//磁盘
functionNumToStr(Float:Extended):string;
begin
Result:=Format('%.2n',[Float]);
end;
functionMbOrTB(Float:Extended):string;
begin
ifFloat<1024thenResult:=NumToStr(Float)+'MB'
elseif(Float/1024)<1024thenResult:=NumToStr(Float/1024)+'GB'
elseif(Float/(1024*1024))<1024thenResult:=NumToStr(Float/(1024*1024))+'TB'
end;
procedureGetFreeSpaceCaption(Sender:TObject);
begin
WizardForm.DirEdit.Text:=WizardForm.DirEdit.Text;
ifGetSpaceOnDisk(ExtractFileDrive(WizardForm.DirEdit.Text),True,FreeMB,TotalMB)then
begin
WelTx2.Font.Color:=clSilver;
WelTx2.Caption:=ExpandConstant('可用空间:')+MbOrTB(FreeMB);
BtnSetEnabled(NextBtn,true)
endelse
begin
WelTx2.Font.Color:=clRed
WelTx2.Caption:='错误安装路径或者空间不足';
ifWelTx2.Caption='错误安装路径或者空间不足'then
begin
BtnSetEnabled(NextBtn,false)
end
end
end;
//窗口移动
//procedureWizardFormMouseDown(Sender:TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
//begin
//ReleaseCapture
//SendMessage(WizardForm.Handle,WM_SYSCOMMAND,$F012,0)
//end;
//*************外框**************
procedureWizardMouseDown(Sender:TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
begin
ReleaseCapture
SendMessage(WizardForm.Handle,WM_SYSCOMMAND,$F012,0)
end;
procedureWizardFormMouseDown(Sender:TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
begin
IsFrameDragging:=True;
dx:=X;
dy:=Y;
end;
procedureWizardFormMouseUp(Sender:TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
begin
IsFrameDragging:=False;
WizardForm.Show;
end;
procedureWizardFormMouseMove(Sender:TObject;Shift:TShiftState;X,Y:Integer);
begin
ifIsFrameDraggingthenbegin
WizardForm.Left:=WizardForm.Left+X-dx;
WizardForm.Top:=WizardForm.Top+Y-dy;
Frame.Left:=WizardForm.Left-10;
Frame.Top:=WizardForm.Top-10;
end;
end;
procedureframeFormMouseUp(Sender:TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
begin
WizardForm.Show;
end;
procedureWizardFormcc;
begin
WizardForm.OnMouseDown:=@WizardFormMouseDown;
WizardForm.OnMouseUp:=@WizardFormMouseUp;
WizardForm.OnMouseMove:=@WizardFormMouseMove;
end;
procedureCreateFrame;
begin
IsFrameDragging:=False;
Frame:=TForm.Create(nil);;
Frame.BorderStyle:=bsNone;
CreateFormFromImage(Frame.Handle,ExpandConstant('{tmp}\bg00.png'));
withTLabel.Create(Frame)dobegin
Parent:=Frame;
AutoSize:=false;
Left:=0;
Top:=0;
Width:=Frame.CLientWidth;
Height:=Frame.ClientHeight;
OnMouseDown:=@frameFormMouseUp;
end;
WizardForm.Left:=Frame.Left+10;
WizardForm.Top:=Frame.Top+10;
Frame.Show;
end;
//*************外框**************
//“快速安装”按钮点击事件
procedureNextBtn1Click(hBtn:HWND);
begin
WizardForm.NextButton.Click;
end;
//“浏览”按钮点击事件
procedureEditdirOnClick(hBtn:HWND);
begin
WizardForm.DirBrowseButton.Click;
Edit1.Text:=WizardForm.DirEdit.Text;
end;
//“自定义目录”修改
procedureEditchanged(Sender:TObject);
begin
WizardForm.DirEdit.Text:=Edit1.Text;
end;
//最小化按钮
procedureMinBtnOnClick(hBtn:HWND);
begin
SendMessage(WizardForm.Handle,WM_SYSCOMMAND,61472,0);
end;
//取消窗口
procedureCancelFormMouseDown(Sender:TObject;Button:TMouseButton;Shift:TShiftState;X,Y:Integer);
begin
ReleaseCapture
SendMessage(CancelForm.Handle,WM_SYSCOMMAND,$F012,0)
end;
//“立即体验”按钮点击事件
procedureFinbtnClick(hBtn:HWND);
begin
WizardForm.NextButton.Click;
end;
//取消窗口关闭按钮
procedureCancelCloseBtnOnClick(hBtn:HWND);
begin
CancelForm.close;
end;
//确定按钮
procedureOKBtnOnClick(hBtn:HWND);
begin
OKButton.Click;
end;
//取消窗口取消按钮
procedureCancelBtnOnClick(hBtn:HWND);
begin
CancelForm.close;
end;
//全局取消按钮点击事件
procedureCancelbtnClick(hBtn:HWND);
begin
WizardForm.CancelButton.Click;
end;
//************注册表*********************
Functionregedit():Boolean;
begin
ifBtngetChecked(Finbtn)=Truethen
Result:=BtngetChecked(Finbtn)
end;
//***********添加桌面快捷方式***************
Functiondesktop():Boolean;
begin
ifBtngetChecked(Finbtn)=Truethen
Result:=BtngetChecked(Finbtn)
end;
//************开始菜单栏*************
FunctionStartMenu():Boolean;
begin
ifBtngetChecked(Finbtn)=Truethen
Result:=BtngetChecked(Finbtn)
end;
functionShouldSkipPage(PageID:Integer):Boolean;
begin
ifPageID=wpSelectComponentsthen//跳过组件安装界面
result:=true;
end;
procedureInitializeWizard();
begin
ExtractTemporaryFile('bg00.png');
ExtractTemporaryFile('bg01t.png');
ExtractTemporaryFile('bg02t.png');
ExtractTemporaryFile('bg03t.png');
ExtractTemporaryFile('bg01.png');
ExtractTemporaryFile('bg02.png');
ExtractTemporaryFile('bg03.png');
ExtractTemporaryFile('bg_cancel.png');
ExtractTemporaryFile('change.png');
ExtractTemporaryFile('close.png');
ExtractTemporaryFile('mini.png');
ExtractTemporaryFile('install.png');
ExtractTemporaryFile('cancel_ok.png');
ExtractTemporaryFile('cancel_back.png');
ExtractTemporaryFile('Pbbg.png');
ExtractTemporaryFile('Pbjd.png');
ExtractTemporaryFile('finish.png');
ExtractTemporaryFile('newfeather1.png');
ExtractTemporaryFile('newfeather2.png');
ExtractTemporaryFile('newfeather3.png');
ExtractTemporaryFile('newfeather4.png');
ExtractTemporaryFile('InstallingImage.htm');
WizardForm.BorderStyle:=bsnone
//主界面框大小
WizardForm.Width:=582
WizardForm.Height:=360
WizardForm.OnMouseDown:=@WizardFormMouseDown;
WizardFormcc;
CreateFrame;
//ShapeForm(WizardForm,radius);//圆角
WFButtonFont:=TFont.Create;
WFButtonFont.Name:='微软雅黑'
WFButtonFont.Size:=9;
//SetClassLong:=(Wizard.Handle,-26,GetWindowLong(WinzardForm.Handle,-26)+$20000);
WizardFormImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg01t.png'),(-10),(-10),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
//卸载界面左下角文字
WizardForm.OuterNotebook.Hide;
WizardForm.Bevel.Hide;
WizardForm.BeveledLabel.Width:=0
WizardForm.BeveledLabel.Height:=0
//****************全局界面按钮****************
//最小化按钮
MinBtn:=BtnCreate(WizardForm.Handle,518,8,30,31,ExpandConstant('{tmp}\mini.png'),3,False);
BtnSetEvent(MinBtn,BtnClickEventID,WrapBtnCallback(@MinBtnOnClick,1));
//取消按钮
CancelBtn:=BtnCreate(WizardForm.Handle,543,8,30,31,ExpandConstant('{tmp}\close.png'),1,False)
BtnSetEvent(CancelBtn,BtnClickEventID,WrapBtnCallback(@CancelBtnClick,1));
//**************第一页字体和按钮******************
//**************第一页字体和按钮******************
Edit1:=TEdit.Create(WizardForm);
Edit1.Parent:=WizardForm;
Edit1.Text:=WizardForm.DirEdit.Text;//自定义目录文字
Edit1.Font.Size:=9
Edit1.Left:=23;
Edit1.Top:=306;
Edit1.Width:=340
Edit1.Height:=14
Edit1.BorderStyle:=bsnone;
Edit1.Font.Color:=clBlack
Edit1.Font.Name:='微软雅黑'
Edit1.OnChange:=@Editchanged;
//“立即安装”按钮
nextbtn1:=BtnCreate(WizardForm.Handle,199,230,188,58,ExpandConstant('{tmp}\install.png'),1,False);
BtnSetEvent(nextbtn1,BtnClickEventID,WrapBtnCallback(@NextBtn1Click,1));
BtnSetFontColor(nextbtn1,clWhite,clWhite,clWhite,clWhite);
//浏览
DirBrowseBtn:=BtnCreate(WizardForm.Handle,504,305,60,20,ExpandConstant('{tmp}\change.png'),1,False);
BtnSetEvent(DirBrowseBtn,BtnClickEventID,WrapBtnCallback(@EditdirOnClick,1));
BtnSetFont(DirBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(DirBrowseBtn,clWhite,clblack,clblack,clblack);
BtnSetText(DirBrowseBtn,ExpandConstant('更改'));
//**************磁盘大小显示*******************
WelTx1:=TLabel.Create(WizardForm);
WelTx1.AutoSize:=False;
WelTx1.SetBounds(18,328,ScaleX(500),ScaleY(17));
WelTx1.Transparent:=True;
WelTx1.Font.Color:=clSilver;
WelTx1.Font.Size:=10
WelTx1.Font.Name:='微软雅黑';
WelTx1.Caption:=ExpandConstant('所需空间:')+MbOrTB(176.62);
WelTx1.Parent:=WizardForm;
WelTx2:=TLabel.Create(WizardForm);
WelTx2.AutoSize:=False;
WelTx2.SetBounds(160,328,ScaleX(500),ScaleY(17));
WelTx2.Transparent:=True;
WelTx2.Font.Color:=clSilver;
WelTx2.Font.Size:=10
WelTx2.Font.Name:='微软雅黑';
WelTx2.Parent:=WizardForm;
ifGetSpaceOnDisk(ExtractFileDrive(WizardForm.DirEdit.Text),True,FreeMB,TotalMB)then
begin
WelTx2.Caption:=ExpandConstant('可用空间:')+MbOrTB(FreeMB);
end;
WizardForm.DirEdit.OnChange:=@GetFreeSpaceCaption;//更换磁盘后相应事件
//**************磁盘大小显示*******************
//百分比
PrLabel:=TLabel.Create(WizardForm);
PrLabel.Parent:=WizardForm;
PrLabel.Left:=27+48;
PrLabel.Top:=312;;//百分比
PrLabel.Transparent:=True;
PrLabel.Font.Name:='微软雅黑';
PrLabel.Font.Color:=clwhite;
PrLabel1:=TLabel.Create(WizardForm);
PrLabel1.Parent:=WizardForm;
PrLabel1.Left:=20;
PrLabel1.Top:=312;
PrLabel1.Caption:='正在安装';
PrLabel1.Transparent:=True;
PrLabel1.Font.Name:='微软雅黑';
PrLabel1.Font.Color:=clwhite;
PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBCallBack(@PBProc,4));
end;
//**************取消对话框************************
procedureCancelButtonClick(CurPageID:Integer;varCancel,Confirm:Boolean);
var
CancelLabel2:Tlabel;
CancelLabel3:Tlabel;
begin
Cancel:=False;
Confirm:=False;
CancelForm:=CreateCustomForm();
CancelForm.Width:=ScaleX(350);//退出安装对话框大小
CancelForm.Height:=ScaleY(181+15);
CancelForm.BorderStyle:=bsNone;
CancelForm.CenterInsideControl(WizardForm,False);
CancelForm.OnMouseDown:=@CancelFormMouseDown;
CancelImage:=ImgLoad(CancelForm.Handle,ExpandConstant('{tmp}\bg_cancel.png'),(0),(0),350,181,True,True);//退出安装对话框图片
ShapeForm(CancelForm,radius);
//关闭按钮
CancelCloseBtn:=BtnCreate(CancelForm.Handle,316,3,30,31,ExpandConstant('{tmp}\close.png'),3,False);//退出安装对话框右上角按钮
BtnSetEvent(CancelCloseBtn,BtnClickEventID,WrapBtnCallback(@CancelCloseBtnOnClick,1));
//确认键反馈
OKButton:=TButton.Create(CancelForm);
OKButton.Parent:=CancelForm;
OKButton.ModalResult:=mrOk;
OKButton.SetBounds(0,0,0,0);
//退出安装“确定”按钮
OKBtn:=BtnCreate(CancelForm.Handle,172,144,80,26,ExpandConstant('{tmp}\cancel_ok.png'),1,False);
BtnSetEvent(OKBtn,BtnClickEventID,WrapBtnCallback(@OKBtnOnClick,1));
BtnSetFont(OKBtn,WFButtonFont.Handle);
BtnSetFontColor(OKBtn,clwhite,clwhite,clwhite,clwhite);//字体颜色
BtnSetText(OKBtn,ExpandConstant('确定'));
//退出安装“取消”按钮
CancelFormBtn:=BtnCreate(CancelForm.Handle,262,144,80,26,ExpandConstant('{tmp}\cancel_back.png'),1,False);
BtnSetEvent(CancelFormBtn,BtnClickEventID,WrapBtnCallback(@CancelBtnOnClick,1));
BtnSetFont(CancelFormBtn,WFButtonFont.Handle);
BtnSetFontColor(CancelFormBtn,clwhite,clwhite,clwhite,clwhite);//字体颜色
BtnSetText(CancelFormBtn,ExpandConstant('取消'));
ImgApplyChanges(CancelForm.Handle);
ifCancelForm.ShowModal=mrOKthen
begin
Cancel:=True;
end
end;
//****************页面切换****************
procedureCurPageChanged(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(Startbtn,false);BtnSetVisibility(MinBtn,True);
WelTx1.hide;WelTx2.hide;
Edit1.hide;
PrLabel.hide;PrLabel1.hide;
BtnSetVisibility(nextbtn1,false);
ifCurPageID=wpWelcomethen
begin
WizardFormImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg01t.png'),(-10),(-10),602,380,True,True);
BtnSetVisibility(nextbtn1,true);
BtnSetVisibility(Startbtn,true);
BtnSetVisibility(DirBrowseBtn,true);
Edit1.show;
WelTx1.show;WelTx2.show;
end;
ifCurPageID=wpInstallingthen
begin
WizardFormImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg02t.png'),(-10),(-10),602,380,True,True);
pbbgImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Pbbg.png'),20,327,544,25,True,True);
pbImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Pbjd.png'),0,0,99,25,True,True);
InstallingImage:=NewWebWnd(WizardForm.Handle,0,56,582,231);
DisplayHTMLPage(InstallingImage,ExpandConstant('{tmp}\InstallingImage.htm'));
WebWndSetParent(InstallingImage,WizardForm.Handle)
PrLabel.show;PrLabel1.show;
end;
ifCurPageID=wpFinishedthen
begin
WebWndSetParent(InstallingImage,WizardForm.FinishedPage.Handle);
ImgSetVisibility(pbImg,false);ImgSetVisibility(pbbgImg,false);
WizardFormImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg03t.png'),(-10),(-10),602,380,True,True);
Finbtn:=BtnCreate(WizardForm.Handle,195,297,188,58,ExpandConstant('{tmp}\finish.png'),1,False)//完成按钮
BtnSetEvent(Finbtn,BtnClickEventID,WrapBtnCallback(@FinbtnClick,1));
BtnSetEvent(CancelBtn,BtnClickEventID,WrapBtnCallback(@FinbtnClick,1));
end;
ImgApplyChanges(WizardForm.Handle);
end;
procedureDeinitializeSetup();
begin
gdipShutdown;//背景图
ifPBOldProc<>0thenSetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
end;
//安装结束,点"完成"之后运行程序
procedureCurStepChanged(CurStep:TSetupStep);
var
RCode:Integer;
begin
if(CurStep=ssDone)then
Exec(ExpandConstant('{app}\Program\Thunder.exe'),'','',SW_SHOW,ewNoWait,RCode);
end;