Вопрос Запрет на установку ярлыков

Danser

Новичок
Доброго вечера. Подскажите, как исправить. При снятии флажков с установки ярлыков в меню "Пуск" и на рабочем столе они всё равно создаются.
Код:
[Icons]
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\Left.exe"; WorkingDir: "{app}"; Comment: "Left"; IconFilename: "{app}\cnruninstall.ico"; Parameters:
Name: "{group}\{#MyAppName}"; Filename: "{app}\Left.exe"; WorkingDir: "{app}"; IconFilename: "{app}\cnruninstall.ico"; Parameters:
Name: "{group}\Деинсталлировать Left"; Filename: "{uninstallexe}"; IconFilename: {app}\cnruninstall.ico;

[Tasks]
Name: DPO; Description: Дополнительное програмное обеспечение:;
Name: DPO/VC; Description: Установить Microsoft Visual C++ 2005 Redist;
Name: DPO/DirectX; Description: Установить DirectX;
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
 

Nemko

Дилетант
Модератор
Danser, доброго, нужно добавить Tasks: desktopicon;

Код:
#define MyAppName "My Application"

[Setup]
AppName={#MyAppName}
AppVersion=1.5
DefaultDirName={pf}\{#MyAppName}

[Tasks]
Name: DPO; Description: Дополнительное програмное обеспечение:;
Name: DPO/VC; Description: Установить Microsoft Visual C++ 2005 Redist;
Name: DPO/DirectX; Description: Установить DirectX;
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked;

[Icons]
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\Left.exe"; WorkingDir: "{app}"; Comment: "Left"; IconFilename: "{app}\cnruninstall.ico"; Tasks: desktopicon;
Name: "{group}\{#MyAppName}"; Filename: "{app}\Left.exe"; WorkingDir: "{app}"; IconFilename: "{app}\cnruninstall.ico";
Name: "{group}\Деинсталлировать Left"; Filename: "{uninstallexe}"; IconFilename: {app}\cnruninstall.ico;
 

Danser

Новичок
Спасибо, но чего-то не получилось, с Tasks: desktopicon; теперь вообще ярлык не выводится. То есть, ставь не ставь флажок - его нет.)
UPD: Может чего дописать ещё в скрипте надо? Я не очень-то силен ещё в этом деле.
 
Последнее редактирование:

Danser

Новичок
Разумеется, я пробовал. Пример Nemko прекрасно работает. Но если я его применяю к своему скрипту, то уже не работает. Почему, не понимаю.
 

Danser

Новичок
Код:
#define MyAppName "Omega Strike"
#define NeedSize 5892
#define AfterSize 3568
#define NeedMem 512

;#define records
;#define PrecompInside
#define SrepInside
#define pzlib
;#define facompress
;#define precomp "0.4"
#define unrar
;#define XDelta
#define PackZIP

#define icon "Files/icon.ico"
;#define FontT "Georgia"
//Èçìåíåíèå öâåòà òåêñòà//
#define Color "$b2b2b2"
#define Music

; Âðåìÿ ïðîÿâëåíèÿ êàðòèíêè Splash (1500ìñ = 1,5 ñåê)
#define SplS "1500"
; Âðåìÿ ïîêàçà êàðòèíêè Splash (3000ìñ = 3 ñåê)
#define SplR "3000"
; Âðåìÿ çàòóõàíèÿ êàðòèíêè Splash (1500ìñ = 1,5 ñåê)
#define SplE "1500"

[Setup]
AppName={#MyAppName}
AppVersion= 1.0
AppPublisher=
DefaultDirName={sd}Games\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma2/ultra64
SolidCompression=true
SetupIconFile={#icon}
DisableReadyPage=yes

[Files]
////////////////////////////Áèáèîòåêè (íóæíû äëÿ ðàáîòû èíñòàëëÿòîðà)!//////////////////////////////////////////
Source: dll\botva2.dll; DestDir: {tmp}; Flags: dontcopy;
Source: dll\IsMyFont.dll; DestDir: {tmp}; Flags: dontcopy;
Source: dll\b2p.dll; DestDir: {tmp}; Flags: dontcopy;
Source: dll\CallbackCtrl.dll; DestDir: {tmp}; Flags: dontcopy;
Source: dll\Tools.dll; DestDir: {tmp}; Flags: dontcopy;
////////////////////////////Ôàéëû èçîáðàæåíèé/////////////////////////////////////////
Source: Files\fon.jpg; DestDir: {tmp}; Flags: dontcopy
Source: Files\next.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\back.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\browse.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\Button1.png; DestDir: {tmp}; Flags: dontcopy
Source: Files\Button2.png; DestDir: {tmp}; Flags: dontcopy
#ifdef Music
Source: Music\*;  DestDir: {tmp}; Flags: dontcopy
#endif
Source: Files\Edit.png;  DestDir: {tmp}; Flags: dontcopy
Source: Files\work.png;  DestDir: {tmp}; Flags: dontcopy
Source: Files\CheckBox.png;  DestDir: {tmp}; Flags: dontcopy
Source: Files\pb.png;  DestDir: {tmp}; Flags: dontcopy
Source: Files\pbback.png;  DestDir: {tmp}; Flags: dontcopy

Source: "dll\isgsg.dll"; Flags: "DontCopy";
Source: "Files\splash.png"; Flags: "DontCopy";

;Source: "E:\Ñáîðêà\Bulletstorm v.1.0\Files\dlc_unlocker.exe"; DestDir: "{app}"; Flags: ignoreversion
;Source: "E:\Ñáîðêà\Bulletstorm v.1.0_pZLib_V3\Files\Patch.exe"; DestDir: "{app}\Data"; Flags: ignoreversion
;Source: "E:\Ñáîðêà\Bulletstorm v.1.0_pZLib_V3\Files\Authentication Patch.exe"; DestDir: "{userdocs}\BioWare\Mass Effect 2\BIOGame\Config"; Flags: ignoreversion
;Source: "E:\Ñáîðêà\Bulletstorm v.1.0\Files\BioPersistentEntitlementCache.ini"; DestDir: "{userdocs}\BioWare\Mass Effect 2\BIOGame\Config"; Flags: ignoreversion
;Source: "E:\Ñáîðêà\Bulletstorm v.1.0\Files\GamerSettings.ini"; DestDir: "{userdocs}\BioWare\Mass Effect 2\BIOGame\Config"; Flags: ignoreversion
;Source: "E:\Ñáîðêà\Bulletstorm v.1.0\Files\Player1.prf"; DestDir: "{userdocs}\Mass Effect 2\BIOGame\Profile"; Flags: ignoreversion
;Source: "E:\Ñáîðêà\Bulletstorm v.1.0\Files\ScreenShots"; DestDir: "{userdocs}\BioWare\Mass Effect 2\ScreenShots"; Flags: ignoreversion

[Icons]
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\Omega Strike.exe"; WorkingDir: "{app}"; Comment: "Omega Strike"; IconFilename: "{app}\cnruninstall.ico"; Parameters:
Name: "{group}\{#MyAppName}"; Filename: "{app}\Omega Strike.exe"; WorkingDir: "{app}"; IconFilename: "{app}\cnruninstall.ico"; Parameters:
;Name: "{userdesktop}\{#MyAppName} Activation"; Filename: "{app}\stp-mr4.exe"; WorkingDir: "{app}"; Comment: "Çàïóñòèòü àêòèâàöèþ èãðû"; IconFilename: "{app}\MR4.exe"; Parameters:
;Name: "{group}\{#MyAppName} Activation"; Filename: "{app}\stp-mr4.exe"; WorkingDir: "{app}"; IconFilename: "{app}\MR4.exe"; Parameters:
;Name: "{group}\{cm:UninstallProgram}"; Filename: "{uninstallexe}"; IconFilename: {app}\cnruninstall.ico;
Name: "{group}\Äåèíñòàëëèðîâàòü Omega Strike"; Filename: "{uninstallexe}"; IconFilename: {app}\cnruninstall.ico;

[Languages]
;Name: "english"; MessagesFile: "compiler:Languages\english.isl"

[Tasks]
Name: DPO; Description: Äîïîëíèòåëüíîå ïðîãðàìíîå îáåñïå÷åíèå:;
Name: DPO/VC; Description: Óñòàíîâèòü Microsoft Visual C++ 2005 Redist;
Name: DPO/DirectX; Description: Óñòàíîâèòü DirectX;
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked;

[Run]
Filename: {src}\Redist\dxwebsetup.exe; WorkingDir: {src}\Redist\; Flags: waituntilterminated; Check: DirectX and CheckError;
;Filename: {src}\Redist\vc_redist.x86.exe; WorkingDir: {src}\Redist\; Parameters: /Q /norestart; Flags: waituntilterminated; Check: VC and IsWin64 and CheckError;
;Filename: {src}\Redist\vc_redist.x64.exe; WorkingDir: {src}\Redist\; Parameters: /Q /norestart; Flags: waituntilterminated; Check: VC and IsWin64 and CheckError;
;Filename: {src}\Redist\vcredist_x86.exe; WorkingDir: {src}\Redist\; Parameters: /Q /norestart; Flags: waituntilterminated; Check: VC and IsWin64 and CheckError;
;Filename: {src}\Redist\vcredist_x64.exe; WorkingDir: {src}\Redist\; Parameters: /Q /norestart; Flags: waituntilterminated; Check: VC and IsWin64 and CheckError;
;Filename: {src}\Redist\gfwlivesetup.exe; WorkingDir: {src}\Redist\; Parameters: /norestart; Flags: waituntilterminated; Check: VC and CheckError;

[Registry]
Root: HKCU; SubKey: SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers; ValueType: string; ValueName: {app}\Omega Strike.exe; ValueData: RUNASADMIN; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\Valve"; MinVersion: 0.0,5.0; Flags: uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\Valve\Steam"; ValueName: "Language"; ValueType: String; ValueData: "russian"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\Valve\Steam"; ValueName: "SteamExe"; ValueType: String; ValueData: "{pf}\Steam\Steam.exe"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\Valve\Steam"; ValueName: "SteamPath"; ValueType: String; ValueData: "{pf}\Steam"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\Valve\Steam"; ValueName: "SuppressAutoRun"; ValueType: Dword; ValueData: "$0"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\Valve\Steam"; ValueName: "Restart"; ValueType: Dword; ValueData: "$0"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\Valve\Steam"; ValueName: "BigPictureInForeground"; ValueType: Dword; ValueData: "$0"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\Valve\Steam\ActiveProcess"; ValueName: "SteamClientDll"; ValueType: String; ValueData: "{pf}\Steam\steamclient.dll"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\Valve\Steam\ActiveProcess"; ValueName: "SteamClientDll64"; ValueType: String; ValueData: "{pf}\Steam\steamclient64.dll"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\Valve\Steam\ActiveProcess"; ValueName: "Universe"; ValueType: String; ValueData: "Public"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue uninsdeletekeyifempty
;Root: HKCU; Subkey: "Software\Valve\Steam\ActiveProcess"; ValueName: "pid"; ValueType: String; ValueData: "word:00000000"; MinVersion: 0.0,5.0; Flags: uninsdeletevalue uninsdeletekeyifempty

[CustomMessages]
rus.CancelButton=Îòìåíà

[Code]
const
A1='À';
Z1='ß';
A2='à';
Z2='ÿ';
X1='¸';
X2='¨';
TfontColor = $ffffff;

type
  TPBProc = function (h:hWnd;Msg,wParam,lParam:Longint):Longint;
  TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
var
IsCustomFontInstalled: boolean;
FontName: string;
fon: Longint;
bwork, dir, group, work, work1, work2, work3, work4, work5, work6: Longint;
WerInctall1, WerInstall2, DesktopLabel,DesktopLabel1, DesktopLabel2, DPOLabel, DirectXLabel, VCLabel, SelectTasks, MainLabel, ReadyLabel1, ReadyLabel2, ReadyLabel3, WelcomeLabel1, WelcomeLabel2, SelectDirPage1, SelectDirPage2, SelectProgramGroupPage1, SelectProgramGroupPage2, NoIconsLabel: TLabel;
DPOCheck, DesktopCheck, DirectXCheck, VCCheck, NoIconsCheck, CancelBtn, MinBtn, CancelBtn, MusicButton, hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn, hLogoBtn,  hCancelUninstBtn,hMyCancelBtn: HWND;
WFButtonFont: TFont;
NeedSpaceLabel, AfterSpaceLabel,FreeSpaceLabel,DirEditLabel, GroupEditLabel: TLabel;
FreeMB, TotalMB: Cardinal;
SizeStr: AnsiString;
SizeInt, AfterInt, Edit, Space, Ready: Longint;
SymbolNumber: Longint;
  TimerID: LongWord;
  CurrentPicture:integer;
  PicList: TStringlist;
  MyCancelButton: TButton;
  ButtonFont: TFont;
  Font1, Font2: HWND;
 
//****************//Ïîäêëþ÷åíèå ìîäóëåé//*********************//
#include "Modules\botva2.iss"
#include "Modules\progressbar.iss"
#include "Modules\CustomMessages.iss"
#include "Modules\ISDone.iss"
#ifdef Music
#include "Modules\BASS_Module.iss"
#endif
//****************//Ïîäêëþ÷åíèå ìîäóëåé//*********************//

procedure ShowSplashScreen(p1:HWND;p2:string;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';

function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
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 CreateNewFont(Height, Width: Integer; thickness: DWORD; FontName: PChar): HWND; external 'CreateNewFont@files:Tools.dll stdcall';
function AddFontResource(FileName: PAnsiChar): Integer; external 'AddFontResourceA@gdi32.dll stdcall';
function RemoveFontResource(FileName: PAnsiChar): BOOL; external 'RemoveFontResourceA@gdi32.dll stdcall';

function NewFont(Height:Integer;thickness,italic,underline,strikeout:DWORD;name:String):hWnd;external 'NewFont@files:IsMyFont.dll stdcall delayload';
procedure Deinitialize;external 'Deinitialize@files:IsMyFont.dll stdcall delayload';


procedure IsMyFont;
begin
  Font1:=NewFont(20,500,0,0,0,'Corbel');
  Font2:=NewFont(17,500,0,0,0,'Franklin Gothic Medium');
  WizardForm.Font.Handle:=Font1;
  WizardForm.Font.Color:=TfontColor;
end;


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');
  ExtractTemporaryFile('IsMyFont.dll');
  Result:=True;
end;


procedure LogoBtnClick(hBtn:HWND);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://...', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode)
end;


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

procedure LabelOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  ReleaseCapture;
  SendMessage(WizardForm.Handle,$0112,$F012,0)
end;
//************************************************[Íà÷àëî - Çàãðóçêà èçîáðàæåíèé]*************************************************************//
procedure CreateWizardImage;
begin
with WizardForm do begin
  ClientWidth:=ScaleX(667);
ClientHeight:=ScaleY(437);
InnerNotebook.Hide;
OuterNotebook.Hide;
Bevel.Hide;
Center;
end;
fon:=ImgLoad(WizardForm.Handle, ExpandConstant('fon.jpg'), ScaleX(0), ScaleY(0), WizardForm.ClientWidth, WizardForm.ClientHeight,True,True);
work:= ImgLoad(WizardForm.Handle,ExpandConstant('work.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
Edit:=ImgLoad(WizardForm.Handle,ExpandConstant('Edit.png'),ScaleX(133), ScaleY(350),ScaleX(328),ScaleY(24),True,True);

hLogoBtn:=BtnCreate(WizardForm.Handle,8,392,95,37,ExpandConstant('{tmp}\Button2.png'),15,False);
BtnSetEvent(hLogoBtn,BtnClickEventID,WrapBtnCallback(@LogoBtnClick,1));
BtnSetCursor(hLogoBtn,GetSysCursorHandle(32649));

ImgApplyChanges(WizardForm.Handle);
end;
//************************************************[Êîíåö - Çàãðóçêà èçîáðàæåíèé]*************************************************************//

//************************************************ [Íà÷àëî - Òåêñòóðû êíîïîê] ***************************************************//
procedure MinimizeBtnClick(h:HWND);
begin
  GetMinimizeAnimation;
  SetMinimizeAnimation(true);
  SendMessage(WizardForm.Handle,$112,61472,0);
end;

procedure CancelBtnClick(h:HWND);
begin
WizardForm.CancelButton.OnClick(WizardForm.CancelButton);
end;

procedure SetStateNewButtons;
begin
with WizardForm.BackButton do begin
BtnSetVisibility(hBackBtn,Visible);
BtnSetEnabled(hBackBtn,Enabled);
end;
with WizardForm.NextButton do begin
BtnSetVisibility(hNextBtn,Visible);
BtnSetEnabled(hNextBtn,Enabled);
end;
with WizardForm.CancelButton do begin
BtnSetVisibility(hCancelBtn,Visible);
BtnSetEnabled(hCancelBtn,Enabled);
end;
  with MyCancelButton do begin
    BtnSetText(hMyCancelBtn,PAnsiChar(Caption));
    BtnSetVisibility(hMyCancelBtn,Visible);
  end;
BtnSetText(hDirBrowseBtn,PAnsiChar(WizardForm.DirBrowseButton.Caption));
BtnSetText(hGroupBrowseBtn,PAnsiChar(WizardForm.GroupBrowseButton.Caption));
end;


procedure WizardFormBtnClick(hBtn:HWND);
var
  Btn:TButton;
begin
  case hBtn of
    hCancelBtn: Btn:=WizardForm.CancelButton;
    hMyCancelBtn: Btn:=MyCancelButton;
    hNextBtn: Btn:=WizardForm.NextButton;
    hBackBtn: Btn:=WizardForm.BackButton;
    hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
    hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton;
  end;
  Btn.OnClick(Btn);
  SetStateNewButtons;
  BtnRefresh(hBtn);
end;

function NoIcons: Boolean;
begin
Result:= BtnGetEnabled(hGroupBrowseBtn);
end;

function Redist: Boolean;
begin
Result:= BtnGetChecked(DPOCheck);
end;

function DirectX: Boolean;
begin
Result:= BtnGetChecked(DirectXCheck);
end;

function VC: Boolean;
begin
Result:= BtnGetChecked(VCCheck);
end;

procedure NoIconsClick(hBtn:HWND);
var
  Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
BtnSetEnabled(hGroupBrowseBtn, Check);
WizardForm.GroupEdit.Enabled:=Check;
end;

procedure NoIconsLabelClick(Sender:TObject);
begin
  BtnSetChecked(NoIconsCheck, not BtnGetChecked(NoIconsCheck));
  NoIconsClick(NoIconsCheck);
end;

procedure DesktopClick(hBtn:HWND);
begin

end;
procedure DirChange(Sender: TObject);
var
  CurrentDisk: String;
begin
CurrentDisk:=ExtractFileDrive(WizardForm.DirEdit.Text);
  DirEditLabel.Caption:=MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
end;
procedure DesktopLabelClick(Sender:TObject);
begin
  BtnSetChecked(DesktopCheck, not BtnGetChecked(DesktopCheck));
  DesktopClick(DesktopCheck);
end;

procedure DirectXClick(hBtn:HWND);
var
  Check:boolean;
begin
  Check:=BtnGetChecked(hBtn);
  if (BtnGetChecked(VCCheck)=false) and (Check = false) then begin BtnSetChecked(DPOCheck, false); end;
  if (BtnGetChecked(VCCheck)=true) and (Check = true) then begin BtnSetChecked(DPOCheck, true); end;
  if (BtnGetChecked(VCCheck)=true) and (Check = false) then begin BtnSetChecked(DPOCheck, true); end;
  if (BtnGetChecked(VCCheck)=false) and (Check = true) then begin BtnSetChecked(DPOCheck, true); end;
end;

procedure VCClick(hBtn:HWND);
var
  Check:boolean;
begin
  Check:=BtnGetChecked(hBtn);
  if (BtnGetChecked(DirectXCheck)=false) and (Check = false) then begin BtnSetChecked(DPOCheck, false); end;
  if (BtnGetChecked(DirectXCheck)=true) and (Check = true) then begin BtnSetChecked(DPOCheck, true); end;
  if (BtnGetChecked(DirectXCheck)=true) and (Check = false) then begin BtnSetChecked(DPOCheck, true); end;
  if (BtnGetChecked(DirectXCheck)=false) and (Check = true) then begin BtnSetChecked(DPOCheck, true); end;
end;

procedure DPOClick(hBtn:HWND);
var
  Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
if BtnGetChecked(VCCheck) = false and BtnGetChecked(DirectXCheck) = false then BtnSetChecked(DPOCheck, false);
if BtnGetChecked(DPOCheck) then BtnSetChecked(DirectXCheck, True) else BtnSetChecked(DirectXCheck, False);
if BtnGetChecked(DPOCheck) then BtnSetChecked(VCCheck, True) else BtnSetChecked(VCCheck, False);
end;

procedure ButtonsTextures;
begin
WFButtonFont:=TFont.Create;
WFButtonFont.Name:='Georgia';
WFButtonFont.Size:=10;
WFButtonFont.Style:= [fsBold];

with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle,ScaleX(590), ScaleY(355), ScaleX(64), ScaleY(36),ExpandConstant('{tmp}\next.png'),0,False);
BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));

Width:=0;
Height:=0;
end;

with WizardForm.BackButton do begin
hBackBtn:=BtnCreate(WizardForm.Handle,ScaleX(13), ScaleY(355), ScaleX(64), ScaleY(36),ExpandConstant('{tmp}\back.png'),0,False);
BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFontColor(hBackBtn,clblack,clblack,clblack,clblack);
Width:=0;
Height:=0;
end;

with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle,Left+166,Top+116,Width+31,Height+16,ExpandConstant('{tmp}\back.png'),18,False);
BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFontColor(hCancelBtn,clblack,clblack,clblack,clblack);
Width:=0;
Height:=0;
end;

with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle,ScaleX(465), ScaleY(343),ScaleX(79), ScaleY(39),ExpandConstant('{tmp}\browse.png'),0,False);
BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hDirBrowseBtn,{#Color},{#Color},{#Color},{#Color});
Width:=0;
Height:=0;
end;

with WizardForm.GroupBrowseButton do begin
hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,ScaleX(465), ScaleY(343),ScaleX(79), ScaleY(39),ExpandConstant('{tmp}\browse.png'),0,False);
BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hGroupBrowseBtn,{#Color},{#Color},{#Color},{#Color});
Width:=0;
Height:=0;
end;

NoIconsCheck:=BtnCreate(WizardForm.Handle,ScaleX(128),ScaleY(380),ScaleX(25),ScaleY(25), ExpandConstant('CheckBox.png'),8,True);
BtnSetEvent(NoIconsCheck,BtnClickEventID,WrapBtnCallback(@NoIconsClick,1));
BtnSetChecked(NoIconsCheck, true);

DPOCheck:=BtnCreate(WizardForm.Handle, ScaleX(128), ScaleY(350), ScaleX(25), ScaleY(25), ExpandConstant('CheckBox.png'),8, True);
BtnSetChecked(DPOCheck, true);
BtnSetEvent(DPOCheck, BtnClickEventID, WrapBtnCallback(@DPOClick, 1));

DirectXCheck:=BtnCreate(WizardForm.Handle, ScaleX(160), ScaleY(225), ScaleX(20), ScaleY(20), ExpandConstant('CheckBox.png'), 8, True);
BtnSetChecked(DirectXCheck, true);
BtnSetEvent(DirectXCheck,BtnClickEventID,WrapBtnCallback(@DirectXClick,1));

VCCheck:=BtnCreate(WizardForm.Handle, ScaleX(160), ScaleY(245), ScaleX(20), ScaleY(20), ExpandConstant('CheckBox.png'), 8, True);
BtnSetChecked(VCCheck, true);
BtnSetEvent(VCCheck,BtnClickEventID,WrapBtnCallback(@VCClick,1));

DesktopCheck:=BtnCreate(WizardForm.Handle, ScaleX(128), ScaleY(380), ScaleX(25), ScaleY(25), ExpandConstant('CheckBox.png'), 8, True);
BtnSetChecked(DesktopCheck, true);
BtnSetEvent(DesktopCheck,BtnClickEventID,WrapBtnCallback(@DesktopClick,1));

end;
//************************************************ [Êîíåö - Òåêñòóðû êíîïîê] ***************************************************//
//************************************************[Íà÷àëî - Ïðîâåðêà ìåñòà íà äèñêå]*************************************************************//

procedure GroupChange (Sender: TObject);
begin
  GroupEditLabel.Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
  WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
end;

//************************************************[Êîíåö - Ïðîâåðêà ìåñòà íà äèñêå]*************************************************************//
//************************************************[Íà÷àëî - Êîìïîíåíòû ñòðàííèö]*************************************************************//
procedure CreateWizard;
begin
///////////////////////WelcomePage////////////////////////
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
  Left:= ScaleX(160);
  Top:= ScaleY(17);
  Width:= ScaleX(350);
  Height:= ScaleY(65);
  AutoSize:= false;
  Transparent:= true;
  WordWrap:= true;
  Font.Name:='Georgia';
  Font.Size:= 11;
  Font.Color:={#Color};
  Font.Style := [fsBold];
  Alignment := taCenter;
  Parent:= WizardForm;
  Caption:= ExpandConstant('{cm:Welcome1}')
end;

WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
  Left:= ScaleX(110);
  Top:= ScaleY(310);;
  Width:= ScaleX(450);
  Height:= ScaleY(200);
  AutoSize:= false;
  WordWrap:= true;
  Font.Name:= 'Georgia';
  Font.Size:= 11
  Alignment := taCenter;
  Font.Style := [fsBold];
  Transparent:= true;
  Font.Color:={#Color};
  Parent:= WizardForm;
  Caption:= ExpandConstant('{cm:Welcome2}');
end;
///////////////////////SelectDirPage////////////////////////
SelectDirPage1:=TLabel.Create(WizardForm);
with SelectDirPage1 do
begin
  Left:= ScaleX(160);
  Top:= ScaleY(17);
  Width:= ScaleX(350);
  Height:= ScaleY(65);
  AutoSize:= false;
  Transparent:= true;
  WordWrap:= true;
  Font.Name:='Georgia';
  Font.Size:= 11;
  Font.Color:={#Color};
  Font.Style := [fsBold];
  Alignment := taCenter;
  Parent:= WizardForm;
  Caption:= ExpandConstant('{cm:SelectDir1}');
end;

SelectDirPage2:=TLabel.Create(WizardForm);
with SelectDirPage2 do
begin
  Left:= ScaleX(110);
  Top:= ScaleY(310);;
  Width:= ScaleX(450);
  Height:= ScaleY(200);
  AutoSize:= false;
  WordWrap:= true;
  Font.Name:= 'Georgia';
  Font.Size:= 11
  Alignment := taCenter;
  Font.Style := [fsBold];
  Transparent:= true;
  Font.Color:={#Color};
  Parent:= WizardForm;
  Caption:= ExpandConstant('{cm:SelectDir2}');
end;

  DirEditLabel := TLabel.Create(WizardForm);
  with DirEditLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(135), ScaleY(353), ScaleX(446), ScaleY(30));
    WordWrap:= True;
    ShowAccelChar := False;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 10;
    Font.Color:={#Color};
    Font.Style:=[fsBold];
    Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
    Parent := WizardForm;
  end;
///////////////////////SelectProgrammGroupPage////////////////////////
SelectProgramGroupPage1:=TLabel.Create(WizardForm);
with SelectProgramGroupPage1 do
begin
  Left:= ScaleX(160);
  Top:= ScaleY(17);
  Width:= ScaleX(350);
  Height:= ScaleY(65);
  AutoSize:= false;
  Transparent:= true;
  WordWrap:= true;
  Font.Name:='Georgia';
  Font.Size:= 11;
  Font.Color:={#Color};
  Font.Style := [fsBold];
  Alignment := taCenter;
  Parent:= WizardForm;
  Caption:= ExpandConstant('{cm:SelectGroup1}');
end;

NoIconsLabel:=TLabel.Create(WizardForm);
with NoIconsLabel do
begin
  Top:= ScaleY(384);
  Left:= ScaleX(155);
  Width:= ScaleX(300);
  Height:= ScaleY(30);
  AutoSize:= false;
  WordWrap:= true;
  Font.Name:= 'Georgia';
  Font.Size:= 10
  Font.Style := [fsBold];
  Font.Color:={#Color};
  Transparent:= true;
  Parent:= WizardForm;
  OnClick:=@NoIconsLabelClick;
  Caption:= ExpandConstant('{cm:IconsCheck}');
end;
    GroupEditLabel := TLabel.Create(WizardForm);
  with GroupEditLabel do begin
    AutoSize:=False;
    SetBounds(ScaleX(135), ScaleY(353), ScaleX(446), ScaleY(30));
    WordWrap:= True;
    ShowAccelChar := False;
    Transparent:=True;
    Font.Name:= 'Georgia'
    Font.Size:= 10;
    Font.Color:={#Color};
    Font.Style:=[fsBold];
    Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
    Parent := WizardForm;
  end;
// WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text;
WizardForm.DirEdit.OnChange := @DirChange;
WizardForm.GroupEdit.OnChange := @GroupChange;
/////////////////////////////SelectTasksPage/////////////////////////////

DPOLabel:=TLabel.Create(WizardForm);
with DPOLabel do
begin
  Top:= ScaleY(353);
  Left:= ScaleX(155);
  Width:= ScaleX(300);
  Height:= ScaleY(30);
  AutoSize:= false;
  WordWrap:= true;
  Font.Name:= 'Georgia';
  Font.Size:= 10
  Font.Style := [fsBold];
  Font.Color:={#Color};
  Transparent:= true;
  Parent:= WizardForm;
  Caption:= ExpandConstant('{cm:DPO}');
end;

SelectTasks:=TLabel.Create(WizardForm);
with SelectTasks do
begin
  Left:= ScaleX(60);
  Top:= ScaleY(310);;
  Width:= ScaleX(550);
  Height:= ScaleY(200);
  AutoSize:= false;
  WordWrap:= true;
  Font.Name:= 'Georgia';
  Font.Size:= 11
  Alignment := taCenter;
  Font.Style := [fsBold];
  Transparent:= true;
  Font.Color:={#Color};
  Parent:= WizardForm;
  Caption:= ExpandConstant('{cm:SelectTasks}');
end;

DesktopLabel:=TLabel.Create(WizardForm);
with DesktopLabel do
begin
  Top:= ScaleY(383);
  Left:= ScaleX(155);
  Width:= ScaleX(300);
  Height:= ScaleY(30);
  AutoSize:= false;
  WordWrap:= true;
  Font.Name:= 'Georgia';
  Font.Size:= 10
  Font.Style := [fsBold];
  Font.Color:={#Color};
  Transparent:= true;
  Parent:= WizardForm;
  Caption:= ExpandConstant('Ñîçäàòü çíà÷îê íà ðàáî÷åì ñòîëå');
end;

LabelStatus := TLabel.Create(WizardForm);
  with LabelStatus do begin
  Left:= ScaleX(160);
  Top:= ScaleY(17);
  Width:= ScaleX(350);
  Height:= ScaleY(65);
  AutoSize:= false;
  Transparent:= true;
  WordWrap:= true;
  Font.Name:='Georgia';
  Font.Size:= 11;
  Font.Color:={#Color};
  Font.Style := [fsBold];
  Alignment := taCenter;
  Parent:= WizardForm;
  Caption:= 'Ïîæàëóéñòà, ïîäîæäèòå, ïîêà «{#MyAppName}» óñòàíîâèòñÿ íà Âàø êîìïüþòåð.';
  Hide;
  end;

WerInstall2:=TLabel.Create(WizardForm);
with WerInstall2 do
begin
  Left:= ScaleX(160);
  Top:= ScaleY(17);
  Width:= ScaleX(350);
  Height:= ScaleY(65);
  AutoSize:= false;
  Transparent:= true;
  WordWrap:= true;
  Font.Name:='Georgia';
  Font.Size:= 11;
  Font.Color:={#Color};
  Font.Style := [fsBold];
  Alignment := taCenter;
  Parent:= WizardForm;
  Caption:= ExpandConstant('Êàêèå äîïîëíèòåëüíûå çàäà÷è íåîáõîäèìî âûïîëíèòü?');
end;
end;

//************************************************[Êîíåö - Êîìïîíåíòû ñòðàííèö]*************************************************************//
//************************************************[Íà÷àëî ðóññîôîáèÿ]*************************************************************//
function NextButtonClick(CurPageID: Integer): Boolean;
var
i: Longint;
c: Char;
begin
Result := True;
if CurPageID = wpSelectDir then begin
for i:=1 to length(WizardForm.DirEdit.text) do begin
c:=WizardForm.DirEdit.text[i];
if (c>=A1)and(c<=Z1) or (c>=A2)and(c<=Z2) or (c=X1) or (c=X2) then begin
MsgBox( 'Â ïóòè óñòàíîâêè ïðèñóòñòâóþò ðóññêèå áóêâû, ÷òî íåäîïóñòèìî'#13#13'Ïîæàëóéñòà, ïîâòîðèòå ââîä.', mbError, mb_Ok);
Result := False;
break;
exit;
end;
end;
end;
end;
//************************************************[Êîíåö ðóññîôîáèÿ]*************************************************************//

procedure RunSplash();
begin
ExtractTemporaryFile('splash.png');
ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}')+'\splash.png',{#SplS},{#SplR},{#SplE},0,255,False,$FFFFFF,10);
end;

procedure CancelButtonOnClick(Sender: TObject);
begin
  SuspendProc;
  if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
  Exec(ExpandConstant('{sys}\taskkill.exe'), ' /F /IM pZLib.exe', '', SW_HIDE, ewWaitUntilTerminated, i);
  ResumeProc;
end;

procedure InitializeWizard;
begin
RunSplash();
IsMyFont;
CreateWizardImage;
CreateWizard;
ButtonsTextures;
#ifdef Music
begin
  ExtractTemporaryFile('BASS.dll');
  ExtractTemporaryFile('MusicButton.png');
  ExtractTemporaryFile('Music.mp3');
  ExtractTemporaryFile('Button1.png');
  ExtractTemporaryFile('Button2.png');
  BASS_Init(ExpandConstant('{tmp}\Music.mp3')) //Çàïóñêàåì ìóçûêó
  BASS_CreateOnOffButton(ExpandConstant('{tmp}\MusicButton.png'), 645, 50, 20, 20, 4) //Ñîçäàåì êíîïêó âêë/âûêë
end;
#endif
 
  ButtonFont:=TFont.Create;
  ButtonFont.Handle:=Font2;

  MyCancelButton:=TButton.Create(WizardForm);
with MyCancelButton do begin
  Parent:=WizardForm;
  Width:=ScaleX(0);
  Caption:=ExpandConstant('{cm:CancelButton}');
  OnClick:=@CancelButtonOnClick;
end;

with MyCancelButton do begin
  hMyCancelBtn:=BtnCreate(WizardForm.Handle,562,389,100,46,ExpandConstant('{tmp}\Button1.png'),15,False);
  BtnSetEvent(hMyCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
  BtnSetFont(hMyCancelBtn,ButtonFont.Handle);
end;

end;
procedure Hide;
begin
ImgSetVisibility(Edit,False);
ImgSetVisibility(Space,False);
ImgSetVisibility(Ready,False);
WerInstall2.Hide;
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
WizardForm.DirEdit.Hide;
WizardForm.GroupEdit.Hide;
DirEditLabel.Hide;
GroupEditLabel.Hide;
BtnSetVisibility(hMyCancelBtn, false);
MyCancelButton.Hide;
BtnSetVisibility(hDirBrowseBtn, false);
BtnSetVisibility(hGroupBrowseBtn, false);
ImgSetVisibility(dir, false);
ImgSetVisibility(group, false);
SelectDirPage1.Hide;
SelectDirPage2.Hide;
SelectProgramGroupPage1.Hide;
BtnSetVisibility(NoIconsCheck, false);
NoIconsLabel.Hide;
DPOLabel.Hide;
SelectTasks.Hide;
DesktopLabel.Hide;
BtnSetVisibility(DPOCheck, false);
WizardForm.ReadyMemo.Hide;
BtnSetVisibility(DesktopCheck, false);
  BtnSetVisibility(DirectXCheck, false);
BtnSetVisibility(VCCheck, false);
end;

procedure CurPageChanged(CurPageID: Integer);
begin
SetStateNewButtons;
Hide;
case CurPageID of
wpWelcome:
begin
WerInstall2.Hide;
ImgSetVisibility(bwork, false);
WelcomeLabel1.Show;
WelcomeLabel2.Show;
ImgSetVisibility(work,True);
end;
wpSelectDir:
begin
ImgSetVisibility(work1,True)
ImgSetVisibility(bwork, true);
SelectDirPage2.Show;
SelectDirPage1.Show;
ImgSetVisibility(dir, true);
BtnSetVisibility(hDirBrowseBtn, true);
WizardForm.DirEdit.Show;
DirEditLabel.Show;
ImgSetVisibility(Edit,True);
ImgSetVisibility(Space,True);
end;
wpSelectProgramGroup:
begin
ImgSetVisibility(Edit,True);
NoIconsLabel.Show;
BtnSetVisibility(NoIconsCheck, True);
GroupEditLabel.Show;
SelectDirPage2.Show;
SelectProgramGroupPage1.Show;
ImgSetVisibility(group, true);
WizardForm.GroupEdit.Show;
BtnSetVisibility(hGroupBrowseBtn, true);
ImgSetVisibility(work2,True);
end;
wpSelectTasks:
begin
WerInstall2.Show;
BtnSetVisibility(DesktopCheck, true);
if BtnGetChecked(VCCheck)=false then BtnSetChecked(DPOCheck, false);
if BtnGetChecked(VCCheck)=true then BtnSetChecked(DPOCheck, true);
if BtnGetChecked(DirectXCheck)=true then BtnSetChecked(DPOCheck, true);
if BtnGetChecked(DirectXCheck)=false then BtnSetChecked(DPOCheck, false);
SelectTasks.Show;
DesktopLabel.Show;
BtnSetVisibility(DPOCheck, true);
DPOLabel.Show;
ImgSetVisibility(work3,True);
end;
wpInstalling:
begin
LabelStatus.Show;
ImgSetVisibility(work5,True);
  BtnSetVisibility(hCancelBtn, False);
  BtnSetVisibility(hMyCancelBtn, True);
end;
wpFinished:
begin
LabelStatus.Hide;
WerInstall2.Hide;
ImgSetVisibility(bwork, false);
WelcomeLabel1.Caption:=ExpandConstant('{cm:Finished1}');
WelcomeLabel2.Caption:=ExpandConstant('{cm:Finished2}');
WelcomeLabel1.Show;
WelcomeLabel2.Show;
if not ISDoneError then ImgSetVisibility(work6,True);
end;
end;

if (CurPageID = wpFinished) and ISDoneError then
begin
WelcomeLabel1.show
WelcomeLabel2.show
WelcomeLabel1.Caption:=ExpandConstant('Óñòàíîâêà èãðû «{#MyAppName}» íå çàâåðøåíà.');
WelcomeLabel2.Caption:='Âî âðåìÿ óñòàíîâêè ïðîèçîøëà îøèáêà, ïîæàëóéñòà îòêëþ÷èòå ñòîðîííèå ïðîãðàììû è ïîâòîðèòå ïîïûòêó óñòàíîâêè. Íàæìèòå «Çàâåðøèòü», ÷òîáû âûéòè èç ïðîãðàììû óñòàíîâêè.'
end;
WizardForm.ProgressGauge.Hide;
ImgApplyChanges(WizardForm.Handle);
end;

procedure AllCancel;
begin
   SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
   ImgPBDelete(NewPB);
   ImgPBDelete(NewPB2);
   ImgApplyChanges(WizardForm.Handle);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
ISDoneExtract(CurStep);
case CurStep of
ssInstall: begin
ImgApplyChanges(WizardForm.Handle);
PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,CallBackProc(@PBProc,4));
end;
ssPostInstall: AllCancel;
end;
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
   if CurPageID=wpInstalling then begin
   Confirm:=False;
   Cancel:=ExitSetupMsgBox;
   if Cancel then AllCancel;
  end;
end;

procedure DeinitializeSetup;
begin

gdipShutDown;
#ifdef Music
  begin
  BASS_DeInit; //Îñâîáîæäàåì ïðîöåññ
  gdipShutdown
end;
ButtonFont.Free;
#endif
end;
 
Последнее редактирование:

vint56

Ветеран
Проверенный
Danser,
[Icons]
Name: "{userdesktop}\{#GameName}"; Filename: "{app}\nfs.exe"; WorkingDir: {app}; Check: Desctop;

function Desctop: Boolean;
begin
Result:= BtnGetChecked(DesctopCheck);
end;

procedure DesctopClick(hBtn:HWND);
var
Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
end;
 
Последнее редактирование:

Nemko

Дилетант
Модератор
Danser, Result работает в функции, а в данном случае вызывается в процедуре, итог - ошибка. Должно-быть как-то так:
Код:
function Имя_Функции: Boolean;
begin
  Result:=BtnGetChecked(Переменная_кнопки);
end;
 

SBalykov

Старожил
Danser, Result работает в функции, а в данном случае вызывается в процедуре, итог - ошибка. Должно-быть как-то так:
Код:
function Имя_Функции: Boolean;
begin
  Result:=BtnGetChecked(Переменная_кнопки);
end;
или так:
Код:
procedure DesctopClick(hBtn: HWND);
begin
   BtnGetChecked(DesctopCheck);
end;
 
Последнее редактирование:

Danser

Новичок
vint56, всё (вроде?) сделал как сказали, но ничего не вышло.
Код:
[Icons]
Name: "{userdesktop}\Omega Strike"; Filename: "{app}\Omega Strike.exe"; WorkingDir: {app}; Check: Desctop;
Код:
procedure WizardFormBtnClick(hBtn:HWND);
var
  Btn:TButton;
begin
  case hBtn of
    hCancelBtn: Btn:=WizardForm.CancelButton;
    hMyCancelBtn: Btn:=MyCancelButton;
    hNextBtn: Btn:=WizardForm.NextButton;
    hBackBtn: Btn:=WizardForm.BackButton;
    hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
    hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton;
  end;
  Btn.OnClick(Btn);
  SetStateNewButtons;
  BtnRefresh(hBtn);
end;

function Desctop: Boolean;
begin
Result:= BtnGetChecked(DesctopCheck);
end;

function NoIcons: Boolean;
begin
Result:= BtnGetEnabled(hGroupBrowseBtn);
end;

function Redist: Boolean;
begin
Result:= BtnGetChecked(DPOCheck);
end;

function DirectX: Boolean;
begin
Result:= BtnGetChecked(DirectXCheck);
end;

function VC: Boolean;
begin
Result:= BtnGetChecked(VCCheck);
end;

procedure DesctopClick(hBtn: HWND);
begin
   BtnGetChecked(DesctopCheck);
end;

procedure NoIconsClick(hBtn:HWND);
var
  Check:boolean;
begin
Check:=BtnGetChecked(hBtn);
BtnSetEnabled(hGroupBrowseBtn, Check);
WizardForm.GroupEdit.Enabled:=Check;
end;
 

ZVSRus

Участник
Danser
[Setup]
AppName=My Application
AppVersion=1.5
DefaultDirName={pf}\My Application

[Files]
Source: "compiler:Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion

[Icons]
Name: "{commondesktop}\My Application"; Filename: "{app}\MyProg.exe"; MinVersion: 0.0,5.0; Check: DesktopIconCheck;

[_Code]
var
DesktopIcon: TNewCheckBox;

function DesktopIconCheck: Boolean;
begin
Result:= DesktopIcon.Checked;
end;

procedure InitializeWizard();
begin
DesktopIcon := TNewCheckBox.Create(WizardForm);
with DesktopIcon do
begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(0),ScaleY(120),ScaleX(150),ScaleY(17));
Caption := 'Ярлык на Рабочем столе';
Checked := True;
end;
end;
 

Danser

Новичок
Отправил.

UPD: vint56, спасибо за помощь! Работает.)
 
Последнее редактирование:
Сверху