|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
|
#1 |
|
Junior Member
Join Date: Oct 2011
Posts: 14
|
Associate icon to files created with a certain extension
Good morning people,
I need your help, I joined two extensions on windows with Nisis now I want to associate an icon for each of the two extensions that I have created and joined in windows. I did so to associate the extensions that create HKEY_CLASSES_ROOT WriteRegStr "My.Extension.MYE" "" "My Extension MYE" HKEY_CLASSES_ROOT WriteRegStr "My.Extension.MYE \ shell \ open \ command" "" "$ INSTDIR \ Meu_executavel.exe" "% 1" ' WriteRegStr HKEY_CLASSES_ROOT. "mye" "" "My.Extension.MYE" then I tried to associate the icons adiconando this line: HKEY_CLASSES_ROOT WriteRegStr "My.Extension.MYE \ DefaultIcon" "" "$ INSTDIR \ desenho.ico" "% 1" ' then the code looks like this: HKEY_CLASSES_ROOT WriteRegStr "My.Extension.MYE" "" "My Extension MYE" HKEY_CLASSES_ROOT WriteRegStr "My.Extension.MYE \ shell \ open \ command" "" "$ INSTDIR \ Meu_executavel.exe" "% 1" ' HKEY_CLASSES_ROOT WriteRegStr "My.Extension.MYE \ DefaultIcon" "" "$ INSTDIR \ desenho.ico" "% 1" ' WriteRegStr HKEY_CLASSES_ROOT. "mye" "" "My.Extension.MYE" But I can not work as associate icons to files that have the extension I created? Thank you! |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,849
|
I think you shouldn't have a period after HKCR (x2).
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2011
Posts: 14
|
|
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,849
|
WriteRegStr HKEY_CLASSES_ROOT. "mye" "" "My.Extension.MYE"
you have a period there. |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,813
|
DefaultIcon should look like:
c:\path\file.ico c:\path\file.dll,3 c:\path\file.dll,-3 or %1 If there is only one icon in the file you don't need the comma and number. Since this is not a command line, quotation marks are not necessary. %1 only works if the filetype is bmp,ico,dll,cpl,exe etc. IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Apr 2012
Posts: 1
|
I do this using the default windows associations then i do some modifications, originally was ft000001 then i changed to ft000002, using export registry entries.
try this: WriteRegStr HKCR ".app" "" "ft000002" WriteRegStr HKCR "ft000002" "" "" WriteRegDWORD HKCR "ft000002" "EditFlags" 0 WriteRegDWORD HKCR "ft000002" "BrowserFlags" 8 WriteRegStr HKCR "ft000002\DefaultIcon" "" "$INSTDIR\MyApp.exe,0" WriteRegStr HKCR "ft000002\shell\open\command" "" '$INSTDIR\MyApp.exe "%1"' where [.app] is a sample extension, change [MyApp.exe] to your application name. in this fragment ['$INSTDIR\MyApp.exe "%1"'] we can use single externally to use double quotation internally. Its all. antonio (meu ingles nao tah lah muito bom) |
|
|
|
|
|
#7 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,813
|
You should quote the path: WriteRegStr HKCR "ft000002\shell\open\command" "" '"$INSTDIR\MyApp.exe" "%1"'
IntOp $PostCount $PostCount + 1 |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|