Install file from Internet in Inno Setup

Inno Setup 6.1 and newer has a built-in support for downloads. No 3rd party solution are needed anymore. Check the Examples\CodeDownloadFiles.iss in Inno Setup installation folder. The important parts of the example are: [Files] ; These files will be downloaded Source: “{tmp}\innosetup-latest.exe”; DestDir: “{app}”; Flags: external Source: “{tmp}\ISCrypt.dll”; DestDir: “{app}”; Flags: external [Code] var DownloadPage: … Read more

Custom Inno Setup Uninstall page (not MsgBox)

You can modify the uninstall form to behave like the install form (with pages and the Next/Back buttons). In the InitializeUninstallProgressForm: Create the new pages and insert them to the UninstallProgressForm.InnerNotebook (or the .OuterNotebook). Implement the “Next” and the “Back” buttons. You can also make the “Cancel” button working. Run modal loop of the form … 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

How to show percent done, elapsed time and estimated time progress?

It was not that easy to implement this feature before the CurInstallProgressChanged event method was introduced in Inno Setup 5.5.4. But now, having this event available, you can write a script like this: Special thanks to user1662035 for the proposed idea for the fix of hiding labels at rollback process. [Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}\My … Read more

How to detect old installation and offer removal? [duplicate]

You could use Craig McQueen’s solution originally posted here: InnoSetup: How to automatically uninstall previous installed version? function GetUninstallString: string; var sUnInstPath: string; sUnInstallString: String; begin Result := ”; sUnInstPath := ExpandConstant(‘Software\Microsoft\Windows\CurrentVersion\Uninstall\{{A227028A-40D7-4695-8BA9-41DF6A3895C7}_is1’); { Your App GUID/ID } sUnInstallString := ”; if not RegQueryStringValue(HKLM, sUnInstPath, ‘UninstallString’, sUnInstallString) then RegQueryStringValue(HKCU, sUnInstPath, ‘UninstallString’, sUnInstallString); Result := sUnInstallString; end; … Read more

Is there a way to read the system’s information in Inno Setup

There are many different ways to retrieve all these information. But one universal way to retrieve all of them is a WMI query. WMI classes that will interest you are: Win32_ComputerSystem Win32_OperatingSystem Win32_Processor Win32_NetworkAdapterConfiguration function WbemQuery(WbemServices: Variant; Query: string): Variant; var WbemObjectSet: Variant; begin Result := Null; WbemObjectSet := WbemServices.ExecQuery(Query); if not VarIsNull(WbemObjectSet) and (WbemObjectSet.Count … Read more

Custom Uninstall page (not MsgBox)

You can modify the uninstall form to behave like the install form (with pages and the Next/Back buttons). In the InitializeUninstallProgressForm: Create the new pages and insert them to the UninstallProgressForm.InnerNotebook (or the .OuterNotebook). Implement the “Next” and the “Back” buttons. You can also make the “Cancel” button working. Run modal loop of the form … Read more

Inno Setup generated installer does not show “Select Destination Location” page on some systems

Quoting revision history for Inno Setup 5.5.7: As recommended by Microsoft’s desktop applications guideline, DisableWelcomePage now defaults to yes. Additionally DisableDirPage and DisableProgramGroupPage now default to auto. The defaults in all previous versions were no. Conclusion: The Welcome page is not shown anymore by default. To enable it, set the DisableWelcomePage: DisableWelcomePage=no I do not … Read more