I am digitally signing my setup packages created with Inno Setup. When the user launches the uninstaller, the following UAC prompt appears in the very beginning:
I could replace the text in the red box for the setup package with the AppName
directive, but I couldn't do this for the uninstaller.
How to replace that default "Setup/Uninstall" string with a custom string in uninstaller?
When you set AppName
, it ends up as "File description" in the installer's binary resource block (among other places). That's what I believe is what UAC prompt displays.
For uninstaller binary the "File description" is hard-coded to "Setup/Uninstall". You cannot change it (at least not without some hacks).
But afaik, the UAC prompt actually prefers displaying description from the digital signature of the binary. As your binary is signed, just make sure you specify the description, when signing. If you are using the Microsoft signtool
, use its sign
command's /d
switch.
In Inno Setup, the sign command is shared between installer and uninstaller. But they are still signed separately. So it's still possible to have different description for them. Just create a sign script (a plain Windows batch file will do), that checks what is being signed, chooses appropriate description and calls the signtool
. And use your sign script in Inno Setup, instead of using signtool
directly.
A trivial example:
@echo off
set FILENAME=%~n1
if "%FILENAME%" == "uninst.e32" (
set DESC=My Program Uninstaller
) else (
set DESC=My Program Installer
)
signtool sign ... /d "%DESC%" "%1"
For a proof of this concept, see Microsoft SmartScreen - suspended using Inno Setup installer?
Note that the sign command is not executed with your script path as a working directory. So you will have to use a full path (or alter PATH
). When defining the path in the iss script, use SourcePath
preprocessor variable. Like this:
SignTool=mysignscript {#SourcePath}\sign.bat $f
With some smart (but unreadable) syntax, it should be possible to achieve the same with one-liner directly in the .iss script. I'd recommend powershell
instead of cmd
for this though.
Ntb, as the above linked question shows, the sign script is exactly the place which you can use to hack the uninstaller's "File description", if you want to modify it too.