Copy folder, subfolders and files recursively in Inno Setup Code section

To recursively copy a directory programmatically use: procedure DirectoryCopy(SourcePath, DestPath: string); var FindRec: TFindRec; SourceFilePath: string; DestFilePath: string; begin if FindFirst(SourcePath + ‘\*’, FindRec) then begin try repeat if (FindRec.Name <> ‘.’) and (FindRec.Name <> ‘..’) then begin SourceFilePath := SourcePath + ‘\’ + FindRec.Name; DestFilePath := DestPath + ‘\’ + FindRec.Name; if FindRec.Attributes and … Read more

Multiple images display (slideshow) on wpInstalling Page under ProgressGauge bar in Inno Setup

Since the ProgressGauge has no progress change events and there is no way to process setup application messages you will need to use the Windows API timer. This timer needs a callback function which you can’t define in Inno Setup script unfortunately so you will need some external library to do this job for you. … Read more

“Identifier Expected” or “Invalid Prototype” when implementing a scripted constant in Inno Setup

Identifier expected Your code would be correct in a Pascal, but it does not compile in Pascal Script. In Pascal, when you want to assign a return value of a function, you either assign the value to a “variable” with a name of the function or to Result variable. So this is correct: function GetRoot: … Read more

Exit from Inno Setup installation from [Code]

To prevent the installer from running, when prerequisites test fails, just return False from the InitializeSetup. This will exit the installer even before the wizard shows. function InitializeSetup(): Boolean; begin Result := True; if not PrerequisitesTest then begin SuppressibleMsgBox(‘Prerequisites test failed’, mbError, MB_OK, IDOK); Result := False; end; end; If you need to test prerequisites … Read more

Inno Setup Placing image/control on custom page

That’s what TWizardPage.Surface of type TNewNotebookPage is for. with BtnImage do begin Parent := CustomPage.Surface; { … } end; Related questions: TInputDirWizardPage with Radio Buttons (Similar question about radio buttons with more code) Add additional controls to standard Inno Setup pages? Also, never use absolute coordinates and sizes. Your layout will break, when the wizard … Read more