0

I created the installer using NSIS. Everything working fine but default icon not setting to the particular files.

   WriteRegStr HKCR "Myapp\DefaultIcon" "" "$INSTDIR\Myexe,1"

I need to set default icon by using my Exe not by using icon file

ZiGaelle
  • 744
  • 1
  • 9
  • 21

1 Answers1

0

You need to provide the full path. If you want the first icon in your .exe then you don't need a icon index:

RequestExecutionLevel Admin

Section
WriteRegStr HKCR ".foo" "" "foofile" ; .foo file extension
WriteRegStr HKCR "foofile\DefaultIcon" "" "$INSTDIR\MyApp.exe"
SectionEnd

Other icons need a icon index:

WriteRegStr HKCR "MyProgId\DefaultIcon" "" "$INSTDIR\MyApp.exe,1"
Anders
  • 97,548
  • 12
  • 110
  • 164
  • Thank you sir.I already tried both types but still its not working.I tried this also (WriteRegStr HKCR "MyProgId\DefaultIcon" "" "$INSTDIR\Ico.ico").But still its not working – R.Aravinth Kumar Jul 26 '19 at 09:35
  • There might be something else wrong. Is your application started correctly when you double-click your file-type? – Anders Jul 26 '19 at 10:02