Defcon0
16th October 2006 16:58 UTC
Actualize the Icon Classes_Root in Registry
Hello,
in my installer I set some icons and descriptions for 2 types of files .mzt and .mzt2. For this I write the key .mzt in the HKEY_CLASSES_ROOT dir in the registry.
This works just fine. But only after a reboot.
With InstallShield which I used before the (much better :)) NSIS the icons were instantly connected with the file types.
Is this also possible with NSIS ?
Thanks.
Bye Defcon0
kichik
16th October 2006 17:04 UTC
Use RefreshShellIcons.
Defcon0
16th October 2006 17:12 UTC
Thanks a lot.
Defcon0
16th October 2006 17:14 UTC
Oh it doesn't work, I see now:
[...]
Processed 1 file, writing output:
Adding plug-ins initializing function... Done!
Error: resolving install function "RefreshShellIcons" in install section "Zusätzliche Dateien" (1)
Note: uninstall functions must begin with "un.", and install functions must not
Error - aborting creation process
kichik
16th October 2006 17:19 UTC
Create a copy of the function with the "un." prefix for the uninstaller.
Defcon0
16th October 2006 17:24 UTC
No, I think this not the point.
I don't use this for uninstall. In the documentation is written:
Syntax:
${RefreshShellIcons}
Example:
Section
WriteRegStr HKCR "Winamp.File\DefaultIcon" "" "$PROGRAMFILES\Winamp\WINAMP.EXE,2"
${RefreshShellIcons}
SectionEnd
But when I type it in (means ${RefreshShellIcons}) there's the error:
Invalid command: ${RefreshShellIcons}
Error in script "C:\Documents and Settings\Administrator\Desktop\Setup\Setup.nsi" on line 164 -- aborting creation process
kichik
16th October 2006 17:31 UTC
That's a totally different error and function than the last one. Of course it's not the point.
To use the last RefreshShellIcons you mentioned, you must first include the appropriate header file - FileFuncs.nsh, and then insert the function macro. Only then you can use the function. If you wish to use it in the uninstaller, insert the macro prefixed with "un." and use accordingly.
Defcon0
16th October 2006 17:45 UTC
ok. I included the FileFunc.nsh.
.. and then insert the function macro
How do I do it ? Sorry I'm really new to NSIS.
Is it !insertmacro ... ? If so, what's "..." ?
kichik
16th October 2006 17:48 UTC
It's all in the documentation.
!include FileFuncs.nsh
!insertmacro RefreshShellIcons
!insertmacro un.RefreshShellIcons
Section something
${RefreshShellIcons}
SectionEnd
Section uninstall
${un.RefreshShellIcons}
SectionEnd
Defcon0
16th October 2006 17:56 UTC
Yo. Thanks !