Search code examples
windowswinapiinno-setup

How Inno Setup hides "pin" command in the Taskbar menu


When and after I build an .exe via Inno Setup, I run the .exe and when I right click the taskbar button of my application, I can only see there an item "Close window". When I build an exe via Visual Studio or any other program in Windows actually, when I click the right click of the mouse, I can see there 3 items.

  1. Name of the my app.
  2. Pin this program to a taskbar.
  3. Close window.

My question is how Inno Setup does that, how can I achieve it programmatically?


Solution

  • It's probably related to how the installer is executed.

    The Inno Setup-made mysetup.exe is (by default) just a loader, that extracts an internal installer to a temporary folder and runs the internal installer elevated. The taskbar button belongs to the internal installer, not to the loader.

    Windows probably somehow heuristically decides that it does not make any sense pinning an application executed this way from a temporary folder. So it hides the option.

    Note that if you disable the loader in Inno Setup, the "pin" command appears.

    [Setup]
    UseSetupLdr=no