`
ydw5271084
  • 浏览: 7512 次
社区版块
存档分类
最新评论

inno setup 360i yang

 
阅读更多
;此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
#include "{image}\fairy.iss"

[Setup]
;安装程序的描述名字
AppName=雨杰棋牌游戏3500
;应用程序版本
AppVersion=3.5.0.0
;应用程序版权所有的公司
VersionInfoCompany=江苏雨杰网络科技有限公司
;应用程序版本信息版权所有
VersionInfoCopyright=Copyright@1998-2015 江苏雨杰网络科技有限公司
;应用程序的评论
AppComments=江苏雨杰网络科技有限公司-中国第一家专业棋牌游戏开发公司
;版本信息
VersionInfoVersion=3.5.0.0
;应用发布
AppPublisher=江苏雨杰网络科技有限公司
;应用发布路径
AppPublisherURL=http://www.cnyxwl.com
;应用程序支持网址
AppSupportURL=http://www.cnyxwl.com
;应用程序更新网址
AppUpdatesURL=http://www.cnyxwl.com
;默认安装路径
DefaultDirName={pf}\yjqp3500
;系统程序目录下创建的快捷目录名
DefaultGroupName=雨杰棋牌游戏3500
;安装包的名字
OutputBaseFilename=雨杰棋牌游戏3500
;压缩模式
Compression=lzma2
;固态压缩模式
SolidCompression=yes
;允许无图标
AllowNoIcons=yes
;设置安装包的ico图标文件
SetupIconFile={image}\installer.ico
;禁用安装完成的页面
DisableReadyPage=yes
;禁用系统程序目录下创建的快捷目录完成的页面 有效值: auto, yes 或 no
DisableProgramGroupPage=yes
;内部压缩级别与算法
InternalCompressLevel=ultra64

;在系统程序目录下创建的快捷目录设置
[Icons]
Name: "{group}\雨杰棋牌游戏中心"; Filename: "{app}\GameLauncher.exe"; WorkingDir: "{app}" ;
Name: "{group}\{cm:ProgramOnTheWeb,雨杰棋牌游戏中心}"; Filename: "http://www.cnyxw.com/"
Name: "{group}\{cm:UninstallProgram,雨杰棋牌游戏中心}"; Filename: "{uninstallexe}";
Name: "{commondesktop}\雨杰棋牌游戏中心"; Filename: "{app}\GameLauncher.exe"; WorkingDir: "{app}" ;
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\雨杰棋牌游戏中心"; Filename: "{app}\GameLauncher.exe"; WorkingDir: "{app}" ;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
;安装包包含的文件
[Files]
Source: "{image}\*"; DestDir: {tmp}; Flags: dontcopy solidbreak;
;Source: "{app}\*";  DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs;


//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com

type
  TPBProc       = function(h:hWnd;Msg,wParam,lParam:Longint):Longint;
  TTimerProc    = procedure(h:longword; msg:longword; idevent:longword; dwTime:longword);
  TBtnEventProc = procedure(h:HWND);

function SetLayeredWindowAttributes(hwnd: HWND; crKey: TColor; bAlpha: BYTE; dwFlags: DWORD): Boolean; external 'SetLayeredWindowAttributes@user32.dll stdcall';
function GetWindowLong(Wnd: HWnd; Index: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall';
function LoadCursorFromFile(FileName: String): Cardinal; external 'LoadCursorFromFileA@user32 stdcall';
function DeleteObject(p1: Longword): BOOL; external 'DeleteObject@gdi32.dll stdcall';
function GetSysColor(nIndex: Integer): DWORD; external 'GetSysColor@user32.dll stdcall';
function GetSystemMetrics(nIndex: Integer): Integer; external 'GetSystemMetrics@user32.dll stdcall';
function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall';
function Sleep(Index: Integer): Longint; external 'Sleep@kernel32.dll stdcall';
function GetTickCount(): Longint; external 'GetTickCount@kernel32.dll stdcall';
function SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function LoadImage(hInst: THandle; ImageName: PChar; ImageType: UINT; X, Y: Integer; Flags: UINT): THandle; external 'LoadImageA@user32.dll stdcall';
function GetDC(hWnd: HWND): Longword; external 'GetDC@user32.dll stdcall';
function SetWindowRgn(hWnd: HWND; hRgn: LongWord; bRedraw: BOOL): Integer;  external 'SetWindowRgn@user32.dll stdcall';
function ReleaseDC(hWnd: HWND; hDC: LongWord): Integer; external 'ReleaseDC@user32.dll stdcall';
function AddFontResource(FileName: PAnsiChar): Integer; external 'AddFontResourceA@gdi32.dll stdcall';
function RemoveFontResource(FileName: PAnsiChar): BOOL; external 'RemoveFontResourceA@gdi32.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';
function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';
function WrapTimerProc(callback: TTimerProc; Paramcount: Integer): Longword; external 'wrapcallback@files:innocallback.dll stdcall';
function mciSendString(lpstrCommand, lpstrReturnString: PAnsiChar; uReturnLength: Cardinal; hWndCallback: HWND): Cardinal; external 'mciSendStringA@winmm.dll stdcall';
function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall';
procedure CreateFormFromImage(h:HWND; FileName:PAnsiChar); external 'CreateFormFromImage@files:botva2.dll stdcall';
function CreateBitmapRgn(DC: LongWord; Bitmap: HBITMAP; TransClr: DWORD; dX:integer; dY:integer): LongWord; external 'CreateBitmapRgn@files:botva2.dll stdcall';
procedure SetMinimizeAnimation(Value: Boolean); external 'SetMinimizeAnimation@files:botva2.dll stdcall';
function GetMinimizeAnimation: Boolean; external 'GetMinimizeAnimation@files:botva2.dll stdcall';
function ImgLoad(Wnd :HWND; FileNameAnsiChar; Left, Top, Width, Height :integer; Stretch, IsBkg :boolean) :Longint; external 'ImgLoad@files:botva2.dll stdcall';
procedure ImgSetVisiblePart(img:Longint; NewLeft, NewTop, NewWidth, NewHeight : integer); external 'ImgSetVisiblePart@files:botva2.dll stdcall';
procedure ImgSetVisibility(img :Longint; Visible :boolean); external 'ImgSetVisibility@files:botva2.dll stdcall';
function ImgGetVisibility(img:Longint):boolean; external 'ImgGetVisibility@files:botva2.dll stdcall';
procedure ImgApplyChanges(h:HWND); external 'ImgApplyChanges@files:botva2.dll stdcall';
procedure ImgSetPosition(img :Longint; NewLeft, NewTop, NewWidth, NewHeight :integer); external 'ImgSetPosition@files:botva2.dll stdcall';
function BtnCreate(hParent :HWND; Left, Top, Width, Height :integer; FileNameAnsiChar; ShadowWidth :integer; IsCheckBtn :boolean) :HWND; external 'BtnCreate@files:botva2.dll stdcall';
procedure BtnSetEvent(h :HWND; EventID :integer; Event :Longword); external 'BtnSetEvent@files:botva2.dll stdcall';
function WrapBtnCallback(Callback: TBtnEventProc; ParamCount: Integer): Longword; external 'wrapcallback@files:innocallback.dll stdcall delayload';
procedure gdipShutdown; external 'gdipShutdown@files:botva2.dll stdcall';
procedure BtnSetFont(h :HWND; Font :Cardinal); external 'BtnSetFont@files:botva2.dll stdcall';
procedure BtnSetText(h :HWND; TextAnsiChar); external 'BtnSetText@files:botva2.dll stdcall';
procedure BtnSetFontColor(h :HWND; NormalFontColor, FocusedFontColor, PressedFontColor, DisabledFontColor :Cardinal); external 'BtnSetFontColor@files:botva2.dll stdcall';
procedure BtnSetEnabled(h :HWND; Value :boolean); external 'BtnSetEnabled@files:botva2.dll stdcall';
procedure BtnSetVisibility(h :HWND; Value :boolean); external 'BtnSetVisibility@files:botva2.dll stdcall';
function BtnGetChecked(h :HWND) :boolean; external 'BtnGetChecked@files:botva2.dll stdcall';
procedure BtnSetChecked(h :HWND; Value :boolean); external 'BtnSetChecked@files:botva2.dll stdcall';
procedure ImgRelease(img :Longint); external 'ImgRelease@files:botva2.dll stdcall delayload';

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
const
  TransparentColor = $ffffff;
  TransparentPercent = 80;
  WS_EX_LAYERED = $80000;
  WS_EX_TRANSPARENT = $20;
  LWA_COLORKEY = 1;
  LWA_ALPHA = 2;
  GWL_EXSTYLE = (-20);

  SM_CYBORDER = 6;
  SM_CYDLGFRAME = 8;
  WM_SYSCOMMAND = $0112;
  //鼠标指向
  MyCursor1 = 101;
  MyCursor2 = 102;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//按钮
  BtnClickEventID      = 1;
  BtnMouseEnterEventID = 2;
var
M_top,M_left,l_top,l_left :Longint;
Nun :Longint;
Frame0,Frame1: TForm;
WizardFormImage: Longint; //背景图
MinBtn,CloseBtn,NextBtn: HWND; //右上角按钮+取消窗口
//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//快捷方式选框
DesktopCheck,licenseCheck,RunAppCheck: HWND; //
DesktopLabel,licenseLabel,licenseLabelFile,PackFilePathLabel,PackFilePathTitle,RunAppLabel: TLabel;//
timer1 :TTimer;
gy,dh,io:integer;
//百分比
PrLabel: TLabel;
PBOldProc : Longint;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//百分比                     1211
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;
    sleep(50);
    PrLabel.Caption:=IntToStr(Round(pr))+'%';
    //显示图片进度 这个脚本用不着
//    w:=Round(797*pr/100);
//    ImgSetPosition(progressbgImg,2,230,w,23);
//    ImgSetVisiblePart(progressbgImg,0,0,w,23);
//    ImgApplyChanges(WizardForm.Handle);
  end;
end;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//快捷方式
Function DesktopCheckClick(): Boolean;
begin
  if BtnGetChecked(DesktopCheck) = true then
      Result := true;
end;


function ColorToRGB(Color: TColor): Longint;
begin
  if Color < 0 then
    Result := GetSysColor(Color and $000000FF)
  else
    Result := Color;
end;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//释放文件到临时目录
procedure ExtractTmpFiles;
var
  i : Integer;
  ImgFile: AnsiString;
begin
  ExtractTemporaryFile('bg0.png');
  ExtractTemporaryFile('bg.png');
  ExtractTemporaryFile('MinBtn.png');
  ExtractTemporaryFile('CloseBtn.png');
  ExtractTemporaryFile('install.png');
  ExtractTemporaryFile('CheckBox.png');
  ExtractTemporaryFile('pr.png');
  ExtractTemporaryFile('license.txt');
  ExtractTemporaryFile('dh0.png');
  ExtractTemporaryFile('dh1.png');
  ExtractTemporaryFile('dh2.png');
  ExtractTemporaryFile('dh3.png');
  ExtractTemporaryFile('dh4.png');

  for i := 0 to 23 do
  begin
    ImgFile := format('%.1d',[i+1])+'.png';
    ExtractTemporaryFile(ImgFile);
  end;

end;

procedure Timer1Timer(Sender: TObject);
begin
  gy:=gy+1;
  if gy=io then
  begin
  CreateFormFromImage(Frame1.Handle,ExpandConstant('{tmp}\dh1.png'));
  end;
  if gy=io*2 then
  begin
  CreateFormFromImage(Frame1.Handle,ExpandConstant('{tmp}\dh2.png'));
  end;
  if gy=io*3 then
  begin
  CreateFormFromImage(Frame1.Handle,ExpandConstant('{tmp}\dh3.png'));
  end;
  if gy=io*4 then
  begin
  CreateFormFromImage(Frame1.Handle,ExpandConstant('{tmp}\dh4.png'));
  end;
  if gy=io*5 then
  begin
  CreateFormFromImage(Frame1.Handle,ExpandConstant('{tmp}\dh0.png'));
  gy:=0;
  end;
  ImgApplyChanges(Frame1.Handle);
end;

procedure WizardFormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin

  if Nun <> wpInstalling then
  begin
    ReleaseCapture
    SendMessage(WizardForm.Handle, WM_SYSCOMMAND, $F012, 0)
  end;
 
end;

procedure FrameMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin


  if Nun <> wpInstalling then
  begin
    ReleaseCapture
    SendMessage(Frame0.Handle, WM_SYSCOMMAND, $F012, 0)
  end;
end;

procedure PlayListCallback(FrameCount: Integer);
begin
  AnimateFairy('(0-23)', nil);
end;

procedure NextBtnClick(hBtn:HWND);
begin
WizardForm.NextButton.Click;
end;

procedure licenseCheckCheckClick(hBtn:HWND);
begin
  if BtnGetChecked(licenseCheck) = true then
    BtnSetEnabled(NextBtn,true)
  else
    BtnSetEnabled(NextBtn,false);
end;


procedure ShowLicense(Sender: TObject);
var
  ErrorCode: Integer;
begin
  ShellExec('', ExpandConstant('{tmp}\license.txt'),'', '', SW_SHOW, ewNoWait, ErrorCode)
end;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//文字路径
procedure NewDirBrowseButtonClick(Sender: TObject);
begin
  WizardForm.DirBrowseButton.Click;
  PackFilePathLabel.Caption:=MinimizePathName(WizardForm.DirEdit.Text, PackFilePathLabel.Font, PackFilePathLabel.Width-20);
end;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//创建异型窗口
procedure CreateFrame0;
begin
  Frame0:=TForm.Create(nil);;
  Frame0.BorderStyle:=bsNone;
  CreateFormFromImage(Frame0.Handle,ExpandConstant('{tmp}\bg0.png'));
  with TLabel.Create(Frame0) do begin
    Parent:=Frame0;
    AutoSize:=False;
    Left:=0;
    Top:=0;
    Width:=Frame0.CLientWidth;
    Height:=Frame0.ClientHeight;
  end;
    Frame0.show;
end;

procedure CreateFrame1;
begin
  Frame1:=TForm.Create(nil);;
  Frame1.BorderStyle:=bsNone;
  CreateFormFromImage(Frame1.Handle,ExpandConstant('{tmp}\dh1.png'));
  with TLabel.Create(Frame1) do begin
    Parent:=Frame1;
    AutoSize:=False;
    Left:=0;
    Top:=0;
    Cursor:=crhand;
    Width:=Frame1.CLientWidth;
    Height:=Frame1.ClientHeight;
  end;
  Frame1.show;
end;

procedure install();
var
  i,x, y: Integer;
  ImgFile: AnsiString;
  S: AnsiString;
  TransparentColor1, BH: Integer;
begin

  CreateFrame0;
  CreateFrame1;
  timer1 := TTimer.Create(WizardForm);
  timer1.Name:='Timer1';
  timer1.OnTimer:=@Timer1Timer;
  timer1.Enabled:=True;
  timer1.Interval:=1;
 
  ClearImgList;
  InitFairy(Frame0.Handle, 0, 100);
  S := '';
  BH := GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(SM_CYDLGFRAME);
  x := -10; //(434-170)/2
  y := -10;

  TransparentColor1 := ColorToRGB(clFuchsia);
 
  for i := 0 to 23 do
  begin
    ImgFile := format('%.1d',[i+1])+'.png';
    if S <> '' then S := S + '|';
    S := S + IntToStr(x) + '|' + IntToStr(y) + '|' + IntToStr(255) + '|' + IntToStr(TransparentColor1) + '|' + ExpandConstant('{tmp}\'+ImgFile);
  end;
  AddImgsToList(S, @PlayListCallback);
 
end;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//最小化按钮
procedure MinBtnOnClick(hBtn:HWND);
begin
  SendMessage(WizardForm.Handle,WM_SYSCOMMAND,61472,0);
end;
//关闭按钮
procedure CloseBtnOnClick(hBtn:HWND);
begin
    WizardForm.Close;
end;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//单击“取消”直接退出
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
  Cancel := false;
  case Nun of
    wpInstalling:begin end;
    wpFinished:begin end;
    else
    begin
      if MsgBox('是否退出本棋牌游戏的安装', mbConfirmation, MB_YESNO) = IDYES then
        begin
          Confirm:= false;
          Cancel := true;
        end;
    end;
  end;
end;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//雨杰网络棋牌游戏3500经典版本安装结束,点"完成"之后自动运行的程序
procedure RunApp();
var
RCode: Integer;
begin
    if BtnGetChecked(RunappCheck) = true then
       Exec(ExpandConstant('{app}\GameLauncher.exe'), '', '', SW_SHOW, ewNoWait, RCode);
end;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//跳过界面
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if PageID=wpSelectComponents then    //跳过组件安装界面
  result := true;
if PageID=wpWelcome then
  result := true;
if PageID=wpSelectDir then
  result := true;

end;

function InitializeSetup: Boolean;
var
ResultStr: String;
ResultCode: Integer;
begin
    if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\雨杰棋牌游戏3500_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
end;


procedure InitializeWizard();
begin
  
    ExtractTmpFiles;
//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//初始化主界面                              434,344
    WizardForm.BorderStyle:=bsNone;
    WizardForm.ClientWidth:=434;
    WizardForm.ClientHeight:=384;
    WizardForm.InnerNotebook.Hide;
    WizardForm.OuterNotebook.Hide;
    wizardform.Color:=TransparentColor;
    WizardForm.Bevel.Hide;
    WizardForm.Center
    WizardForm.NextButton.Width:=0;
    WizardForm.BackButton.Width:=0;
    WizardForm.CancelButton.Width:=0;
    WizardForm.OnMouseDown:=@WizardFormMouseDown;
    M_top:=WizardForm.Top;
    M_left:=WizardForm.Left;
    WizardFormImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\bg.png'),ScaleX(0), ScaleY(0),434,384,True,True);
    io:= 5;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//最小化按钮
MinBtn:=BtnCreate(WizardForm.Handle,390,15,11,11,ExpandConstant('{tmp}\MinBtn.png'),3,False);
BtnSetEvent(MinBtn,BtnClickEventID,WrapBtnCallback(@MinBtnOnClick,1));

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//关闭按钮
CloseBtn:=BtnCreate(WizardForm.Handle,410,15,11,11,ExpandConstant('{tmp}\CloseBtn.png'),3,False);
BtnSetEvent(CloseBtn,BtnClickEventID,WrapBtnCallback(@CloseBtnOnClick,1));

NextBtn:=BtnCreate(WizardForm.Handle,100,180,231,56,ExpandConstant('{tmp}\install.png'),3,False);
BtnSetEvent(NextBtn,BtnClickEventID,WrapBtnCallback(@NextBtnClick,1));

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//文件安装路径
PackFilePathTitle := TLabel.Create(WizardForm);
PackFilePathTitle.AutoSize:=true;
PackFilePathTitle.SetBounds(80  + (16), 240 + (12), ScaleY(98), ScaleX(14));
PackFilePathTitle.Transparent:=True;
PackFilePathTitle.Font.Name := '新宋体'
PackFilePathTitle.Font.Size := 10
PackFilePathTitle.Caption := '安装路径:';
PackFilePathTitle.Parent := WizardForm;
PackFilePathTitle.OnMouseDown:=@WizardFormMouseDown;
//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//路径
PackFilePathLabel := TLabel.Create(WizardForm);
PackFilePathLabel.AutoSize:=true;
PackFilePathLabel.SetBounds(145  + (16), 240 + (12), ScaleY(98), ScaleX(14));
PackFilePathLabel.Transparent:=True;
PackFilePathLabel.Font.Name := '新宋体'
PackFilePathLabel.Font.Size := 10
PackFilePathLabel.Font.Color := clblue;//4370433;
PackFilePathLabel.Font.Style := [fsUnderline];
PackFilePathLabel.Caption := WizardForm.DirEdit.Text;//MinimizePathName(WizardForm.DirEdit.Text, PackFilePathLabel.Font, PackFilePathLabel.Width-20);//WizardForm.DirEdit.Text;
PackFilePathLabel.Parent := WizardForm;
PackFilePathLabel.OnClick :=@NewDirBrowseButtonClick;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//许可协议
licenseCheck:=BtnCreate(WizardForm.Handle,80  + (16), 240 + (32), ScaleY(16), ScaleY(16),ExpandConstant('{tmp}\CheckBox.png'),1,true);
BtnSetChecked(licenseCheck,true);
BtnSetEvent(licenseCheck,BtnClickEventID,WrapBtnCallback(@licenseCheckCheckClick,1));
licenseLabel := TLabel.Create(WizardForm);
licenseLabel.AutoSize:=true;
licenseLabel.SetBounds(80  + (35), 240 + (32), ScaleY(98), ScaleX(14));
licenseLabel.Transparent:=True;
licenseLabel.Font.Name := '新宋体'
licenseLabel.Font.Size := 10
licenseLabel.Caption := '已经阅读,并同意';
licenseLabel.Parent := WizardForm;
licenseLabel.OnMouseDown:=@WizardFormMouseDown;

licenseLabelFile := TLabel.Create(WizardForm);
licenseLabelFile.AutoSize:=true;
licenseLabelFile.SetBounds(190  + (40), 240 + (32), ScaleY(98), ScaleX(14));
licenseLabelFile.Cursor:= crHand;
licenseLabelFile.Transparent:=True;
licenseLabelFile.Font.Color := clblue;//4370433;
licenseLabelFile.Font.Name := '新宋体'
licenseLabelFile.Font.Size := 10
licenseLabelFile.Font.Style := [fsUnderline];
licenseLabelFile.Caption := '许可协议';
licenseLabelFile.Parent := WizardForm;
licenseLabelFile.OnClick:=@ShowLicense;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//快捷方式选框
//桌面快捷方式
DesktopCheck:=BtnCreate(WizardForm.Handle,80  + (16), 240 + (52), ScaleY(16), ScaleY(16),ExpandConstant('{tmp}\CheckBox.png'),1,true);
BtnSetChecked(DesktopCheck,true);
DesktopLabel := TLabel.Create(WizardForm);
DesktopLabel.AutoSize:=true;
DesktopLabel.SetBounds(80  + (35), 240 + (52), ScaleY(98), ScaleX(14));
DesktopLabel.Transparent:=True;
//DesktopLabel.Font.Color := clWhite;
DesktopLabel.Font.Name := '新宋体'
DesktopLabel.Font.Size := 10
DesktopLabel.Caption := '创建桌面快捷方式';
DesktopLabel.Parent := WizardForm;
DesktopLabel.OnMouseDown:=@WizardFormMouseDown;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//安装完成后 是否立即启动程序
RunAppCheck:=BtnCreate(WizardForm.Handle,80  + (16), 240 + (72), ScaleY(16), ScaleY(16),ExpandConstant('{tmp}\CheckBox.png'),1,true);
BtnSetChecked(RunAppCheck,true);
RunAppLabel := TLabel.Create(WizardForm);
RunAppLabel.AutoSize:=true;
RunAppLabel.SetBounds(80  + (35), 240 + (72), ScaleY(98), ScaleX(14));
RunAppLabel.Transparent:=True;
RunAppLabel.Font.Name := '新宋体'
RunAppLabel.Font.Size := 10
RunAppLabel.Caption := '安装完成后,立即运行程序';
RunAppLabel.Parent := WizardForm;
RunAppLabel.OnMouseDown:=@WizardFormMouseDown;


//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
//百分比                     1211
PrLabel:=TLabel.Create(WizardForm);
PrLabel.Parent:=WizardForm;
PrLabel.Left:=200;
PrLabel.Top:=280;;
PrLabel.Caption:='0%';
PrLabel.Font.Style := [fsBold];
PrLabel.Font.Color:=$f4e8e8;
PrLabel.Font.Size:= 20
PrLabel.Transparent:=True;
PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBCallBack(@PBProc,4));
PrLabel.Hide;

Nun := wpWelcome;
end;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
procedure CurPageChanged(CurPageID: Integer);
begin
        if CurPageID = wpInstalling then
        begin
            Nun :=wpInstalling;
            DesktopLabel.Hide;
            licenseLabel.Hide;
            licenseLabelFile.Hide;
            PackFilePathLabel.Hide;
            PackFilePathTitle.Hide;
            RunAppLabel.Hide;
            BtnSetVisibility(MinBtn,False);
            BtnSetVisibility(CloseBtn,False);
            BtnSetVisibility(NextBtn,False);
            BtnSetVisibility(DesktopCheck,False);
            BtnSetVisibility(licenseCheck,False);
            BtnSetVisibility(RunAppCheck,False);
            ImgRelease(WizardFormImage)
            WizardFormImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\pr.png'),ScaleX(170), ScaleY(303),100,29,True,True);
            SetWindowLong(WizardForm.Handle, GWL_EXSTYLE, GetWindowLong(WizardForm.Handle, GWL_EXSTYLE) or WS_EX_LAYERED)
            SetLayeredWindowAttributes(WizardForm.Handle, TransparentColor,220, LWA_COLORKEY or LWA_ALPHA)
            install;//安装过程中的动画
            WizardForm.Left:=M_left;
            WizardForm.Top:=M_top;
            PrLabel.Show;
        end;
        if CurPageID = wpFinished then
        begin
             Frame0.Close;
             HideFairy;
             UninitFairy;
             ImgRelease(WizardFormImage)
             PrLabel.Hide;
             RunApp;//安装完成后执行程序
             WizardForm.NextButton.Click;
//            if MsgBox('恭喜你 xxx已经安装完成,是否执行 xxx', mbConfirmation, MB_YESNO) = IDYES then
//            begin
//               Exec(ExpandConstant('{app}\GameLauncher.exe'), '', '', SW_SHOW, ewNoWait, RCode);
//            end;
        end;
       
ImgApplyChanges(WizardForm.Handle);//如果没有它就显示不了图像

end;

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
procedure DeinitializeSetup();
begin

//此安装包脚本来自雨杰网络棋牌游戏3500经典版本的安装脚本--www.cnyxwl.com
gdipShutdown;  //背景图
HideFairy;
//WizardForm.Hide;
UninitFairy;
if PBOldProc<>0 then SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
end;
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics