vint56
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору #include "botva2.iss" [Setup] AppName=Games AppVerName=Games DefaultDirName={pf}\Games Compression=none [Languages] Name: rus; MessagesFile: compiler:Languages\Russian.isl [Files] Source: InstallFiles\*; Flags: dontcopy; Source: InstallFiles\botva2.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system; Source: {win}\help\*; DestDir: {app}; Flags: external recursesubdirs createallsubdirs; [UninstallDelete] Type: filesandordirs; Name: {app}; [Code] type TTimerProc = procedure (h: Longword; msg: Longword; idevent: Longword; dwTime: Longword); TPBProc = function (h:hWnd;Msg,wParam,lParam:Longint):Longint; var DirFolder: Longint; ResultCode, ErrorCode: integer; hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn, hCancelUninstBtn: HWND; WFButtonFont, UPFButtonFont: TFont; function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall'; function WrapTimerProc(callback:TTimerProc; paramcount:integer):longword; external 'wrapcallback@files:innocallback.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 SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall'; function CallBackProc(P:TPBProc;ParamCount:integer):LongWord; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload'; //************************************************ [Íà÷àëî - Âñòàâêà èçîáðàæåíèé] ***************************************************// procedure CreateWizardImage; var i: integer; begin ExtractTemporaryFile('button.png'); ExtractTemporaryFile('WFEnter.wav'); ExtractTemporaryFile('Check.wav'); ExtractTemporaryFile('Click.wav'); ExtractTemporaryFile('DirFolder.png'); DirFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\DirFolder.png'),ScaleX(40), ScaleY(70),ScaleX(30),ScaleY(40),True,True); ImgApplyChanges(WizardForm.Handle); end; function InitializeSetup: Boolean; begin if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll'); Result := True; end; procedure SetStateNewButtons; begin with WizardForm.BackButton do begin BtnSetText(hBackBtn,PAnsiChar(Caption)); BtnSetVisibility(hBackBtn,Visible); BtnSetEnabled(hBackBtn,Enabled); end; with WizardForm.NextButton do begin BtnSetText(hNextBtn,PAnsiChar(Caption)); BtnSetVisibility(hNextBtn,Visible); BtnSetEnabled(hNextBtn,Enabled); end; with WizardForm.CancelButton do begin BtnSetText(hCancelBtn,PAnsiChar(Caption)); BtnSetVisibility(hCancelBtn,Visible); BtnSetEnabled(hCancelBtn,Enabled); end; BtnSetText(hDirBrowseBtn,PAnsiChar(WizardForm.DirBrowseButton.Caption)); BtnSetText(hGroupBrowseBtn,PAnsiChar(WizardForm.GroupBrowseButton.Caption)); end; procedure WizardFormBtnClick(hBtn:HWND); var Btn:TButton; begin sndPlaySound(ExpandConstant('{tmp}\Click.wav'),$0001); case hBtn of hCancelBtn: Btn:=WizardForm.CancelButton; hNextBtn: Btn:=WizardForm.NextButton; hBackBtn: Btn:=WizardForm.BackButton; hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton; hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton; end; Btn.OnClick(Btn); SetStateNewButtons; BtnRefresh(hBtn); end; procedure WFBtnEnter(hBtn:HWND); begin sndPlaySound(ExpandConstant('{tmp}\WFEnter.wav'),$0001); end; procedure ButtonsTextures; begin WFButtonFont:=TFont.Create; WFButtonFont.Name:='Comic Sans MS' // WFButtonFont.Style:=[fsBold]; //çàìåíèì ñòàíäàðòíûå êíîïêè íà ñâîè with WizardForm.CancelButton do begin hCancelBtn:=BtnCreate(WizardForm.Handle,Left-8,Top-8,Width+16,Height+16,ExpandConstant('{tmp}\button.png'),18,False); BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1)); BtnSetEvent(hCancelBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetFont(hCancelBtn,WFButtonFont.Handle); BtnSetFontColor(hCancelBtn,$000000,$DAE369,$DAE369,$B6B6B6); BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; with WizardForm.NextButton do begin hNextBtn:=BtnCreate(WizardForm.Handle,Left-8,Top-8,Width+16,Height+16,ExpandConstant('{tmp}\button.png'),18,False); BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1)); BtnSetEvent(hNextBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetFont(hNextBtn,WFButtonFont.Handle); BtnSetFontColor(hNextBtn,$000000,$DAE369,$DAE369,$B6B6B6); BtnSetCursor(hNextBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; with WizardForm.BackButton do begin hBackBtn:=BtnCreate(WizardForm.Handle,Left-8,Top-8,Width+16,Height+16,ExpandConstant('{tmp}\button.png'),18,False); BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1)); BtnSetEvent(hBackBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetFont(hBackBtn,WFButtonFont.Handle); BtnSetFontColor(hBackBtn,$000000,$DAE369,$DAE369,$B6B6B6); BtnSetCursor(hBackBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; with WizardForm.DirBrowseButton do begin hDirBrowseBtn:=BtnCreate(WizardForm.SelectDirPage.Handle,Left-8,Top-8,Width+16,Height+16,ExpandConstant('{tmp}\button.png'),18,False); BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1)); BtnSetEvent(hDirBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle); BtnSetFontColor(hDirBrowseBtn,$000000,$DAE369,$DAE369,$B6B6B6); BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; with WizardForm.GroupBrowseButton do begin hGroupBrowseBtn:=BtnCreate(WizardForm.SelectProgramGroupPage.Handle,Left-8,Top-8,Width+16,Height+16,ExpandConstant('{tmp}\button.png'),18,False); BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1)); BtnSetEvent(hGroupBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle); BtnSetFontColor(hGroupBrowseBtn,$000000,$DAE369,$DAE369,$B6B6B6); BtnSetCursor(hGroupBrowseBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; ImgApplyChanges(WizardForm.Handle); end; procedure InitializeWizard; begin CreateWizardImage; ButtonsTextures; end; procedure CurPageChanged(CurPageID: Integer); begin SetStateNewButtons; ImgApplyChanges(WizardForm.Handle); end; procedure DeInitializeSetup(); begin gdipShutdown; end; |