Setting correct icon for Shortcut in VS2010 Setup Project

前端 未结 4 1150
渐次进展
渐次进展 2020-12-11 01:18

I have a small app with a setup project. If I create a shortcut to my Primary Output, then this gets a standard Win7 icon and not the icon specified in my exe\'s Application

4条回答
  •  感情败类
    2020-12-11 01:57

    Very simple way using IWshShortcut (works in .net 2 too):

    WshRuntimeLibrary.IWshShortcut MyShortcut = (IWshRuntimeLibrary.IWshShortcut)WshShell.CreateShortcut(fullPathLnk);    
    string iconLoc = MyShortcut.IconLocation; // <- example: "c:\icon.ico,0"
    

    I use to check if iconLoc still exists, fix if not, you can use to find and read icon file, etc etc

提交回复
热议问题