bioscorpius
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору #define GameID "{45C3A802-3D17-4F23-ADD1-B2D066CDC0CE}" #define GameName "Syndicate" #define GameVerName "Syndicate [v 1.0]" #define NeedSize "10601" #define TNeedSize "15601" #define Processor "3000" #define VideoCard "512" #define RAM "2048" #define WinVerMajor "5" #define WinVerMinor "1" #define ServicePack "2" ;#define Components ;; Òîëüêî åñëè èñïîëüçóåòñÿ ìîäóëü FreeArc. Äëÿ ISDone ïðîïèñûâàòü ôàéëû â îäíîèì¸ííîì ìîäóëå. ;; ;#define ArcLocation "{src}\bin\data.bin" #define SlidesCount "15" ;; Âûáîð ïîäêëþ÷àåìûõ ìîäóëåé. Åñëè èñïîëüçóåòñÿ FreeArc, òî îáÿçàòåëüíî çàêîììåíòèðîâàòü #define ISDone, ;; ;; åñëè èñïîëüçóåòñÿ ISDone, òî îáÿçàòåëüíî çàêîììåíòèðîâàòü #define FreeArc. Ìîäóëü Autorun íåçàâèñèì. ;; ;#define Autorun ;#define FreeArc #define ISDone #define NeedMem 256 #define records #define precomp04 ;#define precomp038 ;#define unrar [Setup] AppId={{#GameID} AppName={#GameName} AppVerName={#GameName} AppPublisher=EA Games AppPublisherURL=http://www.ea.com AppVersion=1.13 AppSupportURL={app}\Support\EA Help\Ru\EA_HELP_RU.htm AppUpdatesURL=http://www.ea.com AppReadmeFile={group}\ReadMe.lnk DefaultDirName={pf}\EA Games\Syndicate DefaultGroupName=EA Games\Syndicate OutputBaseFilename=Setup DirExistsWarning=no MinVersion=0,5.01 VersionInfoDescription={#GameName} SetupIconFile=syn.ico DiskSpanning=no InternalCompressLevel=ultra64 Compression=lzma2/ultra64 DisableReadyPage=True [Files] Source: "InstallFiles\*"; Flags: dontcopy; Source: "Slides\*"; Flags: dontcopy; Source: "Icons\*"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; Source: "InstallFiles\WizardImage.jpg"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; Source: "InstallFiles\botva2.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; Source: "InstallFiles\ProgressBackground.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; Source: "InstallFiles\ProgressImg.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; Source: "InstallFiles\StatusPanel2.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; Source: "InstallFiles\StatusPanel.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; Source: "InstallFiles\Button.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; Source: "InstallFiles\Tiger.cjstyles"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; Source: "InstallFiles\Workspace.png"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; Source: "InstallFiles\ISSkin.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; Source: "InstallFiles\innocallback.dll"; DestDir: "{app}"; Flags: ignoreversion; Attribs: hidden system; ;Source: {win}\help\*; DestDir: {app}\Files; Flags: external recursesubdirs createallsubdirs; Check: not Install; ;Source: "d:\Need for Speed The Run\Core\*"; DestDir: "{app}\Core"; Flags: ignoreversion recursesubdirs createallsubdirs; Source: "d:\Program Files (x86)\Syndicate\Support\*"; DestDir: "{app}\Support"; Flags: ignoreversion recursesubdirs createallsubdirs; Source: "d:\Program Files (x86)\Syndicate\Content_Rus\*"; DestDir: "{app}\Content_Rus"; Flags: ignoreversion recursesubdirs createallsubdirs; Source: "d:\Program Files (x86)\Syndicate\System\*"; DestDir: "{app}\System"; Flags: ignoreversion recursesubdirs createallsubdirs; Source: "d:\Program Files (x86)\Syndicate\*.cfg"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Source: "d:\Program Files (x86)\Syndicate\*.dll"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; #ifdef records Source: "InstallFiles\records.inf"; DestDir: "{tmp}"; Flags: dontcopy #endif #ifdef precomp04 Source: "InstallFiles\packjpg_dll.dll"; DestDir: "{tmp}"; Flags: dontcopy Source: "InstallFiles\RTconsole.exe"; DestDir: "{tmp}"; Flags: dontcopy Source: "InstallFiles\precomp04.exe"; DestDir: "{tmp}"; Flags: dontcopy #endif #ifdef precomp038 Source: "InstallFiles\packjpg_dll.dll"; DestDir: "{tmp}"; Flags: dontcopy Source: "InstallFiles\RTconsole.exe"; DestDir: "{tmp}"; Flags: dontcopy Source: "InstallFiles\precomp038.exe"; DestDir: "{tmp}"; Flags: dontcopy Source: "InstallFiles\zlib1.dll"; DestDir: "{tmp}"; Flags: dontcopy #endif #ifdef unrar Source: "InstallFiles\Unrar.dll"; DestDir: "{tmp}"; Flags: dontcopy #endif #ifdef Components ;; Åñëè èñïîëüçóþòñÿ êîìïîíåíòû â ISDone (àðõèâàìè) - çàêîììåíòèðîâàòü. Åñëè èñïîëüçóþòñÿ ôàéëû èëè ïàïêè - ðàñêîììåíòèðîâàòü è ïðîïèñàòü çäåñü. ;; ;; Êîìïîíåíò 2 ;; ;Source: "rus.txt"; DestDir: "{app}"; Flags: ignoreversion; Check: Comp2; ;; Êîìïîíåíò 3 ;; ;Source: "eng.txt"; DestDir: "{app}"; Flags: ignoreversion; Check: Comp3; ;; Êîìïîíåíò 5 ;; ;Source: "rus.mp3"; DestDir: "{app}"; Flags: ignoreversion; Check: Comp5; ;; Êîìïîíåíò 6 ;; ;Source: "eng.mp3"; DestDir: "{app}"; Flags: ignoreversion; Check: Comp6; ;; Íàäïèñè (ëåáåëû) êîìïîíåíòîâ. ;; #define Comp1Description "ßçûê ñóáòèòðîâ" #define Comp2Description "Ðóññêèé" #define Comp3Description "Àíãëèéñêèé" #define Comp4Description "ßçûê îçâó÷êè" #define Comp5Description "Ðóññêèé" #define Comp6Description "Àíãëèéñêèé" #endif [Icons] Name: "{group}\{#GameName}"; Filename: "{app}\System\Win32_x86_Release\Syndicate.exe"; WorkingDir: {app}; Comment: "Çàïóñòèòü èãðó"; Check: NoIcons; Name: "{group}\Îòêðûòü ôàéë ReadMe"; Filename: "{app}\Support\eula\ru_RU_eula.rtf"; WorkingDir: "{app}\Support\eula"; IconFilename: "{app}\1.ico"; Comment: "Ïðîñìîòðåòü ôàéë ReadMe.txt"; Check: NoIcons; ;Name: "{group}\Ïîèñê îáíîâëåíèé"; Filename: "{app}\Core\PatchProgress.exe"; WorkingDir: "{app}\Core"; IconFilename: "{app}\2.ico"; Comment: "Ïîèñê îáíîâëåíèé èãðû â èíòåðíåòå"; Check: NoIcons; Name: "{group}\Òåõíè÷åñêàÿ ïîääåðæêà"; Filename: "{app}\Support\EA Help\Electronic_Arts_Technical_Support.htm"; WorkingDir: "{app}\Support\EA Help"; IconFilename: "{app}\3.ico"; Comment: "Ïðîñìîòðåòü ôàéë Òåõíè÷åñêîé ïîääåðæêè"; Check: NoIcons; Name: "{group}\Âåá-ñàéò èçäàòåëÿ"; Filename: "{app}\publisher.url"; WorkingDir: "{app}"; IconFilename: "{app}\2.ico"; Comment: "Ïîñåòèòü Âåá-ñàéò èçäàòåëÿ"; Check: NoIcons; ;Name: "{group}\Ðåãèñòðàöèÿ"; Filename: "{app}\Support\EAregister.exe"; WorkingDir: "{app}\Support"; IconFilename: "{app}\4.ico"; Comment: "Çàðåãèñòðèðîâàòü èãðó"; Check: NoIcons; Name: "{group}\{cm:Uninstall}"; Filename: "{uninstallexe}"; IconFilename: "{app}\5.ico"; Comment: "Óäàëèòü èãðó"; Check: NoIcons; Name: "{userdesktop}\{#GameName}"; Filename: "{app}\System\Win32_x86_Release\Syndicate.exe"; WorkingDir: {app}; Check: Desktop; Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#GameName}"; Filename: "{app}\System\Win32_x86_Release\Syndicate.exe"; WorkingDir: {app}; Check: QuickLaunch; [INI] FileName: "{app}\publisher.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.ea.com"; FileName: "{app}\Update.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.ea.com"; [UninstallDelete] Type: files; Name: "{app}\publisher.url" Type: files; Name: "{app}\Update.url" Type: filesandordirs; Name: {app} [Run] Filename: "{src}\DirectX\DXSETUP.exe"; WorkingDir: "{src}\DirectX"; Parameters: "/silent"; Check: DirectX and not Install; Flags: waituntilterminated; BeforeInstall: DirectXProgress; Filename: "{src}\DirectX\DXSETUP.exe"; WorkingDir: "{src}\DirectX"; Parameters: "/silent"; Check: DirectX and not Install; Flags: waituntilterminated; BeforeInstall: DirectXProgress; [Registry] Root: HKLM; SubKey: SOFTWARE\EA Games\Syndicate; ValueType: string; ValueName: GDFBinary; ValueData: {app}\GDFBinary_ru_RU.dll; Flags: uninsdeletekey noerror Root: HKLM; SubKey: SOFTWARE\EA Games\Syndicate; ValueType: string; ValueName: DisplayName; ValueData: Syndicate; Flags: uninsdeletekey noerror Root: HKLM; SubKey: SOFTWARE\EA Games\Syndicate; ValueType: string; ValueName: Locale; ValueData: ru_RU; Flags: uninsdeletekey noerror Root: HKLM; SubKey: SOFTWARE\EA Games\Syndicate; ValueType: string; ValueName: Install Dir; ValueData: {app}; Flags: uninsdeletekey noerror [code] type TTimerProc = procedure (h: Longword; msg: Longword; idevent: Longword; dwTime: Longword); TALabel = array of TLabel; const LanguageButtonCount = 2; BASS_ACTIVE_PAUSED = 3; BASS_SAMPLE_LOOP = 4; WFDiskTimerID = 1; WFSysReqTimerID = 2; var SystemPage, SelectComponentsPage, SelectTasksPage: TWizardPage; Rus: boolean; MusicButton, hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn, hCancelUninstBtn, NoIconsCheck, DesktopCheck, QuickLaunchCheck, DirectXCheck, RedistCheck, mp3Handle: HWND; WFButtonFont, UPFButtonFont: TFont; mp3Name, OldDisk: string; Welcome, System, Catalogue, StartMenu, Tasks, Installing, Finish, Uninstalling, PageNameLabel, PageDescriptionLabel, WelcomeLabel1, WelcomeLabel2, RequirementsLbl, ProcessorLbl, VideoCardLbl, SoundCardLbl, RAMLbl, SystemLbl, ProcessorNameLbl, VideoCardNameLbl, SoundCardNameLbl, RAMTotalLbl, SystemNameLbl, SelectDirBrowseLabel, DirEditLabel, TotalSpaceLabel, NeedSpaceLabel, FreeSpaceLabel, SelectStartMenuFolderBrowseLabel, GroupEditLabel, NoIconsLabel, NeedSpaceTLabel, SelectTasksLabel, DesktopLabel, QuickLaunchLabel, DirectXLabel, RedistLabel, LanguageLabel, LngNameLbl, FinishedHeadingLabel, FinishedLabel, Components, WizardUninstLabel, UninstPageDescriptLabel, StatusUninstLabel: TLabel; StatusPanel, RequirementsPanel, Edit,DirFolder,HardDrivePanel, GroupFolder,WizardImg, HDD: Longint; FreeMB, TotalMB: Cardinal; LanguageButton: array [1..LanguageButtonCount] of HWND; ASysReq, ADisk: TALabel; Keys: TArrayOfString; #ifndef ISDone Cancel: Integer; MyError: boolean; LabelTime3: TLabel; #endif #ifndef FreeArc UnPackError: Integer; #endif function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall'; function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall'; function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall'; function WrapTimerProc(callback:TTimerProc; paramcount:integer):LongWord; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload'; function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall'; function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall'; procedure LoadSkin(lpszPath: PAnsiChar; lpszIniFileName: PAnsiChar); external 'LoadSkin@{tmp}\isskin.dll stdcall delayload'; procedure UnloadSkin; external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload'; procedure FinishFlashing(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword); begin if FinishedLabel.Font.Color=$FFFFFF then FinishedLabel.Font.Color:=$0030ff else FinishedLabel.Font.Color:=$FFFFFF; if FinishedHeadingLabel.Font.Color=$FFFFFF then FinishedHeadingLabel.Font.Color:=$0030ff else FinishedHeadingLabel.Font.Color:=$FFFFFF; end; //================== Ïîäêëþ÷åíèå ìîäóëåé ==================// #include "Messages.iss" #include "botva2.iss" #include "PB.iss" #ifdef Autorun #include "AutoRun.iss" #endif #ifdef FreeArc #include "FreeArc.iss" #endif //================== Ïîäêëþ÷åíèå ìîäóëåé ==================// function InitializeSetup: Boolean; begin if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll'); if not FileExists(ExpandConstant('{tmp}\innocallback.dll')) then ExtractTemporaryFile('innocallback.dll'); if not FileExists(ExpandConstant('{tmp}\Click.wav')) then ExtractTemporaryFile('Click.wav'); if not FileExists(ExpandConstant('{tmp}\isskin.dll')) then ExtractTemporaryFile('isskin.dll'); if not FileExists(ExpandConstant('{tmp}\Tiger.cjstyles')) then ExtractTemporaryFile('Tiger.cjstyles'); LoadSkin(ExpandConstant('{tmp}\Tiger.cjstyles'), ''); #ifdef Autorun Result:=AutoRunExec; #else Result:=true; #endif end; //************************************************ [Íà÷àëî - Âñòàâêà èçîáðàæåíèé] ***************************************************// procedure CreateWizardImage; var i: integer; begin with WizardForm do begin ClientWidth:=ScaleX(798); ClientHeight:=ScaleY(543); Center; OuterNotebook.Hide; InnerNotebook.Hide; Bevel.Hide; end; ExtractTemporaryFile('WizardImage.jpg'); ExtractTemporaryFile('button.png'); ExtractTemporaryFile('MusicButton.png'); ExtractTemporaryFile('StatusPanel.png'); ExtractTemporaryFile('StatusPanel2.png'); ExtractTemporaryFile('Workspace.png'); ExtractTemporaryFile('RequirementsPanel.png'); ExtractTemporaryFile('Edit.png'); ExtractTemporaryFile('DirFolder.png'); ExtractTemporaryFile('HardDrivePanel.png'); ExtractTemporaryFile('HDD.png'); ExtractTemporaryFile('GroupFolder.png'); ExtractTemporaryFile('CheckBox.png'); ExtractTemporaryFile('CheckBox1.png'); ExtractTemporaryFile('RadioBatton.png'); ExtractTemporaryFile('ru.png'); ExtractTemporaryFile('us.png'); ExtractTemporaryFile('ProgressBackground.png'); ExtractTemporaryFile('ProgressBackground2.png'); ExtractTemporaryFile('ProgressImg.png'); ExtractTemporaryFile('WFEnter.wav'); ExtractTemporaryFile('Check.wav'); ExtractTemporaryFile('Music.mp3'); ExtractTemporaryFile('BASS.dll'); for i:=1 to {#SlidesCount} do ExtractTemporaryFile(IntToStr(i)+'.jpg'); WizardImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\WizardImage.jpg'),ScaleX(0),ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True); SetArrayLength(AImg,{#SlidesCount}); for i:=0 to GetArrayLength(AImg)-1 do begin AImg[i]:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\'+IntToStr(i+1)+'.jpg'),0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,True,True); ImgSetVisibility(AImg[i],False); end; ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\StatusPanel.png'),ScaleX(0), ScaleY(95),WizardForm.ClientWidth,ScaleY(20),True,True); StatusPanel:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\StatusPanel2.png'),ScaleX(0), ScaleY(95),ScaleX(114),ScaleY(20),True,True); ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Workspace.png'),ScaleX(42), ScaleY(160),ScaleX(714),ScaleY(309),True,True); RequirementsPanel:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\RequirementsPanel.png'),ScaleX(100), ScaleY(292),ScaleX(601),ScaleY(146),True,True); Edit:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Edit.png'),ScaleX(120), ScaleY(305),ScaleX(460),ScaleY(22),True,True); DirFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\DirFolder.png'),ScaleX(60), ScaleY(260),ScaleX(50),ScaleY(70),True,True); HardDrivePanel:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\HardDrivePanel.png'),ScaleX(120), ScaleY(354),ScaleX(460),ScaleY(90),True,True); HDD:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\HDD.png'),ScaleX(60), ScaleY(372),ScaleX(50),ScaleY(50),True,True); GroupFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\GroupFolder.png'),ScaleX(60), ScaleY(260),ScaleX(50),ScaleY(70),True,True); ImgApplyChanges(WizardForm.Handle); 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.Style:=[fsBold]; with WizardForm.BackButton do begin hBackBtn:=BtnCreate(WizardForm.Handle,Left+205,Top+160,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False); BtnSetEvent(hBackBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1)); BtnSetFont(hBackBtn,WFButtonFont.Handle); BtnSetFontColor(hBackBtn,$DAE369,$DAE369,$DAE369,$B6B6B6); BtnSetCursor(hBackBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; with WizardForm.NextButton do begin hNextBtn:=BtnCreate(WizardForm.Handle,Left+230,Top+160,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False); BtnSetEvent(hNextBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1)); BtnSetFont(hNextBtn,WFButtonFont.Handle); BtnSetFontColor(hNextBtn,$DAE369,$DAE369,$DAE369,$B6B6B6); BtnSetCursor(hNextBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; with WizardForm.CancelButton do begin hCancelBtn:=BtnCreate(WizardForm.Handle,Left+245,Top+160,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False); BtnSetEvent(hCancelBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1)); BtnSetFont(hCancelBtn,WFButtonFont.Handle); BtnSetFontColor(hCancelBtn,$DAE369,$DAE369,$DAE369,$B6B6B6); BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; with WizardForm.DirBrowseButton do begin hDirBrowseBtn:=BtnCreate(WizardForm.Handle,Left+280,Top+215,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False); BtnSetEvent(hDirBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1)); BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle); BtnSetFontColor(hDirBrowseBtn,$DAE369,$DAE369,$DAE369,$B6B6B6); BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; with WizardForm.GroupBrowseButton do begin hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,Left+280,Top+215,Width+31,Height+16,ExpandConstant('{tmp}\button.png'),18,False); BtnSetEvent(hGroupBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1)); BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle); BtnSetFontColor(hGroupBrowseBtn,$DAE369,$DAE369,$DAE369,$B6B6B6); BtnSetCursor(hGroupBrowseBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; end; //************************************************ [Êîíåö - Òåêñòóðû êíîïîê] ***************************************************// //************************************************ [Íà÷àëî - Ìóçûêà] ***************************************************// function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean; external 'BASS_Init@files:BASS.dll stdcall delayload'; function BASS_StreamCreateFile(mem: BOOL; f: PAnsiChar; offset: DWORD; length: DWORD; flags: DWORD): DWORD; external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload'; function BASS_Start: Boolean; external 'BASS_Start@files:BASS.dll stdcall delayload'; function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean; external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload'; function BASS_ChannelIsActive(handle: DWORD): Integer; external 'BASS_ChannelIsActive@files:BASS.dll stdcall delayload'; function BASS_ChannelPause(handle: DWORD): Boolean; external 'BASS_ChannelPause@files:BASS.dll stdcall delayload'; function BASS_Pause: Boolean; external 'BASS_Pause@files:BASS.dll stdcall delayload'; function BASS_Stop: Boolean; external 'BASS_Stop@files:BASS.dll stdcall delayload'; function BASS_Free: Boolean; external 'BASS_Free@files:BASS.dll stdcall delayload'; procedure MusicButtonClick(hBtn:HWND); begin sndPlaySound(ExpandConstant('{tmp}\Click.wav'), $0001); if BtnGetChecked(MusicButton) then BASS_ChannelPause(mp3Handle) else if BASS_ChannelIsActive(mp3Handle)=BASS_ACTIVE_PAUSED then BASS_ChannelPlay(mp3Handle, False); end; procedure InsertMusic; begin MusicButton:=BtnCreate(WizardForm.Handle,ScaleX(758),ScaleY(5),ScaleX(36),ScaleY(36),ExpandConstant('{tmp}\MusicButton.png'),0,True); BtnSetEvent(MusicButton,BtnClickEventID,WrapBtnCallback(@MusicButtonClick,1)); BtnSetEvent(MusicButton,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetVisibility(MusicButton,True); BtnSetCursor(MusicButton,GetSysCursorHandle(32649)); mp3Name:=ExpandConstant('{tmp}\Music.mp3'); BASS_Init(-1,44100,0,0,0); mp3Handle:=BASS_StreamCreateFile(FALSE,PAnsiChar(mp3Name),0,0,BASS_SAMPLE_LOOP); BASS_Start; BASS_ChannelPlay(mp3Handle,False); end; //************************************************ [Êîíåö - Ìóçûêà] ***************************************************// //************************************************ [Íà÷àëî - Ïàíåëü] ***************************************************// procedure CreateStatusPanel; begin Welcome := TLabel.Create(WizardForm); with Welcome do begin AutoSize:=False; #ifdef Components SetBounds(ScaleX(7), ScaleY(96), ScaleX(100), ScaleY(20)); #else SetBounds(ScaleX(13), ScaleY(96), ScaleX(114), ScaleY(20)); #endif Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 10; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:Welcome}'); Parent := WizardForm; end; System := TLabel.Create(WizardForm); with System do begin AutoSize:=False; #ifdef Components SetBounds(ScaleX(125), ScaleY(96), ScaleX(100), ScaleY(20)); #else SetBounds(ScaleX(143), ScaleY(96), ScaleX(114), ScaleY(20)); #endif Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 10; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:System}'); Parent := WizardForm; end; Catalogue := TLabel.Create(WizardForm); with Catalogue do begin AutoSize:=False; #ifdef Components SetBounds(ScaleX(225), ScaleY(96), ScaleX(100), ScaleY(20)); #else SetBounds(ScaleX(260), ScaleY(96), ScaleX(114), ScaleY(20)); #endif Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 10; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:Catalogue}'); Parent := WizardForm; end; #ifdef Components Components := TLabel.Create(WizardForm); with Components do begin AutoSize:=False; SetBounds(ScaleX(310), ScaleY(96), ScaleX(100), ScaleY(20)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 10; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:Components}'); Parent := WizardForm; end; #endif StartMenu := TLabel.Create(WizardForm); with StartMenu do begin AutoSize:=False; #ifdef Components SetBounds(ScaleX(407), ScaleY(96), ScaleX(100), ScaleY(20)); #else SetBounds(ScaleX(357), ScaleY(96), ScaleX(114), ScaleY(20)); #endif Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 10; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:StartMenu}'); Parent := WizardForm; end; Tasks := TLabel.Create(WizardForm); with Tasks do begin AutoSize:=False; #ifdef Components SetBounds(ScaleX(525), ScaleY(96), ScaleX(100), ScaleY(20)); #else SetBounds(ScaleX(490), ScaleY(96), ScaleX(114), ScaleY(20)); #endif Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 10; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:Task}'); Parent := WizardForm; end; Installing := TLabel.Create(WizardForm); with Installing do begin AutoSize:=False; #ifdef Components SetBounds(ScaleX(617), ScaleY(96), ScaleX(100), ScaleY(20)); #else SetBounds(ScaleX(593), ScaleY(96), ScaleX(114), ScaleY(20)); #endif Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 10; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:Installing}'); Parent := WizardForm; end; Finish := TLabel.Create(WizardForm); with Finish do begin AutoSize:=False; #ifdef Components SetBounds(ScaleX(710), ScaleY(96), ScaleX(100), ScaleY(20)); #else SetBounds(ScaleX(703), ScaleY(96), ScaleX(114), ScaleY(20)); #endif Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 10; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:Finish}'); Parent := WizardForm; end; end; //************************************************ [Êîíåö - Ïàíåëü] ***************************************************// //************************************************ [Íà÷àëî - Êîìïîíåíòû ñòðàíèö] ***************************************************// function DetectHardware: Integer; external 'hwc_DetectHardware@files:get_hw_caps.dll stdcall'; function GetProcessorName: PAnsiChar; external 'hwc_GetProcessorName@files:get_hw_caps.dll stdcall'; function GetProcessorFreq: Integer; external 'hwc_GetProcessorFreq@files:get_hw_caps.dll stdcall'; function GetVideoCardName: PAnsiChar; external 'hwc_GetVideoCardName@files:get_hw_caps.dll stdcall'; function GetVidMemLocal: Integer; external 'hwc_GetVidMemLocal@files:get_hw_caps.dll stdcall'; function GetPdmWidth: Integer; external 'hwc_GetPdmWidth@files:get_hw_caps.dll stdcall'; function GetPdmHeight: Integer; external 'hwc_GetPdmHeight@files:get_hw_caps.dll stdcall'; function GetSoundCards: Integer; external 'hwc_GetSoundCards@files:get_hw_caps.dll stdcall'; function GetSoundCardName: PAnsiChar; external 'hwc_GetSoundCardName@files:get_hw_caps.dll stdcall'; function GetSystemPhys: Integer; external 'hwc_GetSystemPhys@files:get_hw_caps.dll stdcall'; function GetWindowsName: PAnsiChar; external 'hwc_GetWindowsName@files:get_hw_caps.dll stdcall'; function DelSp(s: string): string; begin while Pos(' ',s)>0 do StringChange(s,' ',' '); Result:=Trim(s); end; procedure GroupChange(Sender: TObject); begin GroupEditLabel.Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width); end; function NumToStr(Float: Extended): string; begin Result:=Format('%.2n', [Float]); StringChange(Result, ',', '.'); while ((Result[Length(Result)]='0') or (Result[Length(Result)]='.')) and (Pos('.',Result)>0) do SetLength(Result,Length(Result)-1); 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 SysReqFlashing(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword); var i:integer; begin for i:= 0 to GetArrayLength(ASysReq)-1 do if ASysReq[i].Font.Color=$FFFFFF then ASysReq[i].Font.Color:=$0000FF else ASysReq[i].Font.Color:=$FFFFFF; end; procedure DiskFlashing(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword); var i:integer; begin for i:= 0 to GetArrayLength(ADisk)-1 do if ADisk[i].Font.Color=$FFFFFF then ADisk[i].Font.Color:=$0000FF else ADisk[i].Font.Color:=$FFFFFF; end; function GetElementIndex(a:TALabel; lbl:TLabel):integer; var i:integer; f:boolean; begin Result:=-1; f:=False; for i:=0 to GetArrayLength(a)-1 do if a[i]=lbl then begin f:=True; Break; end; if f then Result:=i; end; procedure AddLabelToArray(var a:TALabel; lbl:TLabel); begin if GetElementIndex(a,lbl)=-1 then begin SetArrayLength(a,GetArrayLength(a)+1); a[GetArrayLength(a)-1]:=lbl; end; end; procedure DeleteLabelFromArray(var a:TALabel; lbl:integer); var Last,i:integer; begin if lbl<>-1 then begin Last:=GetArrayLength(a)-1; if lbl<Last then for i:=lbl to Last-1 do a[i]:=a[i+1]; SetArrayLength(a,Last); end; end; procedure GetFreeSpaceCaption(Sender: TObject); var CurrentDisk: String; i:integer; begin CurrentDisk:=ExtractFileDrive(WizardForm.DirEdit.Text); DirEditLabel.Caption:=MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width); if not GetSpaceOnDisk(CurrentDisk,True,FreeMB,TotalMB) then begin KillTimer(WizardForm.Handle,WFDiskTimerID); SetArrayLength(ADisk,0); TotalSpaceLabel.Visible:=False; FreeSpaceLabel.Visible:=False; BtnSetEnabled(hNextBtn,False); WizardForm.NextButton.Enabled:=False; OldDisk:=CurrentDisk; Exit; end; TotalSpaceLabel.Visible:=True; FreeSpaceLabel.Visible:=True; if CurrentDisk<>OldDisk then begin OldDisk:=CurrentDisk; TotalSpaceLabel.Caption := ExpandConstant('{cm:TotalSpace} ') + MbOrTB(TotalMb); FreeSpaceLabel.Caption := ExpandConstant('{cm:FreeSpace} ') + MbOrTB(FreeMb) + ' (' + IntToStr((FreeMb*100) div TotalMB) + ' %)'; if WizardForm.CurPageID = wpSelectDir then begin if FreeMB>={#TNeedSize} then begin i:=GetElementIndex(ADisk,FreeSpaceLabel); if i<>-1 then begin DeleteLabelFromArray(ADisk,i); FreeSpaceLabel.Font.Color:=$FFFFFF; if GetArrayLength(ADisk)=0 then KillTimer(WizardForm.Handle,WFDiskTimerID); end; end else AddLabelToArray(ADisk,FreeSpaceLabel); if TotalMb>={#TNeedSize} then begin i:=GetElementIndex(ADisk,TotalSpaceLabel); if i<>-1 then begin DeleteLabelFromArray(ADisk,i); TotalSpaceLabel.Font.Color:=$FFFFFF; if GetArrayLength(ADisk)=0 then KillTimer(WizardForm.Handle,WFDiskTimerID); end; end else AddLabelToArray(ADisk,TotalSpaceLabel); if GetArrayLength(ADisk)>0 then SetTimer(WizardForm.Handle,WFDiskTimerID,1000,WrapTimerProc(@DiskFlashing,4)); BtnSetEnabled(hNextBtn,not (GetArrayLength(ADisk)>0)); WizardForm.NextButton.Enabled:=not (GetArrayLength(ADisk)>0); end; end; end; //================== Ïîäêëþ÷åíèå ìîäóëåé ==================// #ifdef Components #include "Components.iss" #endif #ifdef ISDone #include "ISDone.iss" #endif //================== Ïîäêëþ÷åíèå ìîäóëåé ==================// function Install: Boolean; begin if (Cancel <> 0) or MyError or (UnPackError <> 0) then Result:= True; end; function NoIcons: Boolean; begin Result:= BtnGetEnabled(hGroupBrowseBtn); end; function Desktop: Boolean; begin Result:= BtnGetChecked(DesktopCheck); end; function QuickLaunch: Boolean; begin Result:= BtnGetChecked(QuickLaunchCheck); end; function DirectX: Boolean; begin ProgressInfoLabel.Visible:=False; FilenameLabel.Hide; Result:= BtnGetChecked(DirectXCheck); end; function Redist: Boolean; begin ProgressInfoLabel.Visible:=False; FilenameLabel.Hide; Result:= BtnGetChecked(RedistCheck); end; //function Lang: Boolean; //begin // Result:= BtnGetChecked(LanguageButton[1]); //end; procedure NoIconsClick(hBtn:HWND); var Check:boolean; begin sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001); Check:=BtnGetChecked(hBtn); BtnSetEnabled(hGroupBrowseBtn, not Check); GroupEditLabel.Enabled:=not Check; if Check then NoIconsLabel.Font.Color:=$00FFFF else NoIconsLabel.Font.Color:=$FFFFFF; end; procedure NoIconsLabelClick(Sender:TObject); begin BtnSetChecked(NoIconsCheck, not BtnGetChecked(NoIconsCheck)); NoIconsClick(NoIconsCheck); end; procedure DesktopClick(hBtn:HWND); begin sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001); if BtnGetChecked(hBtn) then DesktopLabel.Font.Color:=$00FFFF else DesktopLabel.Font.Color:=$FFFFFF; end; procedure DesktopLabelClick(Sender:TObject); begin BtnSetChecked(DesktopCheck, not BtnGetChecked(DesktopCheck)); DesktopClick(DesktopCheck); end; procedure QuickLaunchClick(hBtn:HWND); begin sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001); if BtnGetChecked(hBtn) then QuickLaunchLabel.Font.Color:=$00FFFF else QuickLaunchLabel.Font.Color:=$FFFFFF; end; procedure QuickLaunchLabelClick(Sender:TObject); begin BtnSetChecked(QuickLaunchCheck, not BtnGetChecked(QuickLaunchCheck)); QuickLaunchClick(QuickLaunchCheck); end; procedure DirectXClick(hBtn:HWND); begin sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001); if BtnGetChecked(hBtn) then DirectXLabel.Font.Color:=$00FFFF else DirectXLabel.Font.Color:=$FFFFFF; end; procedure DirectXLabelClick(Sender:TObject); begin BtnSetChecked(DirectXCheck, not BtnGetChecked(DirectXCheck)); DirectXClick(DirectXCheck); end; procedure DirectXProgress; begin StatusLabel.Caption:=ExpandConstant('{cm:DirectXInstall}') end; procedure RedistClick(hBtn:HWND); begin sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001); if BtnGetChecked(hBtn) then RedistLabel.Font.Color:=$00FFFF else RedistLabel.Font.Color:=$FFFFFF; end; procedure RedistLabelClick(Sender:TObject); begin BtnSetChecked(RedistCheck, not BtnGetChecked(RedistCheck)); RedistClick(RedistCheck); end; procedure RedistProgress; begin StatusLabel.Caption:=ExpandConstant('{cm:RedistInstall}') end; //procedure SelectLanguage(hBtn:HWND); //begin // sndPlaySound(ExpandConstant('{tmp}\Click.wav'),$0001); // BtnSetChecked(hBtn,True); // if hBtn=LanguageButton[1] then begin // BtnSetChecked(LanguageButton[2],False); // LngNameLbl.Caption:=ExpandConstant('{cm:LanguageRus}'); // Rus:= True; // end else begin // BtnSetChecked(LanguageButton[1],False); // LngNameLbl.Caption:=ExpandConstant('{cm:LanguageUS}'); // Rus:= False; // end; //end; procedure CreatePageComponents; var Pdm: string; vr,VidRam : Longint; Version: TWindowsVersion; begin PageNameLabel:=TLabel.Create(WizardForm); with PageNameLabel do begin AutoSize:= False; SetBounds(ScaleX(70), ScaleY(185), ScaleX(400), ScaleY(30)); Transparent:=True; Font.Name:= 'Georgia'; Font.Size:= 13; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Parent:=WizardForm; end; PageDescriptionLabel:=TLabel.Create(WizardForm); with PageDescriptionLabel do begin AutoSize:= False; SetBounds(ScaleX(100), ScaleY(215), ScaleX(600), ScaleY(50)); Wordwrap:= True; Transparent:=True; Font.Name:= 'Georgia'; Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold, fsItalic]; Parent:=WizardForm; end; ////////////////////// WelcomePage ////////////////////// WelcomeLabel1:= TLabel.Create(WizardForm); with WelcomeLabel1 do begin AutoSize:=False SetBounds(ScaleX(75), ScaleY(185), ScaleX(648), ScaleY(65)); WordWrap:=True Alignment := taCenter; Transparent:=True Font.Name:='Georgia'; Font.Size:= 16; Font.Color:=$FFFFFF; Font.Style:=[fsBold] Caption:= ExpandConstant('{cm:Welcome1}'); Parent:=WizardForm end; WelcomeLabel2:=TLabel.Create(WizardForm); with WelcomeLabel2 do begin AutoSize:=False SetBounds(ScaleX(75), ScaleY(275), ScaleX(648), ScaleY(200)); WordWrap:=True Transparent:=True Font.Name:='Georgia'; Font.Size:= 11; Font.Color:=$FFFFFF; Font.Style := [fsBold, fsItalic]; Caption:= ExpandConstant('{cm:Welcome2}'); Parent:=WizardForm end; ////////////////////// WelcomePage ////////////////////// ////////////////////// SystemPage ////////////////////// SystemPage:=CreateCustomPage(wpLicense, ExpandConstant('{cm:Requirements1}'), ExpandConstant('{cm:Requirements2}')); RequirementsLbl := TLabel.Create(WizardForm); with RequirementsLbl do begin AutoSize:=False; SetBounds(ScaleX(100), ScaleY(250), ScaleX(605), ScaleY(50)); Transparent:=True; Font.Name:= 'Georgia'; Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold, fsItalic]; Caption := ExpandConstant('{cm:Requirements3}'); Parent:=WizardForm; end; //================= Íà÷àëî - Ïðîöåññîð =================// ProcessorLbl := TLabel.Create(WizardForm); with ProcessorLbl do begin AutoSize:=False; SetBounds(ScaleX(107), ScaleY(296), ScaleX(150), ScaleY(22)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:Processor}'); Parent := WizardForm; end; ProcessorNameLbl := TLabel.Create(WizardForm); with ProcessorNameLbl do begin AutoSize:=False; SetBounds(ScaleX(278), ScaleY(296), ScaleX(400), ScaleY(22)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := DelSP(GetProcessorName) + ' @' + IntToStr(GetProcessorFreq) + ' MHz'; Parent := WizardForm; end; RegGetSubkeyNames(HKLM, 'Hardware\Description\System\CentralProcessor', Keys) if (GetProcessorFreq*GetArrayLength(Keys)) < {#Processor} then begin RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}'); AddLabelToArray(AsysReq,ProcessorNameLbl); end; //================= Êîíåö - Ïðîöåññîð =================// //================= Íà÷àëî - Âèäåîàäàïòåð =================// VideoCardLbl := TLabel.Create(WizardForm); with VideoCardLbl do begin AutoSize:=False; SetBounds(ScaleX(107), ScaleY(327), ScaleX(150), ScaleY(22)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:VideoCard}'); Parent := WizardForm; end; VideoCardNameLbl := TLabel.Create(WizardForm); with VideoCardNameLbl do begin AutoSize:=False; SetBounds(ScaleX(280), ScaleY(327), ScaleX(400), ScaleY(22)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := GetVideoCardName; Parent := WizardForm; end; Pdm:=' ['+IntToStr(GetPdmWidth)+'x'+IntToStr(GetPdmHeight)+']'; VidRam:=GetVidMemLocal/1000000; if (VidRam<63) or (VidRam>1100) then vr:=VidRam else if VidRam<100 then vr:=64 else if VidRam<200 then vr:=128 else if VidRam<300 then vr:=256 else if VidRam<400 then vr:=384 else if VidRam<600 then vr:=512 else if VidRam<800 then vr:=792 else if VidRam>800 then vr:=1024; if VidRam=0 then VideoCardNameLbl.Caption:=ExpandConstant('{cm:DeviceDriver}') else VideoCardNameLbl.Caption:=DelSp(VideoCardNameLbl.Caption)+' ~'+IntToStr(vr)+' MB'+Pdm; if vr<{#VideoCard} then begin RequirementsLbl.Caption:=ExpandConstant('{cm:Requirements4}'); AddLabelToArray(ASysReq,VideoCardNameLbl); end; //================= Êîíåö - Âèäåîàäàïòåð =================// //================= Íà÷àëî - Çâóêîâàÿ êàðòà =================// SoundCardLbl := TLabel.Create(WizardForm); with SoundCardLbl do begin AutoSize:=False; SetBounds(ScaleX(107), ScaleY(358), ScaleX(150), ScaleY(22)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:SoundCard}'); Parent := WizardForm; end; SoundCardNameLbl := TLabel.Create(WizardForm); with SoundCardNameLbl do begin AutoSize:=False; SetBounds(ScaleX(278), ScaleY(358), ScaleX(400), ScaleY(22)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := GetSoundCardName; Parent := WizardForm; end; if GetSoundCards = 0 then begin RequirementsLbl.Caption:= ExpandConstant('{cm:Requirements4}'); SoundCardNameLbl.Caption:= ExpandConstant('{cm:DeviceDriver}'); AddLabelToArray(ASysReq,SoundCardNameLbl); end; //================= Êîíåö - Çâóêîâàÿ êàðòà =================// //================= Íà÷àëî - ÎÇÓ =================// RAMLbl := TLabel.Create(WizardForm); with RAMLbl do begin AutoSize:=False; SetBounds(ScaleX(107), ScaleY(389), ScaleX(150), ScaleY(22)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:RAM}'); Parent := WizardForm; end; RAMTotalLbl := TLabel.Create(WizardForm); with RAMTotalLbl do begin AutoSize:=False; SetBounds(ScaleX(279), ScaleY(389), ScaleX(400), ScaleY(22)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := IntToStr(GetSystemPhys + 1) + ' MB'; Parent := WizardForm; end; if (GetSystemPhys+1)<{#RAM} then begin RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}'); AddLabelToArray(ASysReq,RAMTotalLbl); end; //================= Êîíåö - ÎÇÓ =================// //================= Íà÷àëî - Îïåðàöèîííàÿ ñèñòåìà =================// SystemLbl := TLabel.Create(WizardForm); with SystemLbl do begin AutoSize:=False; SetBounds(ScaleX(107), ScaleY(420), ScaleX(150), ScaleY(22)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:OperationSystem}'); Parent := WizardForm; end; SystemNameLbl := TLabel.Create(WizardForm); with SystemNameLbl do begin AutoSize:=False; SetBounds(ScaleX(279), ScaleY(420), ScaleX(400), ScaleY(22)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := GetWindowsName; Parent := WizardForm; end; GetWindowsVersionEx(Version); if not Version.NTPlatform or (Version.NTPlatform and (Version.Major<{#WinVerMajor})) or (Version.NTPlatform and (Version.Major={#WinVerMajor}) and (Version.Minor<{#WinVerMinor})) or (Version.NTPlatform and (Version.Major={#WinVerMajor}) and (Version.Minor={#WinVerMinor}) and (Version.ServicePackMajor<{#ServicePack})) then begin RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}'); AddLabelToArray(ASysReq,SystemNameLbl); end; //================= Êîíåö - Îïåðàöèîííàÿ ñèñòåìà =================// ////////////////////// SystemPage ////////////////////// ////////////////////// SelectDirPage ////////////////////// SelectDirBrowseLabel := TLabel.Create(WizardForm); with SelectDirBrowseLabel do begin AutoSize:=False; SetBounds(ScaleX(120), ScaleY(250), ScaleX(600), ScaleY(50)); WordWrap:= True; Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold, fsItalic]; Caption:= WizardForm.SelectDirBrowseLabel.Caption; Parent := WizardForm; end; DirEditLabel := TLabel.Create(WizardForm); with DirEditLabel do begin AutoSize:=False; SetBounds(ScaleX(127), ScaleY(308), ScaleX(446), ScaleY(15)); WordWrap:= True; ShowAccelChar := False; Transparent:=True; Font.Name:= 'Arial' Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width); Parent := WizardForm; end; TotalSpaceLabel := TLabel.Create(WizardForm); with TotalSpaceLabel do begin AutoSize:=False; SetBounds(ScaleX(130), ScaleY(360), ScaleX(500), ScaleY(17)); Transparent:=True; Font.Name:= 'Georgia'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold, fsItalic]; Parent := WizardForm; end; FreeSpaceLabel := TLabel.Create(WizardForm); with FreeSpaceLabel do begin AutoSize:=False; SetBounds(ScaleX(130), ScaleY(380), ScaleX(500), ScaleY(17)); Transparent:=True; Font.Name:= 'Georgia'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold, fsItalic]; Parent := WizardForm; end; NeedSpaceLabel := TLabel.Create(WizardForm); with NeedSpaceLabel do begin AutoSize:=False; SetBounds(ScaleX(130), ScaleY(420), ScaleX(500), ScaleY(17)); Transparent:=True; Font.Name:= 'Georgia'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold, fsItalic]; Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTB({#NeedSize}); Parent := WizardForm; end; NeedSpaceTLabel := TLabel.Create(WizardForm); with NeedSpaceTLabel do begin AutoSize:=False; SetBounds(ScaleX(130), ScaleY(400), ScaleX(500), ScaleY(17)); Transparent:=True; Font.Name:= 'Georgia'; Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold, fsItalic]; Caption := ExpandConstant('{cm:TNeedSpace} ') + MbOrTB({#TNeedSize}); Parent := WizardForm; end; ////////////////////// SelectDirPage ////////////////////// ////////////////////// SelectComponentsPage ////////////////////// ////////////////////// SelectComponentsPage ////////////////////// ////////////////////// SelectProgramGroupPage ////////////////////// SelectStartMenuFolderBrowseLabel := TLabel.Create(WizardForm); with SelectStartMenuFolderBrowseLabel do begin AutoSize:=False; SetBounds(ScaleX(120), ScaleY(250), ScaleX(600), ScaleY(50)); WordWrap:= True; Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold, fsItalic]; Caption:= WizardForm.SelectStartMenuFolderBrowseLabel.Caption; Parent := WizardForm; end; GroupEditLabel := TLabel.Create(WizardForm); with GroupEditLabel do begin AutoSize:=False; SetBounds(ScaleX(127), ScaleY(308), ScaleX(446), ScaleY(15)); WordWrap:= True; ShowAccelChar := False; Transparent:=True; Font.Name:= 'Arial' Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width); Parent := WizardForm; end; NoIconsCheck:=BtnCreate(WizardForm.Handle,ScaleX(75),ScaleY(430),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),8,True); BtnSetEvent(NoIconsCheck,BtnClickEventID,WrapBtnCallback(@NoIconsClick,1)); BtnSetEvent(NoIconsCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetCursor(NoIconsCheck,GetSysCursorHandle(32649)); NoIconsLabel := TLabel.Create(WizardForm); with NoIconsLabel do begin AutoSize:=False; SetBounds(ScaleX(115), ScaleY(437), ScaleX(275), ScaleY(17)); OnClick:= @NoIconsLabelClick; Cursor:= CrHand; Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold,fsItalic]; Caption := WizardForm.NoIconsCheck.Caption; Parent := WizardForm; end; WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption; WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text; WizardForm.GroupEdit.OnChange := @GroupChange; ////////////////////// SelectProgramGroupPage ////////////////////// ////////////////////// SelectTasksPade ////////////////////// SelectTasksPage := CreateCustomPage(wpSelectProgramGroup, ExpandConstant('{cm:TasksName}'), ExpandConstant('{cm:TasksDescription}')); SelectTasksLabel := TLabel.Create(WizardForm); with SelectTasksLabel do begin AutoSize:=False; SetBounds(ScaleX(120), ScaleY(250), ScaleX(600), ScaleY(50)); WordWrap:= True; Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold, fsItalic]; Caption:= ExpandConstant('{cm:SelectTasksLabel}'); Parent := WizardForm; end; DesktopCheck:=BtnCreate(WizardForm.Handle,ScaleX(75),ScaleY(303),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),8,True); BtnSetEvent(DesktopCheck,BtnClickEventID,WrapBtnCallback(@DesktopClick,1)); BtnSetEvent(DesktopCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetCursor(DesktopCheck,GetSysCursorHandle(32649)); DesktopLabel := TLabel.Create(WizardForm); with DesktopLabel do begin AutoSize:=False; SetBounds(ScaleX(115), ScaleY(310), ScaleX(265), ScaleY(17)); OnClick:= @DesktopLabelClick; Cursor:= CrHand; Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Color:=$00FFFF; Font.Style:=[fsBold,fsItalic]; Caption := ExpandConstant('{cm:Desktop}'); Parent := WizardForm; end; QuickLaunchCheck:=BtnCreate(WizardForm.Handle,ScaleX(75),ScaleY(333),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),8,True); BtnSetEvent(QuickLaunchCheck,BtnClickEventID,WrapBtnCallback(@QuickLaunchClick,1)); BtnSetEvent(QuickLaunchCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetCursor(QuickLaunchCheck,GetSysCursorHandle(32649)); QuickLaunchLabel := TLabel.Create(WizardForm); with QuickLaunchLabel do begin AutoSize:=False; SetBounds(ScaleX(115), ScaleY(340), ScaleX(345), ScaleY(17)); OnClick:= @QuickLaunchLabelClick; Cursor:= CrHand; Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold,fsItalic]; Caption := ExpandConstant('{cm:QuickLaunch}'); Parent := WizardForm; end; DirectXCheck:=BtnCreate(WizardForm.Handle,ScaleX(75),ScaleY(363),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),8,True); BtnSetEvent(DirectXCheck,BtnClickEventID,WrapBtnCallback(@DirectXClick,1)); BtnSetEvent(DirectXCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); BtnSetCursor(DirectXCheck,GetSysCursorHandle(32649)); DirectXLabel := TLabel.Create(WizardForm); with DirectXLabel do begin AutoSize:=False; SetBounds(ScaleX(115), ScaleY(370), ScaleX(145), ScaleY(17)); OnClick:= @DirectXLabelClick; Cursor:= CrHand; Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold,fsItalic]; Caption := ExpandConstant('{cm:DirectX}'); Parent := WizardForm; end; // LanguageLabel := TLabel.Create(WizardForm); // with LanguageLabel do begin // AutoSize:=False; // SetBounds(ScaleX(115), ScaleY(410), ScaleX(400), ScaleY(17)); // Transparent:=True; // Font.Name:= 'Georgia' // Font.Size:= 10; // Font.Color:=$FFFFFF; // Font.Style:=[fsBold, fsItalic]; // Caption:= ExpandConstant('{cm:Language}'); // Parent := WizardForm; // end; // LngNameLbl := TLabel.Create(WizardForm); // with LngNameLbl do begin // AutoSize:=False; // SetBounds(ScaleX(300), ScaleY(410), ScaleX(100), ScaleY(17)); // Transparent:=True; // Font.Name:= 'Georgia' // Font.Size:= 10; // Font.Color:=$00FFFF; // Font.Style:=[fsBold, fsItalic]; // Caption:= ExpandConstant('{cm:LanguageRus}'); // Parent := WizardForm; // end; // LanguageButton[1]:=BtnCreate(WizardForm.Handle,ScaleX(395),ScaleY(403),ScaleX(48),ScaleY(36),ExpandConstant('{tmp}\ru.png'),0,True); // BtnSetEvent(LanguageButton[1],BtnClickEventID,WrapBtnCallback(@SelectLanguage,1)); // BtnSetEvent(LanguageButton[1],BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); // BtnSetCursor(LanguageButton[1],GetSysCursorHandle(32649)); // LanguageButton[2]:=BtnCreate(WizardForm.Handle,ScaleX(460),ScaleY(403),ScaleX(48),ScaleY(36),ExpandConstant('{tmp}\us.png'),0,True); // BtnSetEvent(LanguageButton[2],BtnClickEventID,WrapBtnCallback(@SelectLanguage,1)); // BtnSetEvent(LanguageButton[2],BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1)); // BtnSetCursor(LanguageButton[2],GetSysCursorHandle(32649)); // BtnSetChecked(LanguageButton[1],True); ////////////////////// SelectTasksPade ////////////////////// ////////////////////// InstallingPage ////////////////////// StatusLabel := TLabel.Create(WizardForm); with StatusLabel do begin AutoSize:=False; SetBounds(ScaleX(120), ScaleY(245), ScaleX(558), ScaleY(17)); Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold,fsItalic]; Parent := WizardForm; end; FilenameLabel := TLabel.Create(WizardForm); with FilenameLabel do begin AutoSize:=False; SetBounds(ScaleX(120), ScaleY(270), ScaleX(558), ScaleY(17)); Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 9; Font.Color:=$FFFFFF; Font.Style:=[fsBold,fsItalic]; Parent := WizardForm; end; ProgressInfoLabel := TLabel.Create(WizardForm); with ProgressInfoLabel do begin AutoSize:=False; SetBounds(ScaleX(80), ScaleY(355), ScaleX(638), ScaleY(17)); Alignment := taCenter; Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold,fsItalic]; Parent := WizardForm; end; ////////////////////// InstallingPage ////////////////////// ////////////////////// FinishedPage ////////////////////// FinishedHeadingLabel:= TLabel.Create(WizardForm); with FinishedHeadingLabel do begin AutoSize:=False SetBounds(ScaleX(75), ScaleY(185), ScaleX(648), ScaleY(65)); WordWrap:=True Alignment := taCenter; Transparent:=True Font.Name:='Georgia'; Font.Size:= 16; Font.Color:=$FFFFFF; Font.Style:=[fsBold] Caption:= ExpandConstant('{cm:FinishedHeading}'); Parent:=WizardForm end; FinishedLabel:=TLabel.Create(WizardForm); with FinishedLabel do begin AutoSize:=False SetBounds(ScaleX(75), ScaleY(275), ScaleX(648), ScaleY(200)); WordWrap:=True Transparent:=True Font.Name:='Georgia'; Font.Size:= 11; Font.Color:=$FFFFFF; Font.Style := [fsBold, fsItalic]; Caption:= ExpandConstant('{cm:FinishedLabel}')+#13#13+ExpandConstant('{cm:FinishedLabel2}'); Parent:=WizardForm end; end; ////////////////////// FinishedPage ////////////////////// ////////////////////// UninstallingPage ////////////////////// function InitializeUninstall: Boolean; begin FileCopy(ExpandConstant('{app}\botva2.dll'), ExpandConstant('{tmp}\botva2.dll'), False); FileCopy(ExpandConstant('{app}\innocallback.dll'), ExpandConstant('{tmp}\innocallback.dll'), False); FileCopy(ExpandConstant('{app}\isskin.dll'), ExpandConstant('{tmp}\isskin.dll'), False); FileCopy(ExpandConstant('{app}\Tiger.cjstyles'), ExpandConstant('{tmp}\Tiger.cjstyles'), False); LoadSkin(ExpandConstant('{tmp}\Tiger.cjstyles'), ''); Result:=True; end; //================== Óäàëåíèå ñîõðàíåíèé ==================// procedure DeleteSavedGames(CurUninstallStep: TUninstallStep); begin if CurUninstallStep=usUninstall then if DirExists(ExpandConstant('{userdocs}')+'\Syndicate') then if MsgBox(ExpandConstant('{cm:DeleteSave}'), mbInformation, MB_YESNO) = idYes then DelTree(ExpandConstant('{userdocs}')+'\Syndicate', True, True, True) end; //================== Óäàëåíèå ñîõðàíåíèé ==================// procedure InitializeUninstallProgressForm; var h:HWND; begin with UninstallProgressForm do begin ClientWidth:=ScaleX(798); ClientHeight:=ScaleY(543); BorderStyle:=bsSingle BorderIcons:=[biSystemMenu] OuterNotebook.Hide; InnerNotebook.Hide; Center; Bevel.Hide; CancelButton.Left:=ScaleX(660); CancelButton.Top:=ScaleY(495); CancelButton.Width:=CancelButton.Width+15; WizardUninstLabel := TLabel.Create(UninstallProgressForm); with WizardUninstLabel do begin AutoSize:=False; SetBounds(ScaleX(70), ScaleY(185), ScaleX(400), ScaleY(30)); Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 13; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption:= ExpandConstant('{cm:WizardUninst}'); Parent := UninstallProgressForm; end; UninstPageDescriptLabel := TLabel.Create(UninstallProgressForm); with UninstPageDescriptLabel do begin AutoSize:=False; SetBounds(ScaleX(100), ScaleY(215), ScaleX(600), ScaleY(50)); WordWrap:= True; Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold, fsItalic]; Caption:= ExpandConstant('{cm:UninstDescript}'); Parent := UninstallProgressForm; end; StatusUninstLabel := TLabel.Create(UninstallProgressForm); with StatusUninstLabel do begin AutoSize:=False; SetBounds(ScaleX(120), ScaleY(250), ScaleX(560), ScaleY(17)); Transparent:=True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold, fsItalic]; Caption:= ExpandConstant('{cm:StatusUninst}'); Parent := UninstallProgressForm; end; Installing := TLabel.Create(UninstallProgressForm); with Installing do begin AutoSize:=False; SetBounds(ScaleX(170), ScaleY(96), ScaleX(114), ScaleY(20)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:Installing}'); Parent := UninstallProgressForm; end; Uninstalling := TLabel.Create(UninstallProgressForm); with Uninstalling do begin AutoSize:=False; SetBounds(ScaleX(570), ScaleY(96), ScaleX(114), ScaleY(20)); Transparent:=True; Font.Name:= 'Arial'; Font.Size:= 10; Font.Color:=$00FFFF; Font.Style:=[fsBold]; Caption := ExpandConstant('{cm:Uninstalling}'); Parent := UninstallProgressForm; end; ProgressInfoLabel := TLabel.Create(UninstallProgressForm); with ProgressInfoLabel do begin AutoSize:=False; SetBounds(ScaleX(120), ScaleY(355), ScaleX(560), ScaleY(17)); Alignment := taCenter; Transparent:=True; Font.Name:= 'Georgia'; Font.Size:= 10; Font.Color:=$FFFFFF; Font.Style:=[fsBold,fsItalic]; Parent := UninstallProgressForm; end; h:=UninstallProgressForm.Handle; FileCopy(ExpandConstant('{app}\WizardImage.jpg'), ExpandConstant('{tmp}\WizardImage.jpg'), False); FileCopy(ExpandConstant('{app}\Workspace.png'), ExpandConstant('{tmp}\Workspace.png'), False); FileCopy(ExpandConstant('{app}\StatusPanel.png'), ExpandConstant('{tmp}\StatusPanel.png'), False); FileCopy(ExpandConstant('{app}\StatusPanel2.png'), ExpandConstant('{tmp}\StatusPanel2.png'), False); FileCopy(ExpandConstant('{app}\button.png'), ExpandConstant('{tmp}\button.png'), False); FileCopy(ExpandConstant('{app}\ProgressBackground.png'), ExpandConstant('{tmp}\ProgressBackground.png'), False); FileCopy(ExpandConstant('{app}\ProgressImg.png'), ExpandConstant('{tmp}\ProgressImg.png'), False); ImgLoad(h,ExpandConstant('{tmp}\WizardImage.jpg'),ScaleX(0),ScaleY(0),UninstallProgressForm.ClientWidth,UninstallProgressForm.ClientHeight,True,True); ImgLoad(h,ExpandConstant('{tmp}\Workspace.png'),ScaleX(42), ScaleY(160),ScaleX(714),ScaleY(309),True,True); ImgLoad(h,ExpandConstant('{tmp}\StatusPanel.png'),ScaleX(0), ScaleY(95),UninstallProgressForm.ClientWidth,ScaleY(20),True,True); ImgLoad(h,ExpandConstant('{tmp}\StatusPanel2.png'),ScaleX(399), ScaleY(95),ScaleX(399), ScaleY(20),True,True); ImgLoad(h,ExpandConstant('{tmp}\ProgressBackground.png'),119,300,560,25,True,True); UPFButtonFont:=TFont.Create; UPFButtonFont.Style:=[fsBold]; UninstallProgressForm.CancelButton.Visible:=False; with UninstallProgressForm.CancelButton do begin hCancelUninstBtn:=BtnCreate(h,Left-8,Top-8,Width+16,Height+16,ExpandConstant('{tmp}\button.png'),18,False); BtnSetText(hCancelUninstBtn, UninstallProgressForm.CancelButton.Caption); BtnSetFont(hCancelUninstBtn,UPFButtonFont.Handle); BtnSetFontColor(hCancelUninstBtn,$DAE369,$DAE369,$DAE369,$B6B6B6); BtnSetEnabled(hCancelUninstBtn,False); end; end; ImgApplyChanges(h); end; ////////////////////// UninstallingPage ////////////////////// procedure HideComponents; begin WelcomeLabel1.Hide; WelcomeLabel2.Hide; RequirementsLbl.Hide; ProcessorLbl.Hide; ProcessorNameLbl.Hide; VideoCardLbl.Hide; VideoCardNameLbl.Hide; SoundCardLbl.Hide; SoundCardNameLbl.Hide; RAMLbl.Hide; RAMTotalLbl.Hide; SystemLbl.Hide; SystemNameLbl.Hide; SelectDirBrowseLabel.Hide; DirEditLabel.Hide; TotalSpaceLabel.Hide; FreeSpaceLabel.Hide; NeedSpaceLabel.Hide; NeedSpaceTLabel.Hide; NoIconsLabel.Hide; SelectStartMenuFolderBrowseLabel.Hide; WizardForm.GroupBrowseButton.Hide; GroupEditLabel.Hide; SelectTasksLabel.Hide; DesktopLabel.Hide; QuickLaunchLabel.Hide; DirectXLabel.Hide; // LanguageLabel.Hide; // LngNameLbl.Hide; StatusLabel.Hide; FilenameLabel.Hide; FinishedHeadingLabel.Hide; FinishedLabel.Hide; ProgressInfoLabel.Hide; WizardForm.ComponentsList.Hide; #ifdef ISDone LabelTime3.Hide; LabelStatusRollback.Hide; LabelStatus.Hide; #endif #ifdef FreeArc LabelStatusRollback.Hide; LabelStatus.Hide; #endif #ifdef Components Comp1Label.Hide; Comp2Label.Hide; Comp3Label.Hide; Comp4Label.Hide; Comp5Label.Hide; Comp6Label.Hide; #endif end; procedure ShowComponents(CurPageID: Integer); begin PageNameLabel.Caption:=WizardForm.PageNameLabel.Caption PageDescriptionLabel.Caption:=WizardForm.PageDescriptionLabel.Caption case CurPageID of wpWelcome: begin Welcome.Font.Color := $00FFFF; #ifdef Components ImgSetPosition(StatusPanel,ScaleX(0),ScaleY(95),ScaleX(100),ScaleY(20)); #else ImgSetPosition(StatusPanel,ScaleX(0),ScaleY(95),ScaleX(114),ScaleY(20)); #endif WelcomeLabel1.Show WelcomeLabel2.Show end; SystemPage.ID: begin System.Font.Color := $00FFFF; #ifdef Components ImgSetPosition(StatusPanel,ScaleX(100),ScaleY(95),ScaleX(100),ScaleY(20)); #else ImgSetPosition(StatusPanel,ScaleX(114),ScaleY(95),ScaleX(114),ScaleY(20)); #endif ImgSetVisibility(RequirementsPanel,True); RequirementsLbl.Show; ProcessorLbl.Show; ProcessorNameLbl.Show; VideoCardLbl.Show; VideoCardNameLbl.Show; SoundCardLbl.Show; SoundCardNameLbl.Show; RAMLbl.Show; RAMTotalLbl.Show; SystemLbl.Show; SystemNameLbl.Show; end; wpSelectDir: begin Catalogue.Font.Color := $00FFFF; #ifdef Components ImgSetPosition(StatusPanel,ScaleX(200),ScaleY(95),ScaleX(100),ScaleY(20)); #else ImgSetPosition(StatusPanel,ScaleX(228),ScaleY(95),ScaleX(114),ScaleY(20)); #endif ImgSetVisibility(Edit,True); ImgSetVisibility(DirFolder,True); ImgSetVisibility(HardDrivePanel,True); ImgSetVisibility(HDD,True); BtnSetVisibility(hDirBrowseBtn,True); SelectDirBrowseLabel.Show DirEditLabel.Show; TotalSpaceLabel.Show; FreeSpaceLabel.Show; NeedSpaceLabel.Show; NeedSpaceTLabel.Show; end; #ifdef Components SelectComponentsPage.ID: begin Components.Font.Color := $00FFFF; ImgSetPosition(StatusPanel,ScaleX(300),ScaleY(95),ScaleX(100),ScaleY(20)); WizardForm.ComponentsList.Show; BtnSetVisibility(Comp1Check,True); BtnSetVisibility(Comp2Check,True); BtnSetVisibility(Comp3Check,True); BtnSetVisibility(Comp4Check,True); BtnSetVisibility(Comp5Check,True); BtnSetVisibility(Comp6Check,True); Comp1Label.Show; Comp2Label.Show; Comp3Label.Show; Comp4Label.Show; Comp5Label.Show; Comp6Label.Show; end; #endif wpSelectProgramGroup: begin StartMenu.Font.Color := $00FFFF; #ifdef Components ImgSetPosition(StatusPanel,ScaleX(400),ScaleY(95),ScaleX(100),ScaleY(20)); #else ImgSetPosition(StatusPanel,ScaleX(342),ScaleY(95),ScaleX(114),ScaleY(20)); #endif ImgSetVisibility(GroupFolder,True); ImgSetVisibility(Edit,True); BtnSetVisibility(hGroupBrowseBtn,True); BtnSetVisibility(NoIconsCheck,True); SelectStartMenuFolderBrowseLabel.Show; WizardForm.GroupBrowseButton.Show; GroupEditLabel.Show; NoIconsLabel.Show; end; SelectTasksPage.ID: begin Tasks.Font.Color := $00FFFF; #ifdef Components ImgSetPosition(StatusPanel,ScaleX(500),ScaleY(95),ScaleX(100),ScaleY(20)); #else ImgSetPosition(StatusPanel,ScaleX(456),ScaleY(95),ScaleX(114),ScaleY(20)); #endif BtnSetVisibility(DesktopCheck,True); BtnSetVisibility(QuickLaunchCheck,True); BtnSetVisibility(DirectXCheck,True); BtnSetVisibility(LanguageButton[1],True); BtnSetVisibility(LanguageButton[2],True); BtnSetChecked(DesktopCheck,True); SelectTasksLabel.Show; DesktopLabel.Show; QuickLaunchLabel.Show; DirectXLabel.Show; // LanguageLabel.Show; // LngNameLbl.Show; WizardForm.NextButton.Caption:=SetupMessage(msgButtonInstall); end; wpInstalling: begin Installing.Font.Color := $00FFFF; #ifdef Components ImgSetPosition(StatusPanel,ScaleX(600),ScaleY(95),ScaleX(100),ScaleY(20)); #else ImgSetPosition(StatusPanel,ScaleX(570),ScaleY(95),ScaleX(114),ScaleY(20)); #endif StatusLabel.Show; FilenameLabel.Show; ProgressInfoLabel.Show; end; wpFinished: begin Finish.Font.Color := $00FFFF; #ifdef Components ImgSetPosition(StatusPanel,ScaleX(700),ScaleY(95),ScaleX(100),ScaleY(20)); #else ImgSetPosition(StatusPanel,ScaleX(684),ScaleY(95),ScaleX(114),ScaleY(20)); #endif BtnSetPosition(hNextBtn, ScaleX(657),ScaleY(487),ScaleX(106),ScaleY(39)); FinishedHeadingLabel.Show; FinishedLabel.Show; ImgSetVisibility(PBBkg1Img,False); ImgSetVisibility(PBBkg2Img,False); ImgSetVisibility(PB1Img,False); ImgSetVisibility(PB2Img,False); #ifdef ISDone LabelTime3.Show; ImgSetVisibility(PB3Img,False); #endif #ifdef FreeArc ImgSetVisibility(PB3Img,False); #endif end end; end; //************************************************ [Êîíåö - Êîìïîíåíòû ñòðàíèö] ***************************************************// //************************************************ [Íà÷àëî - ÏðîãðåññÁàðû] ***************************************************// function PBProcUninst(h:hWnd;Msg,wParam,lParam:Longint):Longint; var pr,i1,i2:Extended; p:string; w : integer; begin if Msg=$2 then SetWindowLong(h,-4,PBOldProc); Result:=CallWindowProc(PBOldProc,h,Msg,wParam,lParam); if (Msg=$402) and (UninstallProgressForm.ProgressBar.Position>UninstallProgressForm.ProgressBar.Min) then begin i1:=UninstallProgressForm.ProgressBar.Position-UninstallProgressForm.ProgressBar.Min; i2:=UninstallProgressForm.ProgressBar.Max-UninstallProgressForm.ProgressBar.Min; pr:=i1*100/i2; p:=IntToStr(Round(pr))+' %'; ProgressInfoLabel.Caption:=ExpandConstant('{cm:AllProgressUninst} ')+p; w:=Round(558*pr/100); ImgSetPosition(PB3Img,120,302,w,21); ImgApplyChanges(UninstallProgressForm.Handle); end; end; procedure AllCancel; begin SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc); ImgSetVisibility(AImg[CurrentImage],False); ImgSetVisibility(WizardImg,True); ImgSetVisibility(PBImg,False); ImgSetVisibility(PBBkgImg,False); ImgApplyChanges(WizardForm.Handle); end; procedure CurStepChanged(CurStep: TSetupStep); begin #ifdef ISDone UnpackingISDone(CurStep); #endif #ifdef FreeArc UnpackingArc(CurStep); #endif case CurStep of ssInstall: begin if GetArrayLength(ADisk)>0 then begin KillTimer(WizardForm.Handle,WFDiskTimerID); SetArrayLength(ADisk,0); end; if GetArrayLength(ASysReq)>0 then begin KillTimer(WizardForm.Handle,WFSysReqTimerID); SetArrayLength(ASysReq,0); end; WizardForm.ProgressGauge.Visible:=False; OldPosition:=0; CurrentImage:=0; ImgSetVisibility(WizardImg,False); ImgSetVisibility(AImg[0],True); #ifndef ISDone #ifndef FreeArc // Ïðîãðåññáàðû ñîçäàþòñÿ â ñêðèïòå // PBBkgImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\ProgressBackground.png'),119,300,560,25,True,True); ImgApplyChanges(WizardForm.Handle); PBImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\ProgressImg.png'),120,302,558,21,True,True); PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,CallBackProc(@PBProc,4)); #endif #endif sTime:=GetTickCount; eTime:=sTime; ProgressStep:=100 div GetArrayLength(AImg); end; ssPostInstall: AllCancel; end; end; procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); begin DeleteSavedGames(CurUninstallStep); case CurUninstallStep of usUninstall: begin UninstallProgressForm.ProgressBar.Visible:=False; PB3Img:=ImgLoad(UninstallProgressForm.Handle,ExpandConstant('{tmp}\ProgressImg.png'),120,302,558,21,True,True); PBOldProc:=SetWindowLong(UninstallProgressForm.ProgressBar.Handle,-4,CallBackProc(@PBProcUninst,4)); end; end; end; procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean); begin if CurPageID=wpInstalling then begin Confirm:=False; Cancel:=ExitSetupMsgBox; if Cancel then begin AllCancel; StatusLabel.Caption:=SetupMessage(msgStatusRollback); FilenameLabel.Hide; ProgressInfoLabel.Hide; PageNameLabel.Hide; PageDescriptionLabel.Hide; WizardForm.CancelButton.Enabled:=False; end; end; end; //************************************************ [Êîíåö - ÏðîãðåññÁàðû] ***************************************************// procedure InitializeWizard; begin CreateStatusPanel; CreateWizardImage; ButtonsTextures; InsertMusic; CreatePageComponents; #ifdef Components CreateComponents; #endif #ifdef ISDone CreateISDoneComponents; #endif #ifdef FreeArc CreateArcComponents; #endif end; procedure CurPageChanged(CurPageID: Integer); begin SetStateNewButtons; Welcome.Font.Color := $FFFFFF; System.Font.Color := $FFFFFF; Catalogue.Font.Color := $FFFFFF; #ifdef Components Components.Font.Color := $FFFFFF; #endif StartMenu.Font.Color := $FFFFFF; Tasks.Font.Color := $FFFFFF; Installing.Font.Color :=$FFFFFF; Finish.Font.Color := $FFFFFF; HideComponents; ImgSetVisibility(RequirementsPanel,False); ImgSetVisibility(Edit,False); ImgSetVisibility(DirFolder,False); BtnSetVisibility(hDirBrowseBtn,False); ImgSetVisibility(HardDrivePanel,False); ImgSetVisibility(HDD,False); ImgSetVisibility(GroupFolder,False); BtnSetVisibility(hGroupBrowseBtn,False); BtnSetVisibility(NoIconsCheck,False); BtnSetVisibility(DesktopCheck,False); BtnSetVisibility(QuickLaunchCheck,False); BtnSetVisibility(DirectXCheck,False); BtnSetVisibility(LanguageButton[1],False); BtnSetVisibility(LanguageButton[2],False); #ifdef Components BtnSetVisibility(Comp1Check,False); BtnSetVisibility(Comp2Check,False); BtnSetVisibility(Comp3Check,False); BtnSetVisibility(Comp4Check,False); BtnSetVisibility(Comp5Check,False); BtnSetVisibility(Comp6Check,False); #endif ShowComponents(CurPageID); ImgApplyChanges(WizardForm.Handle); #ifdef ISDone UnpackingISDoneFinished(CurPageID); #endif #ifdef FreeArc UnpackingArcFinished(CurPageID); #endif if GetArrayLength(ASysReq)>0 then if CurPageID=SystemPage.ID then SetTimer(WizardForm.Handle,WFSysReqTimerID,1000,WrapTimerProc(@SysReqFlashing,4)) else KillTimer(WizardForm.Handle,WFSysReqTimerID); if CurPageID=wpSelectDir then begin OldDisk:=''; GetFreeSpaceCaption(nil); end else if GetArrayLength(ADisk)>0 then KillTimer(WizardForm.Handle,WFDiskTimerID); end; procedure DeinitializeSetup; begin #ifdef Autorun if ContinueInstall then begin #endif BASS_Stop; BASS_Free; WFButtonFont.Free; ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')),0); UnloadSkin; SetArrayLength(AImg,0); gdipShutdown; #ifdef Autorun end; #endif end; procedure DeinitializeUninstall; begin gdipShutdown; UnloadSkin; if Assigned(UPFButtonFont) then UPFButtonFont.Free; end; |