inno-setupuninstallation

Replace "Setup/Uninstall" string in UAC prompt for Inno Setup uninstaller


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:

enter image description here

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?


Solution

  • 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).

    enter image description here


    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"