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 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

Inno-setup 32bit and 64bit in one

It is possible. Take a look at the 64BitTwoArch.iss sample (especially the Is64BitInstallMode boolean): ; — 64BitTwoArch.iss — ; Demonstrates how to install a program built for two different ; architectures (x86 and x64) using a single installer. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES! [Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}\My Program … Read more