abu_abdulla
31st December 2007 15:19 UTC
Problem with registerExtension.nsh
Hi,
I have small problem with registerExtension.nsh
http://nsis.sourceforge.net/File_Association
I use:
${registerExtension} "$INSTDIR\installer.exe" ".mcr" "MCR File"
${unregisterExtension} ".mcr" "MCR File"
it gives me this error when compiling:
Section: "Uninstall"
!insertmacro: unregisterExtension
Push: .mcr
Push expects 1 parameters, got 2.
Usage: Push string
Error in macro unregisterExtension on macroline 2
Error in script "E:\Installer.nsi" on line 250 -- aborting creation process
kichik
31st December 2007 18:23 UTC
It has a problem with quoting spaces, among other things. It also corrupts some variables. That script needs some work.
I've fixed your specific problem in the Wiki. Try it now.
abu_abdulla
31st December 2007 18:42 UTC
Appreciate your help.
I have now this exception:
!insertmacro: unregisterExtension
Push: .mcr
Push: MCR File
Call must be used with function names starting with "un." in the uninstall section.
Usage: Call function_name | [:label_name]
Error in macro unregisterExtension on macroline 3
Error in script "E:\Installer.nsi" on line 280 -- aborting creation process
I tried calling:
${unregisterExtension} ".mcr" "MCR File"
from "Uninstall" section and un.onInit function.
Did I missed anything?
Thanks again
kichik
1st January 2008 17:45 UTC
Another problem with the script. It defines unregsiterExtension as an installer function instead of an uninstaller function.
I've fixed that now as well. Try again.
abu_abdulla
2nd January 2008 05:50 UTC
Thanks it works fine now.
I just have small comment. It seems that reboot is required to refresh the icon of the file. I couldn't find a way to rebuild IconCache.db directly.
In Windows XP
- Go to C:\Documents and Settings\{username}\Local Settings\Application Data
- Delete IconCache.db
- Reboot
In Windows 9x
- Goto c:\windows
- Delete ShellIconCache
- Reboot.
kichik
2nd January 2008 18:39 UTC
RefreshShellIcons should do the trick.
abu_abdulla
3rd January 2008 04:03 UTC
Thanks for the help. It works.
abu_abdulla
13th January 2008 08:23 UTC
I have another question. Is there a way to let clicking multiple files (at once) goes as parameters to one EXE instance instead of passing each file to one instance of the EXE file i.e.
program.exe <File1 Path>
program.exe <File2 Path>
program.exe <File3 Path>
And I need it to be:
program.exe <File1 Path> <File2 Path> <File3 Path>
Thanks
kichik
13th January 2008 19:57 UTC
That requires a shell extension.