- 浏览: 7806 次
最新评论
#define MyAppName "PPTV"
#define MyAppExeName"PPTV"
#define MyAppVersion "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\Start Menu\Programs\PPLive\{#MyAppName}\{#MyAppName}; Filename: {app}\Program\Thunder.exe; WorkingDir: {app}; Check: StartMenu;
//开始菜单快捷方式
Name: C:\ProgramData\Microsoft\Windows\Start Menu\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\Internet Explorer\Quick Launch\User Pinned\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: dontcopy solidbreak ; Attribs: hidden system
//Source: "D:\软件\迅雷7\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
//以上是包含文件夹的目录
//包含文件夹recursesubdirs createallsubdirs 卸载时不删除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
function ImgLoad(Wnd :HWND; FileNameAnsiChar; 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';
//安装过程图片轮播
function NewWebWnd(hWndParent: HWND; X, Y, nWidth, nHeight: Integer): HWND; external 'newwebwnd@files:webctrl.dll stdcall';
function FreeAllWebWnd(): Boolean; external 'freeallwebwnd@files:webctrl.dll stdcall';
function WebWndSetParent(hWndWeb: HWND; hWndParent: HWND): Boolean; external 'webwndsetparent@files:webctrl.dll stdcall';
function DisplayHTMLPage(hWndWeb: HWND; lpsURL: PChar): Boolean; external 'displayhtmlpage@files:webctrl.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
//取消窗口
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;
//百分比
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;
PrLabel.Caption:=IntToStr(Round(pr))+'%';
w:=Round(451*pr/100);
if w<460 then
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;
//磁盘
function NumToStr(Float: Extended): string;
begin
Result:=Format('%.2n', [Float]);
end;
function MbOrTB(Float: Extended): string;
begin
if Float<1024 then Result:=NumToStr(Float)+' MB'
else if (Float/1024)<1024 then Result:=NumToStr(Float/1024)+' GB'
else if (Float/(1024*1024))<1024 then Result:=NumToStr(Float/(1024*1024))+' TB'
end;
procedure GetFreeSpaceCaption(Sender: TObject);
begin
WizardForm.DirEdit.Text:=WizardForm.DirEdit.Text;
if GetSpaceOnDisk(ExtractFileDrive(WizardForm.DirEdit.Text),True,FreeMB,TotalMB) then
begin
WelTx2.Font.Color :=clSilver;
WelTx2.Caption:= ExpandConstant('可用空间: ') + MbOrTB(FreeMB) ;
BtnSetEnabled(NextBtn,true)
end else
begin
WelTx2.Font.Color:=clRed
WelTx2.Caption:= '错误安装路径或者空间不足';
if WelTx2.Caption='错误安装路径或者空间不足'then
begin
BtnSetEnabled(NextBtn,false)
end
end
end;
//窗口移动
//procedure WizardFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
//begin
// ReleaseCapture
// SendMessage(WizardForm.Handle, WM_SYSCOMMAND, $F012, 0)
//end;
//*************外框**************
procedure WizardMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture
SendMessage(WizardForm.Handle, WM_SYSCOMMAND, $F012, 0)
end;
procedure WizardFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
IsFrameDragging:=True;
dx:=X;
dy:=Y;
end;
procedure WizardFormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
IsFrameDragging:=False;
WizardForm.Show;
end;
procedure WizardFormMouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);
begin
if IsFrameDragging then begin
WizardForm.Left:=WizardForm.Left+X-dx;
WizardForm.Top:=WizardForm.Top+Y-dy;
Frame.Left:=WizardForm.Left-10;
Frame.Top:=WizardForm.Top-10;
end;
end;
procedure frameFormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
WizardForm.Show;
end;
procedure WizardFormcc;
begin
WizardForm.OnMouseDown:=@WizardFormMouseDown;
WizardForm.OnMouseUp:=@WizardFormMouseUp;
WizardForm.OnMouseMove:=@WizardFormMouseMove;
end;
procedure CreateFrame;
begin
IsFrameDragging:=False;
Frame:=TForm.Create(nil);;
Frame.BorderStyle:=bsNone;
CreateFormFromImage(Frame.Handle,ExpandConstant('{tmp}\bg00.png'));
with TLabel.Create(Frame) do begin
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;
//*************外框**************
//“快速安装”按钮点击事件
procedure NextBtn1Click(hBtn:HWND);
begin
WizardForm.NextButton.Click;
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 MinBtnOnClick(hBtn:HWND);
begin
SendMessage(WizardForm.Handle,WM_SYSCOMMAND,61472,0);
end;
//取消窗口
procedure CancelFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture
SendMessage(CancelForm.Handle, WM_SYSCOMMAND, $F012, 0)
end;
//“立即体验”按钮点击事件
procedure FinbtnClick(hBtn:HWND);
begin
WizardForm.NextButton.Click;
end;
//取消窗口关闭按钮
procedure CancelCloseBtnOnClick(hBtn:HWND);
begin
CancelForm.close;
end;
//确定按钮
procedure OKBtnOnClick(hBtn:HWND);
begin
OKButton.Click;
end;
//取消窗口取消按钮
procedure CancelBtnOnClick(hBtn:HWND);
begin
CancelForm.close;
end;
//全局取消按钮点击事件
procedure CancelbtnClick(hBtn:HWND);
begin
WizardForm.CancelButton.Click;
end;
//************注册表*********************
Function regedit(): Boolean;
begin
if BtngetChecked(Finbtn) = True then
Result :=BtngetChecked(Finbtn)
end;
//***********添加桌面快捷方式***************
Function desktop(): Boolean;
begin
if BtngetChecked(Finbtn) = True then
Result :=BtngetChecked(Finbtn)
end;
//************开始菜单栏*************
Function StartMenu(): Boolean;
begin
if BtngetChecked(Finbtn) = True then
Result :=BtngetChecked(Finbtn)
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if PageID=wpSelectComponents then //跳过组件安装界面
result := true;
end;
procedure InitializeWizard();
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;
if GetSpaceOnDisk(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;
//**************取消对话框************************
procedure CancelButtonClick(CurPageID: Integer; var Cancel, 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);
if CancelForm.ShowModal = mrOK then
begin
Cancel := True;
end
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(Startbtn,false);BtnSetVisibility(MinBtn,True);
WelTx1.hide;WelTx2.hide;
Edit1.hide;
PrLabel.hide;PrLabel1.hide;
BtnSetVisibility(nextbtn1,false);
if CurPageID = wpWelcome then
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;
if CurPageID = wpInstalling then
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;
if CurPageID = wpFinished then
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;
procedure DeinitializeSetup();
begin
gdipShutdown; //背景图
if PBOldProc<>0 then SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
end;
//安装结束,点"完成"之后运行程序
procedure CurStepChanged(CurStep: TSetupStep);
var
RCode: Integer;
begin
if (CurStep=ssDone)then
Exec(ExpandConstant('{app}\Program\Thunder.exe'), '', '', SW_SHOW, ewNoWait, RCode);
end;
#define MyAppExeName"PPTV"
#define MyAppVersion "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\Start Menu\Programs\PPLive\{#MyAppName}\{#MyAppName}; Filename: {app}\Program\Thunder.exe; WorkingDir: {app}; Check: StartMenu;
//开始菜单快捷方式
Name: C:\ProgramData\Microsoft\Windows\Start Menu\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\Internet Explorer\Quick Launch\User Pinned\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: dontcopy solidbreak ; Attribs: hidden system
//Source: "D:\软件\迅雷7\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
//以上是包含文件夹的目录
//包含文件夹recursesubdirs createallsubdirs 卸载时不删除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
function ImgLoad(Wnd :HWND; FileNameAnsiChar; 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';
//安装过程图片轮播
function NewWebWnd(hWndParent: HWND; X, Y, nWidth, nHeight: Integer): HWND; external 'newwebwnd@files:webctrl.dll stdcall';
function FreeAllWebWnd(): Boolean; external 'freeallwebwnd@files:webctrl.dll stdcall';
function WebWndSetParent(hWndWeb: HWND; hWndParent: HWND): Boolean; external 'webwndsetparent@files:webctrl.dll stdcall';
function DisplayHTMLPage(hWndWeb: HWND; lpsURL: PChar): Boolean; external 'displayhtmlpage@files:webctrl.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
//取消窗口
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;
//百分比
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;
PrLabel.Caption:=IntToStr(Round(pr))+'%';
w:=Round(451*pr/100);
if w<460 then
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;
//磁盘
function NumToStr(Float: Extended): string;
begin
Result:=Format('%.2n', [Float]);
end;
function MbOrTB(Float: Extended): string;
begin
if Float<1024 then Result:=NumToStr(Float)+' MB'
else if (Float/1024)<1024 then Result:=NumToStr(Float/1024)+' GB'
else if (Float/(1024*1024))<1024 then Result:=NumToStr(Float/(1024*1024))+' TB'
end;
procedure GetFreeSpaceCaption(Sender: TObject);
begin
WizardForm.DirEdit.Text:=WizardForm.DirEdit.Text;
if GetSpaceOnDisk(ExtractFileDrive(WizardForm.DirEdit.Text),True,FreeMB,TotalMB) then
begin
WelTx2.Font.Color :=clSilver;
WelTx2.Caption:= ExpandConstant('可用空间: ') + MbOrTB(FreeMB) ;
BtnSetEnabled(NextBtn,true)
end else
begin
WelTx2.Font.Color:=clRed
WelTx2.Caption:= '错误安装路径或者空间不足';
if WelTx2.Caption='错误安装路径或者空间不足'then
begin
BtnSetEnabled(NextBtn,false)
end
end
end;
//窗口移动
//procedure WizardFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
//begin
// ReleaseCapture
// SendMessage(WizardForm.Handle, WM_SYSCOMMAND, $F012, 0)
//end;
//*************外框**************
procedure WizardMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture
SendMessage(WizardForm.Handle, WM_SYSCOMMAND, $F012, 0)
end;
procedure WizardFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
IsFrameDragging:=True;
dx:=X;
dy:=Y;
end;
procedure WizardFormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
IsFrameDragging:=False;
WizardForm.Show;
end;
procedure WizardFormMouseMove(Sender: TObject; Shift: TShiftState; X,Y: Integer);
begin
if IsFrameDragging then begin
WizardForm.Left:=WizardForm.Left+X-dx;
WizardForm.Top:=WizardForm.Top+Y-dy;
Frame.Left:=WizardForm.Left-10;
Frame.Top:=WizardForm.Top-10;
end;
end;
procedure frameFormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
WizardForm.Show;
end;
procedure WizardFormcc;
begin
WizardForm.OnMouseDown:=@WizardFormMouseDown;
WizardForm.OnMouseUp:=@WizardFormMouseUp;
WizardForm.OnMouseMove:=@WizardFormMouseMove;
end;
procedure CreateFrame;
begin
IsFrameDragging:=False;
Frame:=TForm.Create(nil);;
Frame.BorderStyle:=bsNone;
CreateFormFromImage(Frame.Handle,ExpandConstant('{tmp}\bg00.png'));
with TLabel.Create(Frame) do begin
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;
//*************外框**************
//“快速安装”按钮点击事件
procedure NextBtn1Click(hBtn:HWND);
begin
WizardForm.NextButton.Click;
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 MinBtnOnClick(hBtn:HWND);
begin
SendMessage(WizardForm.Handle,WM_SYSCOMMAND,61472,0);
end;
//取消窗口
procedure CancelFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture
SendMessage(CancelForm.Handle, WM_SYSCOMMAND, $F012, 0)
end;
//“立即体验”按钮点击事件
procedure FinbtnClick(hBtn:HWND);
begin
WizardForm.NextButton.Click;
end;
//取消窗口关闭按钮
procedure CancelCloseBtnOnClick(hBtn:HWND);
begin
CancelForm.close;
end;
//确定按钮
procedure OKBtnOnClick(hBtn:HWND);
begin
OKButton.Click;
end;
//取消窗口取消按钮
procedure CancelBtnOnClick(hBtn:HWND);
begin
CancelForm.close;
end;
//全局取消按钮点击事件
procedure CancelbtnClick(hBtn:HWND);
begin
WizardForm.CancelButton.Click;
end;
//************注册表*********************
Function regedit(): Boolean;
begin
if BtngetChecked(Finbtn) = True then
Result :=BtngetChecked(Finbtn)
end;
//***********添加桌面快捷方式***************
Function desktop(): Boolean;
begin
if BtngetChecked(Finbtn) = True then
Result :=BtngetChecked(Finbtn)
end;
//************开始菜单栏*************
Function StartMenu(): Boolean;
begin
if BtngetChecked(Finbtn) = True then
Result :=BtngetChecked(Finbtn)
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if PageID=wpSelectComponents then //跳过组件安装界面
result := true;
end;
procedure InitializeWizard();
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;
if GetSpaceOnDisk(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;
//**************取消对话框************************
procedure CancelButtonClick(CurPageID: Integer; var Cancel, 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);
if CancelForm.ShowModal = mrOK then
begin
Cancel := True;
end
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(Startbtn,false);BtnSetVisibility(MinBtn,True);
WelTx1.hide;WelTx2.hide;
Edit1.hide;
PrLabel.hide;PrLabel1.hide;
BtnSetVisibility(nextbtn1,false);
if CurPageID = wpWelcome then
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;
if CurPageID = wpInstalling then
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;
if CurPageID = wpFinished then
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;
procedure DeinitializeSetup();
begin
gdipShutdown; //背景图
if PBOldProc<>0 then SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
end;
//安装结束,点"完成"之后运行程序
procedure CurStepChanged(CurStep: TSetupStep);
var
RCode: Integer;
begin
if (CurStep=ssDone)then
Exec(ExpandConstant('{app}\Program\Thunder.exe'), '', '', SW_SHOW, ewNoWait, RCode);
end;
相关推荐
解压压缩包中的 Inno Setup 5.5.zip,运行Inno Setup 5.5\Inno Setup 5\Compil32.exe,右上角可以改变语言。 打开build.iss文件,一些自定义字段请按需修改,点击Inno Setup工具栏中的 ‘绿色小三角’ 来运行脚本,...
Inno Setup是一个为Microsoft Windows应用程序创建安装程序的工具。innoextract允许在非Windows系统下提取此类安装程序,而无需使用wine运行实际的安装程序。innoextract 目前支持由 Inno Setup 1.2.10 到 6.2.1 ...
Inno Setup是一款广泛使用的安装制作程序,尤其受到开发者和软件发行者的青睐。它以其简洁的界面和强大的功能著称,允许用户快速创建专业的Windows安装包。Inno Setup 6.2.1是该软件的一个版本,它可能包含了新功能...
《Inno Setup中文帮助文档》是为软件开发者和系统管理员提供的一款详尽的指南,它主要介绍了Inno Setup的使用方法和配置技巧。Inno Setup是一款功能强大的安装制作工具,常用于创建Windows平台上的应用程序安装包。...
Inno Setup是一款流行的安装制作工具,常用于创建Windows应用程序的安装包。它的最新版本是6.0.3,这个压缩包“InnoSetup6.0.3安装包与中文包.rar”包含了该版本的安装程序以及中文语言包,使得国内用户能够方便地...
Inno Setup是一款流行的安装制作工具,它被广泛用于创建Windows应用程序的安装程序。这款软件以其简单易用的界面和强大的功能而闻名。Inno Setup支持创建单文件安装包,自解压程序,以及多语言安装界面,使得开发者...
**Inno Setup 中文教程** Inno Setup是一款广泛使用的免费安装制作工具,尤其适用于Windows平台。它可以帮助开发者创建自解压安装程序,提供简洁而强大的脚本语言,使得程序的安装、卸载过程更加专业和个性化。这个...
【标题】"innosetup 仿有道云安装包" 涉及的主要知识点是使用Inno Setup创建类似有道云笔记的安装程序。Inno Setup是一款免费且开源的安装制作工具,常用于创建Windows应用程序的安装包,它允许开发者自定义安装界面...
《Inno Setup 5:Windows下的程序打包利器》 Inno Setup 5是一款经典的Windows平台应用程序打包工具,它能够将你的程序(如Tomcat、批处理脚本等)打包成易于安装的.exe文件,使得用户只需点击下一步、下一步,就能...
《InnoSetup安装界面美化深度解析》 InnoSetup,一款强大的Windows安装程序制作工具,以其简洁易用的脚本语言和丰富的自定义功能深受开发者喜爱。本资源包"innosetup安装界面美化.zip"专门针对InnoSetup的安装和...
Inno Setup是一款流行的安装制作工具,它被广泛用于创建Windows应用程序的安装程序。这款软件以其简单易用的脚本语法和强大的功能集而受到开发者们的青睐。本文将深入探讨Inno Setup 6.1.0及其对应的中文翻译包,...
Inno Setup是一款强大的安装包制作工具,尤其适合个人开发者和小型团队使用。它以其免费、易用和功能全面的特点在IT行业中受到了广泛欢迎。这款工具不仅提供了Windows 2000风格的传统安装界面,还支持设计出类似QQ...
InnoSetup是一款流行的安装制作工具,它被广泛用于创建Windows应用程序的安装程序。这款软件以其简单易用的脚本语法和强大的功能集而受到开发者们的青睐。标题中的"innosetup安装包+中文语言包"表明我们拥有Inno...
Inno Setup是一款流行的安装制作工具,它被广泛用于创建Windows应用程序的安装程序。这款软件以其简单易用的脚本语法和强大的功能集而受到开发者们的青睐。标题中的"Inno Setup 6.1.0中文语言包"指的是Inno Setup的...
解决 Inno Setup 制作中文安装包在非中文系统上显示乱码的问题 在制作安装包时,Inno Setup 是一个常用的选择,尤其是在制作中文安装包时。但是,在非中文系统上,Inno Setup 制作的中文安装包常常会出现乱码的问题...
《InnoSetup 5.6.1:打造专业级别的安装程序》 InnoSetup是一款广泛应用于软件安装包制作的工具,其5.6.1版本是该系列的一个经典版本,深受开发者喜爱。这款软件提供了丰富的功能,使得创建具有专业水准的安装程序...
InnoSetup是一款强大的安装制作工具,它使用脚本语言来编写安装程序,具有灵活的定制性和易用性。本文将详细解析"innosetup脚本范例"中的知识点,帮助你理解如何利用InnoSetup创建自定义安装包。 1. **InnoSetup...
InnoSetup是一款强大的安装制作工具,它被广泛用于创建Windows应用程序的安装程序。这款工具以其易用性、灵活性和自定义能力而闻名,允许开发者创建专业级别的安装包,包括设置程序路径、添加启动菜单快捷方式、注册...
Inno Setup是一款强大的安装制作工具,广泛用于创建Windows应用程序的安装程序。它的最新版本为6.2.0,这个压缩包包含的就是这个版本及其相关的中文语言包,使得开发者能够为他们的程序提供中文界面,以便更好地服务...
Inno工具是一套用于创建Windows安装程序的专业软件,主要包括InnoSetup和ISTool两个组件,它们都是为了简化软件部署过程而设计的。InnoSetup和ISTool在IT领域中广泛应用于制作精简、用户友好的安装包,尤其适用于...