Archive: InstNSPlug in v1.62?


InstNSPlug in v1.62?
I've been away for a bit, but I noticed that v1.62 no longer supports InstNSPlugin? Or it does, and I can't find it (which is quite possible):confused:

If it's gone, can anyone point out the replacement code? Thanks.


Script in functions.htm
Just as I thought, it's in the dist, I just couldn't find it...:mad:

I've also included it here, tweaked for NS6...

;------------------------------------------------------------------------------
; InstallNetscapePlugin
;
; Trashes $OUTDIR, $0, and $1.
;
; Replace 'mynetscapeplugin.dll' with the name of your DLL to extract.
;
; (pretty much untested, but should work)
;
; you may want to add is-netscape-running and error checking (if the file isn't writable)

Function InstallNetscapePlugin
Push $OUTDIR
Push $0
Push $1
StrCpy $0 0
outer_loop:
EnumRegKey $1 HKLM "Software\Netscape\Netscape Navigator" $0
StrCmp $1 "" abort_NS4
ReadRegStr $1 HKLM "Software\Netscape\Netscape Navigator\$1\Main" "Plugins Directory"
StrCmp $1 "" abort_NS4
SetOutPath $1
File mynetscapeplugin.dll
IntOp $0 $0 + 1
Goto outer_loop

abort_NS4:
NOP

; Reset the counters to zero
StrCpy $0 0
outer_loop_NS6:
EnumRegKey $1 HKLM "Software\Netscape\Netscape 6" $0
StrCmp $1 "" abort_NS6
ReadRegStr $1 HKLM "Software\Netscape\Netscape 6\$1\Main" "Install Directory"
StrCmp $1 "" abort_NS6
SetOutPath $1\Plugins
File mynetscapeplugin.dll
IntOp $0 $0 + 1
Goto outer_loop_NS6

abort_NS6:
Pop $1
Pop $0
Pop $OUTDIR
FunctionEnd

;------------------------------------------------------------------------------
; un.InstallNetscapePlugin
;
; Replace 'mynetscapeplugin.dll' with the name of your DLL to delete.
;
; (pretty much untested, but should work)
;
; you may want to add is-netscape-running and error checking (if the delete doesn't work).
Function un.InstallNetscapePlugin
Push $0
Push $1
StrCpy $0 0
outer_loop:
EnumRegKey $1 HKLM "Software\Netscape\Netscape Navigator" $0
StrCmp $1 "" abort_NS4
ReadRegStr $1 HKLM "Software\Netscape\Netscape Navigator\$1\Main" "Plugins Directory"
StrCmp $1 "" abort_NS4
Delete /REBOOTOK $1\mynetscapeplugin.dll
IntOp $0 $0 + 1
Goto outer_loop

abort_NS4:
NOP

; Reset the counters to zero
StrCpy $0 0
outer_loop_NS6:
EnumRegKey $1 HKLM "Software\Netscape\Netscape 6" $0
StrCmp $1 "" abort_NS6
ReadRegStr $1 HKLM "Software\Netscape\Netscape 6\$1\Main" "Install Directory"
StrCmp $1 "" abort_NS6
Delete /REBOOTOK $1\Plugins\mynetscapeplugin.dll
IntOp $0 $0 + 1
Goto outer_loop_NS6

abort_NS6:
Pop $1
Pop $0
FunctionEnd