Inno Download Plugin 1.5.1

Inno Download Plugin 1.5.1 released. Changes in this version:

  • Fix: GDI leak (issue 7)
  • Fix: FTP download of files with # character in file name
  • Fix: Downloading files from mirror
  • Bulgarian, Czech, Slovak, Hungarian, and Spanish translations, French translation completed

Download:

 

Inno Download Plugin 1.5.0

Inno Download Plugin 1.5.0 released.

New idpAddFtpDir function allows to download whole FTP directories, including subfolders.

procedure idpAddFtpDir(url, mask, destdir: String; recursive: Boolean);
procedure idpAddFtpDirComp(url, mask, destdir: String; recursive: Boolean; components: String);

Parameters:

  • url – Directory URL
  • mask – File mask wildcards or empty string to select all files
  • destdir – Destignation directory on the local disk
  • recursive – If true, recursively add all subdirectories
  • components – A space separated list of component names, telling IDP to which components the directory belongs. A ftp directory without a components parameter is always downloaded.

Example:

//Add all files in URL, including subdirectories
idpAddFtpDir('ftp://ftpserver.com/pub/myfiles', '', ExpandConstant('{tmp}'), true);

//Add only *.dll files; do not look in subdirectories
idpAddFtpDir('ftp://ftpserver.com/pub/myfiles', '*.dll', ExpandConstant('{tmp}'), false);

Downloadidpsetup-1.5.0.exe

Inno Setup: Embedding web browser in custom wizard page

Simplest way to show web page in Inno Setup custom wizard page is to use ATL Control Hosting API, which allows inserting ActiveX controls (such as IE web browser)  to any window. We need to:

  1. Call AtlAxWinInit()
  2. Call CreateWindowEx with AtlAxWin as class name parameter and ProgID/CLSID/URL as window text parameter.
[Code]
const WS_CHILD   = $40000000;
      WS_VISIBLE = $10000000;

function AtlAxWinInit(): Boolean; 
external 'AtlAxWinInit@Atl.dll cdecl';

function CreateWindowEx(dwExStyle: Dword; lpClassName, lpWindowName: String; 
                        dwStyle: Dword; x, y, nWidth, nHeight: Integer;
                        hWndParent, hMenu, hInstance: HWND; lpParam: Dword): Integer; 
#ifdef UNICODE
external 'CreateWindowExW@user32.dll stdcall';
#else
external 'CreateWindowExA@user32.dll stdcall';
#endif
                        
function DestroyWindow(wnd: HWND): Integer;
external 'DestroyWindow@user32.dll stdcall';

var Browser: HWND;

function CreateCustomForm(PreviousPageId: Integer): Integer;
var Page: TWizardPage;
begin
    Page := CreateCustomPage(PreviousPageId, 'Web Page', 'Wizard page with embedded browser'); 
    AtlAxWinInit();
    Browser := CreateWindowEx(0, 'AtlAxWin', 'http://www.google.com/',
                              WS_CHILD or WS_VISIBLE, 
                              ScaleX(0), ScaleY(0), ScaleX(410), ScaleY(230), 
                              Page.Surface.Handle, 0, 0, 0);
    Result := Page.ID;
end;

procedure InitializeWizard();
begin
    CreateCustomForm(wpWelcome);
end;

procedure DeinitializeSetup();
begin
    DestroyWindow(Browser);
end;