Вы должны использовать WinAPI, в частности LoadImage
функция и WM_SETICON
сообщение :
[Files]
Source: "custom.ico"; Flags: dontcopy
[Code]
const
IMAGE_ICON = 1;
LR_LOADFROMFILE = $10;
WM_SETICON = $80;
ICON_SMALL = 0;
function LoadImage(
hInst: Integer; ImageName: string; ImageType: UINT; X, Y: Integer;
Flags: UINT): THandle; external 'LoadImageW@User32.dll stdcall';
procedure CustomFormShow(Sender: TObject);
var
Icon: THandle;
begin
ExtractTemporaryFile('custom.ico');
Icon := LoadImage(
0, ExpandConstant('{tmp}\custom.ico'), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
SendMessage(TForm(Sender).Handle, WM_SETICON, ICON_SMALL, Icon);
end;
var
CustomWindowForm: TForm;
{ Create and show the custom window }
procedure ShowCustomWindow();
begin
CustomWindowForm := TForm.Create(WizardForm);
with CustomWindowForm do
begin
{ your code }
OnShow := @CustomFormShow;
Show;
end;
end;
(Код для версии Inno Setup для Unicode - единственная версия от Inno Setup 6)