For my link archive: [WaybackSave/Archive] Ioan Popovici @ MEM.Zone on X: “The Inno setup uninstall switches are the funniest thing ever. SILENT, /VERYSILENT I knew about this but didn’t think that the silent uninstall registry keys would be just SILENT. I’ve fixed that in the bulk uninstall tool but man microsoft should have forced”
Archive for the ‘Installer-Development’ Category
Ioan Popovici @ MEM.Zone on X: “The Inno setup uninstall switches are the funniest thing ever. SILENT, /VERYSILENT I knew about this but didn’t think that the silent uninstall registry keys would be just SILENT. I’ve fixed that in the bulk uninstall tool but man microsoft should have forced”
Posted by jpluimers on 2025/08/21
Posted in Development, Inno Setup ISS, InnoSetup, Installer-Development, Power User, Software Development, Windows, Windows Development | Leave a Comment »
Chocolatey, MSI installers and “… was not successful. Exit code was ‘3010’. See log for possible error messages.”
Posted by jpluimers on 2021/05/27
For some Chocolatey installations, I got an error message like this one:
"ERROR: Running ["C:\Users\Developer\AppData\Local\Temp\chocolatey\vmware-tools\10.3.10.12406962\VMware-tools-10.3.10-12406962-x86_64.exe" /S /v /qn REBOOT=R ] was not successful. Exit code was '3010'. See log for possible error messages."
I wish that a Chocolatey install could indicate it is msi based, and Chocolatey would convert this to a soft reboot message, as [WayBack] MsiExec.exe and InstMsi.exe Error Messages – Windows applications | Microsoft Docs indicates it means ERROR_SUCCESS_REBOOT_REQUIRED:
Posted in Chocolatey, Development, InnoSetup, Installer-Development, Power User, Software Development, Windows, Windows Development | Leave a Comment »
Main Innosetup site down; downloads are now at GitHub thanks to Martijn Laan
Posted by jpluimers on 2018/06/22
Earlier this week, I wanted to install the most recent version of InnoSetup, but found out the main site at jrsoftware.org is down.
The new versions released earlier this month were on my list of things to try:
- [WayBack] Software-update: Inno Setup 5.6.1 – Computer – Downloads – Tweakers
- [WayBack] Software-update: Inno Setup 5.6.0 – Computer – Downloads – Tweakers
There WayBack archive editions of most directories but all of them are too old to hold the 5.6.0 or 5.6.1 versions (some do not even have the 5.5.9 version either).
In the mean time, Martijn Laan has provided the most recent binaries on GitHub:
- [WayBack] Inno Setup is a free installer for Windows programs. First introduced in 1997, Inno Setup today rivals and even surpasses many commercial installers in feature set and stability.
- [WayBack] GitHub – jrsoftware/ispack: The Inno Setup QuickStart Pack includes Inno Setup itself, an option to install the unofficial Inno Script Studio script editor and an option to download and install official encryption support.
Parallel to that, I have archived or found back the most recent versions of these pages and downloads:
- WayBack: jrsoftware.org // Jordan Russell’s Software
- WayBack: Inno Setup Downloads
- WayBack: innosetup-5.6.1-unicode.exe
- WayBack: innosetup-5.6.1.exe
- WayBack: innosetup-qsp-5.6.1-unicode.exe
- WayBack: innosetup-qsp-5.6.1.exe
- WayBack: innosetup-5.6.0-unicode.exe
- WayBack: innosetup-5.6.0.exe
- WayBack: innosetup-qsp-5.6.0-unicode.exe
- WayBack: innosetup-qsp-5.6.0.exe
- WayBack: innosetup-5.5.9-unicode.exe
- WayBack: innosetup-5.5.9.exe
- WayBack: innosetup-qsp-5.5.9-unicode.exe
- WayBack: innosetup-qsp-5.5.9.exe
- WayBack: ISCrypt.dll
- WayBack: ISCrypt.zip
—jeroen
Posted in Development, Inno Setup ISS, Installer-Development, Software Development | Leave a Comment »
InnoSetup where the *AppData constants point to
Posted by jpluimers on 2017/11/08
The paths are on a standard Windows 7 x64 machine installed on the C: drive. More recent versions of Windows should use the same place.
I’ve not been able to verify this in a domain situation with roaming profiles and redirected folder paths. If anyone has info on that, please let me know.
Anyway, I’ve made some the constants into a table:
| Inno Setup constant [WayBack] |
Windows 7 directory | KNOWNFOLDERID [Archive.is] |
CSIDL (<= Vista) [WayBack] ([WayBack]) |
Environment variable [WayBack] |
System.Environment.SpecialFolder [WayBack] |
|---|---|---|---|---|---|
| commonappdata | C:\ProgramData | FOLDERID_ProgramData | CSIDL_COMMON_APPDATA | ALLUSERSPROFILE | System.Environment.SpecialFolder.CommonApplicationData |
| localappdata | C:\Users\<UserName>\AppData\Local | FOLDERID_LocalAppData | CSIDL_LOCAL_APPDATA | LOCALAPPDATA | System.Environment.SpecialFolder.LocalApplicationData |
| userappdata | C:\Users\<UserName>\AppData\Roaming | FOLDERID_RoamingAppData | CSIDL_APPDATA | APPDATA | System.Environment.SpecialFolder.ApplicationData |
One day I might find time to make this table more complete.
Until then, the code is somewhere around theses pieces of code:
Posted in Development, Inno Setup ISS, Installer-Development, Software Development | Leave a Comment »
Some Inno Setup notes
Posted by jpluimers on 2017/08/30
While updating at a client site a hugely out of date Inno Setup directory tree and instructions combo (docs mentioning isetup-2.0.19.exe, isxsetup2.exe, istool-3.0.0.exe but using ispack-5.3.10.exe) I made a few notes:
isxsetup2.exe(part of “oldfiles”) is not needed (by long!) any more as they have been integrated into Inno Setup 4.- SourceDir and OuputDir under the [Setup] section can themselves – like regular source references – be relative paths (see for instance GameDev.net – The install script)
- If
OutputDiris relative, then it is relative toSourceDir - Need to research why it expects Setup.exe to be present under
OutputDir - Windows seems to create Thumbs.db virtually everywhere; Inno Setup includes them when they are not having the hidden attribute (similar things can hold for desktop.ini and .DS_Store files)
- You can exclude these on a per
Source:entry in the[Files]section like using anExcludeparameter like this:
Source: Manuals\files\*.*; Excludes: "Thumbs.db"; DestDir: {app}\manuals\files - Some more links on this topic (major tip: ensure the various
Source:entries do *not* overlap!):
- You can exclude these on a per
- I’ve opted to set compression settings in the
[Setup]section to- use
lzma2/ultra64without specifying dictionary size (to it’s 64 megabyte) which takes a lot of memory during compression (about 700 megabytes) but greatly reduces Setup.exe size. - do not use
SolidCompressionas every installation uses only a subset of the files
- use
Source files I need to figure out if the are needed, where they originally come from and which actual version should be used:
- System\msvcrt.dll
- System\borlndmm.dll
- System\gds32.dll
- (try to make your software use fbclient.dll;
if that is impossible, copyfbclient.dlltogds32.dllor better read section3/ Supporting legacy applications and driversinFireBird\doc\README.Win32LibraryInstallation.txtabout usinginstclient.exef to make a proper conversion offbclient.dllintogds32.dll)
- (try to make your software use fbclient.dll;
The vcredist_x86_2010.exe was actually the Visual C++ 2010 SP1 one with version 10.0.40219.1, not the RTM one with version 10.0.30319.1.
- Download Microsoft Visual C++ 2010 Redistributable Package (x86) from Official Microsoft Download Center
- Download Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package MFC Security Update from Official Microsoft Download Center
I need to figure out this error message that occurs every now and then:
--------------------------- Error --------------------------- ShellExecuteEx failed; code 1460. This operation returned because the timeout period expired. --------------------------- OK ---------------------------
I need to catch up on many things having to do with the [Code] section:
- Mirality Systems: Inno Setup Tips & Tricks which has a very good introduction to the underlying Pascal Script (by RemObjects) language.
- Inno Setup Help – Pascal Scripting: Support Functions Reference – functions you can call from your scripts.
- Inno Setup Help – Pascal Scripting: Setup event functions as lots of functions you can define that are being called by the Inno Setup engine.
- Inno Setup Help – Pascal Scripting: Scripted Constants like
{code:myStringFunction}that refer to a string function namedmyStringFunction. - Inno Setup Help – Constants constants like
{pf}for theProgram Filesdirectory which you can use everywhere. - Inno Setup Preprocessor Help – Directives on
#define value,using{#value}and other kinds of directives like#emit. - Inno Setup Preprocessor Help – Functions on all sorts of functions you can use within the pre-procesor
It pays off to split your [Code] section in at least three parts:
- A part having the
Setup event functions - A part having the
Pascal Scripting: Scripted Constantsfunctions - A part having your own utility functions
There is no {code:...} way of getting the value of OutputBaseFileName, but you can use
ExpandConstantfollowed byChangeFileExtto change the extension of the resulting EXE filename into INI which usually is good enough.- The preprocessor to pass in a value to both the
OutputBaseFileNameand your code.
Not all places can use {code:...} expansion, so you might want to use the preprocessor ispp (which stands for Inno Setup Preprocessor).
It was a bit hard to find if/when ispp was available as that has changed over the years as it used to be a separate product. From some Inno Setup 4.x or 5.x version up, it is available in the core product, possibly enabled by default (reading Inno Setup Help – Script Format Overview I’m still not sure) but to make sure it is enabled, just add this line at the start of your script files:
#preproc ispp
With the pre-processor, you can do things ike this.
Without the pre-processor, this will fail in the [Files] section with an error containig “unknown filename prefix”:
Source: Service\{code:GetServiceExe}; DestDir: {app}; ... BeforeInstall: DoBeforeInstallForService({code:GetServiceName})
With the pre-processor, you can replace it with this:
#preproc ispp
#define cServiceExe = "SomeWeirdExeName.exe"
#define cServiceName = "SomeWeirdServiceName"
...
Source: Service\{#cGetServiceExe}; DestDir: {app}; ... BeforeInstall: DoBeforeInstallForService('{#cServiceName}')
If you forget the single quotes around {#cServiceName} then you get this very weird error for which Googling “Can only call function” “ExpandConstant” “within parameter lists.” will return no satisfactory results:
[Window Title] Error [Main Instruction] Compiler Error [Content] Line 91: Directive or parameter "BeforeInstall" expression error: Can only call function "ExpandConstant" within parameter lists. [OK]
Of course the pre-processor syntax is different from the Pascal Script syntax, so this won’t work:
#define cVersion="1.2.3.4"
#define cOutputDir="..\Output-{#cVersion}"
It needs to be this (via Inno Setup – #define directive – how to use previously defined variable? – Stack Overflow):
#define cOutputDir="..\Output-"+cVersion
Importing Windows functions from DLLs
Now that there is both an Ansi and Unicode version of Inno Setup, lots of scripts you find on the interwebz need modification: they import ANSI versions from various DLLs but now need to check the Inno Setup Pre-Processor pre-defined variable UNICODE.
Those predefined variables are listed here: Inno Setup Preprocessor: Predefined Variables
You use it like in the CodeDll.iss example:
//importing a Windows API function, automatically choosing ANSI or Unicode (requires ISPP)
function MessageBox(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal): Integer;
#ifdef UNICODE
external 'MessageBoxW@user32.dll stdcall';
#else
external 'MessageBoxA@user32.dll stdcall';
#endif
I learned this the hard way inheriting a bunch of code that would install services and failing on one service manager call with a GetLastError code ERROR_INVALID_NAME a.k.a. 123 (0x7B). I found it was the first OpenSCManager API call but since the code did not have any error handling at all tracking that down took quite some effort that failed. It would not with the documented ERROR_ACCESS_DENIED a.k.a. 5 (0x5) and ERROR_DATABASE_DOES_NOT_EXIST a.k.a. 1065 (0x429) codes.
Of course OpenSCManager ServicesActive 0x0000007B nor OpenSCManager Error 123 didn’t return meaningful pages.
There were some mentions of invalid registry keys but those didn’t make sense to me at that time. Only after fiddling a lot I found the ROpenSCManagerW that mentioned Unicode, the ERROR_INVALID_NAME and ERROR_SHUTDOWN_IN_PROGRESS a.k.a. 1115 (0x45B). Apparently the lpDatabaseName parameter wasn’t interpreted correctly. Thad made sense as passing the 'ServicesActive' as Unicode string where the the import uses Ansi will see the string as an alternating series of ANSI character bytes and null bytes and stop after the first S.
The fix was easy: apply the above #ifdef UNICODE logic and import the function either using W@ or A@ depending on the mode.
Later I found out the code was borrowed without attribution nor mentioning the ANSI limitation from installation – upgrading windows service using inno setup – Stack Overflow. This all the more illustrates that when you borrow code from the internet you should attribute it and ensure the limitations are mentioned near your code.
Logging
Logging involves a few things:
- Call the
Logmethod: Inno Setup Help – Pascal Scripting: Log - Enable logging using either
- The
SetupLoggingentry in the[Setup]section: Inno Setup Help – [Setup]: SetupLogging - The
/LOGparameter on the setup command-line: Inno Setup Help – Setup Command Line Parameters
- The
- Inspect the log file in your
%TEMP%directory (files are named likeSetup Log 2016-07-12 #001.log) - Note that I wish there was a
Logfunction with parameters similar toFormat, but since the underlying Pascal Script language does not allow overloads, I tried to introduce aLogFormatfunction instead but found out that Pascal Script doesn’t likearray of constparameters (the code below fails with anidentifier expectederror on theconstkeyword) for which I asked if I can report a bug:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function LogFormat(const AFormat: string; const AArgs: array of const): string; | |
| begin | |
| Log(Format(AFormat, AArgs)); | |
| end; |
There is an undocumented UsingWinNT function originating from the non-NT era that is sometimes used for detecting Windows versions (2K, XP, Vista, 7, 8, 8.1, 10, etc) and for fiddling with Windows Services with or without using the ServicesActive database name.
Luckily these functions exist:
Formatto format strings with a mask just like in DelphiDLLGetLastErrorwrapper around the WindowsGetLastErrorfunctionMsgBoxso you don’t need to import aMessageBoxfunction yourself and you can decipher the Windows System error codes.Abortto silently exit from fatal errors.
Exiting and rolling prematurely
There are various ways the interwebz suggest you to exit an Inno Setup script prematurely, but most of them do not do a proper rollback/cleanup of the install.
These are bad (don’t cleanup/rollback):
- Don’t use ExitProcess as it fails to rollback and leaves temporary files around
- Don’t post a WM_CLOSE message to the WizardForm as it basically is calling WizardForm.Close or pressing the Close button on the form anyway
Note Abort only works in these events (thanks Iepe):
InitializeSetup
InitializeWizard
CurStepChanged(ssInstall)
InitializeUninstall
CurUninstallStepChanged(usAppMutexCheck)
CurUninstallStepChanged(usUninstall)
Mahris has answered a nice workaround in installer – Inno Setup: How to Abort/Terminate Setup During Install? – Stack Overflow:
[Files]
Source: "MYPROG.EXE"; DestDir: "{app}"; AfterInstall: MyAfterInstall
[Code]
var CancelWithoutPrompt: boolean;
function InitializeSetup(): Boolean;
begin
CancelWithoutPrompt := false;
result := true;
end;
procedure MyAfterInstall();
begin
(Do something)
if BadResult then begin
MsgBox('Should cancel because...',mbError,MB_OK)
CancelWithoutPrompt := true;
WizardForm.Close;
end;
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
if CurPageID=wpInstalling then
Confirm := not CancelWithoutPrompt;
end;
x64 versus x86
Since Inno Setup supports both Win32 and Win64, you can use it to install the right flavour of dependencies, for instance installer – Install correct version of Firebird (32bit or 64bit) with Inno Setup – Stack Overflow
–jeroen
Posted in Development, Encoding, Inno Setup ISS, Installer-Development, Software Development, Unicode | Leave a Comment »
Can some recommend a good tool to build MSI package? I use Inno Setup…
Posted by jpluimers on 2016/11/30
For my G+ Link archive:
Can some recommend a good tool to build MSI package?I use Inno Setup but only to build EXE file.Thanks, – Chris Z. – Google+
Source: Can some recommend a good tool to build MSI package? I use Inno Setup but only…
Related:
Posted in Delphi, Development, Installer-Development, Software Development | Leave a Comment »
Inno Setup: Program Folder not showing up In Start > All Programs. I’ve been…
Posted by jpluimers on 2015/11/15
taskkill /f /im explorer.exe
del %LOCALAPPDATA%\IconCache.db /a
start explorer
Source: Inno Setup: Program Folder not showing up In Start > All Programs. I’ve been… (A Google+ post not archived in the WayBack machine)
It will kill explorer.exe, delete the IconCache.db, then starts explorer which will rebuild IconCache.db.
–jeroen
Posted in Development, InnoSetup, Installer-Development, Power User, Software Development, Windows, Windows 10, Windows 11, Windows 7, Windows 8, Windows 8.1 | Leave a Comment »
Windows security updates breaking old software: to upgrade or not (that is not really a question).
Posted by jpluimers on 2015/08/03
Windows Security updates sometimes break old software.
In this case it was an older InstallShield version (not even sure it was 2012), breaking with this message when security updates like KB2949927, KB3004394 or KB3033929 are installed:
ISDEV : error -6003: An error occurred streaming ‘<path>\DiskImages\DISK1\<filename>.isc’ into setup.exe.
An earlier security update KB2962872 even crashed InstallShield 2012 and 2013 during startup.
It raises the issue if security updates are more important than upgrading your tool-chain. For less flexible organisations (not limited to large ones; small ones can be just as inflexible for instance when an upgrade also requires time or skills to be acquired) this can impose a serious problem.
Where Windows XP let you choose which updates to install and when, Windows 7 and 8 became more mandatory (installing security updates automatically even rebooting). Rumour was that Window 10 does not even let you uninstall security updates any more, but that has feature has been removed.
–jeroen
via:
- InstallSite Blog – Windows Update breaks InstallShield command line build.
- Error -6003: An error occurred when streaming… when signing the MSI file – Page 3.
- Black Tuesday patch KB 2962872 crashes InstallShield, causes slowdowns | InfoWorld.
- Windows 7 users report issues installing Microsoft update · SC Magazine US · Disqus.
- Microsoft Backtracks On Windows 10 Forced Updates – Forbes.
- Windows 10 for Enterprise: More secure and up to date | Windows For Your Business.
Posted in Development, Install Shield, Installer-Development, Software Development | 4 Comments »





