简体   繁体   中英

Windows Custom Icons Sizes (NSIS)

I used NSIS to create an installer for my app, which has a custom .ico icon included which is used to create the shortcut created on the desktop.

In NSIS I used this to create the icon.

CreateShortCut "$DESKTOP\AppName.lnk" "${PATH_TO_EXE}" "C:\PATH\TO\ICON\AppIcon.ico" "C:\PATH\TO\ICON\AppIcon.ico" 0

It worked fine until I used Ctrl+Mouse wheel to resize the desktop icons, which resized the icon up until a point and then defaulted to the default windows icon.

I then read here that different sizes of icons is used to achieve different things.

Example

Windows 7:

    Explorer views:
        Details / List / Small symbols: 16
        All other options: 256 (resized, if necessary)
    Right-click->Properties / choosing a new icon: 32
    Pinned to taskbar: 32
        Right-click-menu: 16
    Desktop:
        Small symbols: 32
        Medium symbols: 48
        Large symbols: 256 (resized, if necessary)
        Zooming using Ctrl+Mouse wheel: 16, 32, 48, 256

So it's clear that I need different icon sizes, so where do I place the different icons, how to I rename them and how do I add them with NSIS so that windows can automatically use the correct icon?

You can specify multiple icon sizes within the same .ico file, no need to create new files. My guess is that every icon editor can handle multiple sizes, otherwise have a look at this online editor .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM