Как наложить чекбокс через ботву и задать функцию, чтобы при выборе устанавливался дополнительный софт через секциюКод:... Покажите пример пожалуйста...[/QUOTE] [SPOILER="чекбокс через ботву и задать функцию"]#define DirectX #include "Modules\botva2.iss" [Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}\My Program DefaultGroupName=My Program OutputBaseFilename=setup [Languages] Name: "rus"; MessagesFile: "compiler:Languages\Russian.isl" [CustomMessages] rus.DirectX=Обновить DirectX rus.DirectXInstall=Идет обновление DirectX... [Files] Source: "InstallFiles\*"; DestDir: "{tmp}"; Flags: dontcopy [Code] var DirectXCheck : HWND; DirectXLabel : TLabel; function InitializeSetup:boolean; begin if not FileExists(ExpandConstant('{tmp}\b2p.dll')) then ExtractTemporaryFile('b2p.dll'); if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll'); if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then ExtractTemporaryFile('CallbackCtrl.dll'); Result:=True; end; function DirectX: Boolean; begin Result:= BtnGetChecked(DirectXCheck); end; procedure DirectXClick(hBtn:HWND); begin if BtnGetChecked(hBtn) then DirectXLabel.Font.Color:=clBlue else DirectXLabel.Font.Color:=clBlack; end; procedure DirectXLabelClick(Sender:TObject); begin BtnSetChecked(DirectXCheck, not BtnGetChecked(DirectXCheck)); DirectXClick(DirectXCheck); end; procedure InitializeWizard(); begin ExtractTemporaryFile('CheckBox.png'); #ifdef DirectX //создаем чекбокс DirectXCheck:=BtnCreate(WizardForm.SelectDirPage.Handle, ScaleX(0),ScaleY(120),ScaleX(28),ScaleY(28),ExpandConstant('{tmp}\CheckBox.png'),0,True); BtnSetEvent(DirectXCheck,BtnClickEventID,WrapBtnCallback(@DirectXClick,1)); BtnSetCursor(DirectXCheck,GetSysCursorHandle(32649)); // создаем надпись к нему DirectXLabel := TLabel.Create(WizardForm); with DirectXLabel do begin AutoSize:=False; SetBounds(ScaleX(35), ScaleY(128), ScaleX(145), ScaleY(17)); OnClick:= @DirectXLabelClick; Cursor:= CrHand; Caption := ExpandConstant('{cm:DirectX}'); Parent := WizardForm.SelectDirPage; Font.Color:=clBlue; end; #endif end; procedure CurPageChanged(CurPageID: Integer); begin Case CurPageID of wpSelectDir: begin BtnSetChecked(DirectXCheck,True); end; end; end; procedure CurStepChanged(CurStep: TSetupStep); var ErrorCode: Integer; begin case CurStep of ssPostInstall: begin #ifdef DirectX if BtnGetChecked(DirectXCheck) then begin WizardForm.StatusLabel.Caption := ExpandConstant('{cm:DirectXInstall}'); Exec(ExpandConstant('{src}\Redist\DirectX\DXSETUP.exe'), '/silent', ExpandConstant('{src}\Redist\DirectX'), SW_HIDE, ewWaitUntilTerminated, ErrorCode); end; #endif end; end; end; procedure DeinitializeSetup; begin gdipShutdown; end;[/SPOILER]
procedure SetStateNewButtons;Как сменить надпись кнопки наложенной через ботву?
with TNewStaticText.Create(MyExit) do
begin
Left := ScaleX(110);
Top := ScaleY(20);
Width := MyExit.Width - ScaleX(115);
Height := MyExit.Height div 2;
WordWrap:=True;
//Transparent:=True;
Font.Name:='Arial';
Font.Style := [fsBold];
Font.Size:= 12;
Font.Color:=$ffffff;
Caption := ExpandConstant(SetupMessage(msgExitSetupMessage));
Parent := MyExit;
Font.Color := clWhite;
end;
with TLabel.Create(MyExit) do
begin
Left := ScaleX(110);
Top := ScaleY(20);
Width := MyExit.Width - ScaleX(115);
Height := MyExit.Height div 2;
WordWrap:=True;
Transparent:=True;
Font.Name:='Arial';
Font.Style := [fsBold];
Font.Size:= 12;
Font.Color:=$ffffff;
Caption := ExpandConstant(SetupMessage(msgExitSetupMessage));
Parent := MyExit;
Font.Color := clWhite;
end;
Доктор Ватсон отдыхает... А кстати как ты Edit прозрачный сделал или не через ботву чтобы туды сыды можно выделяти...это же элементарно
Ну ты и жмод... В личку хоть кинь...p.s. примера не дам
[Setup]
AppName=My Program
AppVersion=1.5
CreateAppDir=no
DisableProgramGroupPage=yes
DefaultGroupName=My Program
UninstallDisplayIcon={app}\MyProg.exe
OutputDir=.
[Code ]
{--- IShellLink ---}
const
CLSID_ShellLink = '{00021401-0000-0000-C000-000000000046}';
type
IShellLinkW = interface(IUnknown)
'{000214F9-0000-0000-C000-000000000046}'
procedure Dummy;
procedure Dummy2;
procedure Dummy3;
function GetDescription(pszName: String; cchMaxName: Integer): HResult;
function SetDescription(pszName: String): HResult;
function GetWorkingDirectory(pszDir: String; cchMaxPath: Integer): HResult;
function SetWorkingDirectory(pszDir: String): HResult;
function GetArguments(pszArgs: String; cchMaxPath: Integer): HResult;
function SetArguments(pszArgs: String): HResult;
function GetHotkey(var pwHotkey: Word): HResult;
function SetHotkey(wHotkey: Word): HResult;
function GetShowCmd(out piShowCmd: Integer): HResult;
function SetShowCmd(iShowCmd: Integer): HResult;
function GetIconLocation(pszIconPath: String; cchIconPath: Integer;
out piIcon: Integer): HResult;
function SetIconLocation(pszIconPath: String; iIcon: Integer): HResult;
function SetRelativePath(pszPathRel: String; dwReserved: DWORD): HResult;
function Resolve(Wnd: HWND; fFlags: DWORD): HResult;
function SetPath(pszFile: String): HResult;
end;
IPersist = interface(IUnknown)
'{0000010C-0000-0000-C000-000000000046}'
function GetClassID(var classID: TGUID): HResult;
end;
IPersistFile = interface(IPersist)
'{0000010B-0000-0000-C000-000000000046}'
function IsDirty: HResult;
function Load(pszFileName: String; dwMode: Longint): HResult;
function Save(pszFileName: String; fRemember: BOOL): HResult;
function SaveCompleted(pszFileName: String): HResult;
function GetCurFile(out pszFileName: String): HResult;
end;
function GetFileWorkingDirectoryFromLink(LinkFileName: string):string;
var
MyObject: IUnknown;
MySLink: IShellLinkW;
MyPFile: IPersistFile;
Dir: integer;
Tmp: string;
begin
Result := '';
if FileExists(LinkFileName) then
begin
MyObject := CreateComObject(StringToGuid(CLSID_ShellLink));
MyPFile := IPersistFile(MyObject);
MySLink := IShellLinkW(MyObject);
MyPFile.Load(LinkFileName, 0);
MySLink.GetWorkingDirectory(tmp,dir);
// MySLink.GetDescription(tmp,dir);
Result := tmp;
end;
end;
procedure InitializeWizard();
var str: string;
begin
str:= GetFileWorkingDirectoryFromLink(ExpandConstant('{userdesktop}\266.lnk'));
MsgBox(str, mbInformation, MB_OK);
end;
function GetFileWorkingDirectoryFromLink(LinkFileName: string):string;
var
MyObject: IUnknown;
MySLink: IShellLinkW;
MyPFile: IPersistFile;
Tmp: string;
begin
SetLength(Tmp, 512);
Result := '';
if FileExists(LinkFileName) then
begin
MyObject := CreateComObject(StringToGuid(CLSID_ShellLink));
MyPFile := IPersistFile(MyObject);
MySLink := IShellLinkW(MyObject);
MyPFile.Load(LinkFileName, 0);
MySLink.GetWorkingDirectory(tmp, 512);
// MySLink.GetDescription(tmp,dir);
Result := tmp;
end;
end;