Load external DLL for uninstall process in Inno Setup

I assume you are getting the error, when starting the installer, not the uninstaller. When the installer is starting, the {app} is obviously unknown yet. But as you need the import for the uninstaller only, which knows the {app}, you can add the uninstallonly option: procedure uLoadVCLStyle(VClStyleFile: String); external ‘LoadVCLStyleW@{app}\VclStylesInno.dll stdcall uninstallonly’; Though it does … Read more

Inno Setup Get progress from .NET Framework 4.5 (or higher) installer to update progress bar position

The following shows Pascal Script implementation of the code from How to: Get Progress from the .NET Framework 4.5 Installer [Files] Source: “NDP462-KB3151800-x86-x64-AllOS-ENU.exe”; Flags: dontcopy [Code] // Change to unique names const SectionName=”MyProgSetup”; EventName=”MyProgSetupEvent”; const INFINITE = 65535; WAIT_OBJECT_0 = 0; WAIT_TIMEOUT = $00000102; FILE_MAP_WRITE = $0002; E_PENDING = $8000000A; S_OK = 0; MMIO_V45 = … Read more

Merging event function (InitializeWizard) implementations from different sources

When you are reusing various feature implementations from different sources, those commonly implement the same Inno Setup event functions (like the InitializeWizard). The solution for Inno Setup 6 is very simple, as shown below. In older versions it’s more complicated. See lower. Inno Setup 6 Inno Setup 6 has event attributes features that helps solving … Read more

Run a [Code] or PowerShell script in Inno Setup compiler

You may get better answers, if you explain what you need to run the code for. Anyway… One way is to compile the script on command-line from a batch file: powershell -file precompile.ps1 ISCC.exe setup.iss powershell -file postcompile.ps1 (or you can call ISCC.exe from the PowerShell script itself) Another way to run some script before … 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

Inno Setup – Language selector with VCL Styles

The “Select Setup Language” dialog displays before the InitializeSetup event function is called. So you cannot load the skin for the dialog. As a workaround, you can implement your own “language” dialog, and display that from the InitializeSetup. This way the custom dialog will be skinned. Once a user selects a language, you restart the … Read more

How to manipulate progress bar on Inno Setup Run section?

It would be rather difficult to update the progress bar, while another process is running. I do not see a point of endeavoring it, as you are unlikely able to tell the progress of the sub-installer, so you won’t know what to update the progress bar to. Except for special cases, when the sub-installer provides … Read more

Placing image/control on Inno Setup 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

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

tech