var
DirTreeView: TFolderTreeView;
Edit: TEdit;
Reset_Path_Button: TButton;
procedure DirFolderChange(Sender: TObject);
begin
if TFolderTreeView(Sender).Directory <> WizardDirValue then Edit.Text :=(TFolderTreeView(Sender).Directory) + '{#SetupSetting("")}' else Edit.Text := TFolderTreeView(Sender).Directory;
end;
procedure BrowseForm_Buttons_OnClick(Sender: TObject);
begin
case TButton(Sender).Caption of
'Reset':
begin
// Edit.Text := RemoveBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}'));
// TButton(Sender).Enabled := False;
end;
SetupMessage(msgButtonNewFolder):
begin
DirTreeView.CreateNewDirectory('Новая папка');
Edit.Text :=(DirTreeView.Directory) + '{#SetupSetting("")}';
end;
SetupMessage(msgButtonOK): if Edit.Text <> WizardForm.DirEdit.Text then WizardForm.DirEdit.Text := Edit.Text;
end;
end;
procedure BrowseClick(Sender: TObject);
var
DefaultInstallPath: String;
BrowseForm: TForm;
begin
DefaultInstallPath := WizardDirValue;
BrowseForm := TForm.Create(nil);
with BrowseForm do
begin
ClientWidth := ScaleX(350);
ClientHeight := ScaleY(364);
Position := poScreenCenter;
Caption := #32 + SetupMessage(msgBrowseDialogTitle);
with TLabel.Create(nil) do
begin
SetBounds(ScaleX(10), ScaleY(10), ScaleX(207), ScaleY(16));
Caption := SetupMessage(msgBrowseDialogLabel);
Parent := BrowseForm;
end;
DirTreeView := TFolderTreeView.Create(nil)
with DirTreeView do
begin
SetBounds(ScaleX(15), ScaleY(65), ScaleX(320), ScaleY(255));
OnChange := @DirFolderChange;
Parent := BrowseForm;
end;
ActiveControl := DirTreeView;
Edit := TEdit.Create(nil);
with Edit do
begin
SetBounds(ScaleX(15), ScaleY(35), ScaleX(320), ScaleY(21));
Text := DirTreeView.Directory;
Parent := BrowseForm;
end;
with TButton.Create(nil) do
begin
SetBounds(ScaleX(260), ScaleY(330), ScaleX(80), ScaleX(23));
Parent := BrowseForm;
Caption := SetupMessage(msgButtonCancel);
Cursor := crHand;
ModalResult := mrCancel;
end;
with TButton.Create(nil) do
begin
SetBounds(ScaleX(15), ScaleY(330), ScaleX(90), ScaleY(22));
Parent := BrowseForm;
Caption := SetupMessage(msgButtonNewFolder);
Cursor := crHand;
OnClick := @BrowseForm_Buttons_OnClick;
end;
with TButton.Create(nil) do
begin
SetBounds(ScaleX(175), ScaleY(330), ScaleX(80), ScaleY(23));
Parent := BrowseForm;
Caption := SetupMessage(msgButtonOK);
OnClick := @BrowseForm_Buttons_OnClick;
Cursor := crHand;
ModalResult := mrOk;
end;
DirTreeView.ChangeDirectory(AddBackslash(DefaultInstallPath), True);
if ShowModal = mrOk then WizardForm.DirEdit.Text := Edit.Text else WizardForm.DirEdit.Text := DefaultInstallPath;
Free;
end;
end;
procedure InitializeWizard();
begin
WizardForm.DirBrowseButton.OnClick := @BrowseClick;
end;[/SPOILER]
так че два раза будет писать название игры?ShTeCvV, пишеш название игры типа
type
TBtnEventProc = procedure (h:HWND);
const
BtnClickEventID = 1;
BtnMouseEnterEventID = 2;
var
DesktopCheck: HWND;
DesktopLabel: TLabel;
function WrapBtnCallback(Callback: TBtnEventProc; ParamCount: Integer): Longword; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload';
function BtnCreate(hParent:HWND; Left,Top,Width,Height:integer; FileName:PAnsiChar; ShadowWidth:integer; IsCheckBtn:boolean):HWND; external 'BtnCreate@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetEvent(h:HWND; EventID:integer; Event:Longword); external 'BtnSetEvent@{tmp}\botva2.dll stdcall delayload';
function BtnGetChecked(h:HWND):boolean; external 'BtnGetChecked@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetChecked(h:HWND; Value:boolean); external 'BtnSetChecked@{tmp}\botva2.dll stdcall delayload';
procedure BtnSetCursor(h:HWND; hCur:Cardinal); external 'BtnSetCursor@{tmp}\botva2.dll stdcall delayload';
function GetSysCursorHandle(id:integer):Cardinal; external 'GetSysCursorHandle@{tmp}\botva2.dll stdcall delayload';
procedure gdipShutdown; external 'gdipShutdown@{tmp}\botva2.dll stdcall delayload';
function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall';
function Desktop: Boolean;
begin
Result:= BtnGetChecked(DesktopCheck);
end;
procedure DesktopClick(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
if BtnGetChecked(hBtn) then DesktopLabel.Font.Color:=$0000FF else DesktopLabel.Font.Color:=$000000;
end;
procedure DesktopLabelClick(Sender:TObject);
begin
BtnSetChecked(DesktopCheck, not BtnGetChecked(DesktopCheck));
DesktopClick(DesktopCheck);
end;
procedure BtnEnter(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Enter.wav'),$0001);
end;
procedure InitializeWizard;
begin
ExtractTemporaryFile('Check.wav');
ExtractTemporaryFile('Enter.wav');
ExtractTemporaryFile('CheckBox.png');
ExtractTemporaryFile('botva2.dll');
ExtractTemporaryFile('InnoCallback.dll');
DesktopCheck:=BtnCreate(WizardForm.SelectDirPage.Handle,ScaleX(0),ScaleY(150),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),8,True);
BtnSetEvent(DesktopCheck,BtnClickEventID,WrapBtnCallback(@DesktopClick,1));
BtnSetEvent(DesktopCheck,BtnMouseEnterEventID,WrapBtnCallback(@BtnEnter,1));
BtnSetCursor(DesktopCheck,GetSysCursorHandle(32649));
DesktopLabel := TLabel.Create(WizardForm);
with DesktopLabel do begin
AutoSize:=False;
SetBounds(ScaleX(35), ScaleY(157), ScaleX(270), ScaleY(17));
OnClick:= @DesktopLabelClick;
Cursor:= CrHand;
Transparent:=True;
Caption := ExpandConstant('{cm:Desktop}');
Parent := WizardForm.SelectDirPage;
end;
end;
procedure DeinitializeSetup;
begin
gdipShutdown;
end;[/SPOILER]
Ну я ж отвечал, будет тогда писать "версия и название игры"...мне нужно вообще убрать версию..!ShTeCvV, я же тебе написал,там где appversiongame или как-то так пиши название игры