How to automatically uninstall previous installed version in Inno Setup?

I have used the following. I’m not sure it’s the simplest way to do it but it works. This uses {#emit SetupSetting(“AppId”)} which relies on the Inno Setup Preprocessor. If you don’t use that, cut-and-paste your App ID in directly. [Code] ///////////////////////////////////////////////////////////////////// function GetUninstallString(): String; var sUnInstPath: String; sUnInstallString: String; begin sUnInstPath := ExpandConstant(‘Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting(“AppId”)}_is1’); … Read more

Is it feasible/sensible to wrap an Inno Setup installer inside an MSI for easier distribution via AD?

No, there’s no way to do that while still keeping the functionality your customers are ‘implicitly’ asking for. The only ‘wrapping’ in MSI you can do is to extract it on installation and start your InnoSetup installer from the temporary location where you extracted to. MSI is a fundamentally different way of working: InnoSetup (& … Read more

Make Inno Setup installer request privileges elevation only when needed

Inno Setup 6 has a built-in support for non-administrative install mode. Basically, you can simply set PrivilegesRequiredOverridesAllowed: [Setup] PrivilegesRequiredOverridesAllowed=dialog Additionally, you will likely want to use the auto* variants of the constants. Notably the {autopf} for the DefaultDirName. [Setup] DefaultDirName={autopf}\My Program The following is my (now obsolete) solution for Inno Setup 5, based on @TLama’s … Read more

How to create a desktop icon with Inno Setup

In [Files] section, you install your giotto.ico to the application folder (you may want to install the icon only when the desktopicon task is selected). In [Icons] section, you create the desktop icon using the installed giotto.ico (when the desktopicon task is selected). #define SourcePath “C:\Users\PycharmProjects\GIOTTOconverter\dist” #define MyAppName “GIOTTO” #define MyAppExeName “GIOTTO.exe” #define MyAppIcoName “giotto.ico” … Read more

Is it possible to accept custom command line parameters with Inno Setup

With InnoSetup 5.5.5 (and perhaps other versions), just pass whatever you want as a parameter, prefixed by a / c:\> myAppInstaller.exe /foo=wiggle and in your myApp.iss: [Setup] AppName = {param:foo|waggle} The |waggle provides a default value if no parameter matches. Inno setup is not case sensitive. This is a particularly nice way to handle command … Read more

Inno Setup: Install other installer and run it before continuing my install

Better for the way you go might be the AfterInstall parameter. The following script will execute the RunOtherInstaller function right after the OtherInstaller.exe file entry is processed. There it tries to execute the just installed OtherInstaller.exe file and if that fails, it reports an error message to the user. Please note that you cannot interrupt … Read more

How to get an output of an Exec’ed program in Inno Setup?

Yes, use redirection of the standard output to a file: [Code] function NextButtonClick(CurPage: Integer): Boolean; var TmpFileName, ExecStdout: string; ResultCode: integer; begin if CurPage = wpWelcome then begin TmpFileName := ExpandConstant(‘{tmp}’) + ‘\ipconfig_results.txt’; Exec(‘cmd.exe’, ‘/C ipconfig /ALL > “‘ + TmpFileName + ‘”‘, ”, SW_HIDE, ewWaitUntilTerminated, ResultCode); if LoadStringFromFile(TmpFileName, ExecStdout) then begin MsgBox(ExecStdout, mbInformation, MB_OK); … Read more