1
votes

I have a Inno Setup script that simply installs files into user's local program files dir: C:\Users{account}\AppData\Local\Programs\MyAppName.

It shouldn't trigger elevation when I run the installer exe but it does.

[Setup]
AppName=MyAppManager
AppVerName=MyAppManager
AppCopyright=Copyright (C) 2018 Frank Rizzo
AppPublisher=Frank Rizzo
DefaultDirName={userpf}\MyAppManager
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyPage=yes
;UninstallDisplayIcon={app}\MyAppManager.exe
OutputBaseFilename=MyAppManagerSetup
AppID=MyAppManager.1
VersionInfoVersion=0.4

[Files]
Source: "..\bin\debug\MyAppManager.exe"; DestDir: "{app}"
Source: "CleanFiles\MyAppManager.exe.config"; DestDir: "{app}"
Source: "..\bin\debug\ScintillaNET.dll"; DestDir: "{app}"
Source: "..\bin\debug\Elasticsearch.Net.dll"; DestDir: "{app}"
Source: "..\bin\debug\Nest.dll"; DestDir: "{app}"

What do I need to do to avoid the elevation?

1
Start by removing the words setup or install from your installer's name. Windows will automatically force elevation if it thinks the program is an installer, and it keys on those names specifically. Technically any app that installs anything should require elevation, and you're violating Windows guidelines by attempting to do so without elevation. You'll also run into issues with most AV software and corporate group policy settings.Ken White

1 Answers

1
votes

By default, Inno Setup-based installers do not include information about privileges they require. That makes Windows do its autodetection. For example, if the .exe name includes keywords like Setup, it makes Windows ask for elevation. Though even removing those keywords may not help, as the installer can still trigger other rules.

To override the autodetection, use PrivilegesRequired directive. In particular, set it to lowest.

[Setup]
PrivilegesRequired=lowest

For a problem with Windows 10 requiring Administrator privilegs for uninstall, see:
Workaround for 'Apps & features' in Windows 10 starting a single-user uninstaller elevated