Skip to content
⌘ NSIS Forum Archive

nsFlash plug-in

5 posts

Afrow UK#

nsFlash plug-in

Displays Shockwave Flash (SWF) multimedia in the installer or in a new window.



http://nsis.sourceforge.net/File:NsFlash.zip
Note on dependencies:
This plug-in requires Adobe Shockwave Flash to be installed on the end user's machine. See the example scripts on how nsFlash::IsInstalled is used for this purpose.
Stu
Anders#
This is pretty cool if you need some fancy stuff in your installer.

A couple of questions:

Why do you prefix your plugin names with ns? It might have made sense back when Nullsoft did most of the NSIS work but not really anymore IMHO.

And you depend on msvcr110 because you use ATL ActiveX hosting? I am/was working on a plugin that hosts IE but getting the OLE details correctly when doing everything yourself is tricky.

Why use HeapAlloc over GlobalAlloc? You are going to import GlobalAlloc anyway if you use the stack...
Afrow UK#
Originally Posted by Anders
Why do you prefix your plugin names with ns? It might have made sense back when Nullsoft did most of the NSIS work but not really anymore IMHO.
Yes it's just a habit really now I suppose. It does make it easier to find plug-ins when searching though, and provides plug-ins with a non-generic name without adding many additional characters. What would you have named the plug-in?
Originally Posted by Anders
And you depend on msvcr110 because you use ATL ActiveX hosting? I am/was working on a plugin that hosts IE but getting the OLE details correctly when doing everything yourself is tricky.
Just referencing the IShockwaveFlash interface in the code requires some CRT initialization thanks to the compiler. The actual ATL functions (such as AtlAxAttachControl) are dynamically loaded though (which keeps the DLL size down a little).
Originally Posted by Anders
Why use HeapAlloc over GlobalAlloc? You are going to import GlobalAlloc anyway if you use the stack...
According to MSDN, GlobalAlloc and LocalAlloc are just wrappers for HeapAlloc and using them just adds additional overhead.

Edit: I see what you are saying now. Perhaps I will change it for the next version.

Stu
Anders#
Originally Posted by Afrow UK View Post
What would you have named the plug-in?
Probably something lame like FlashHost.


I don't see why you need to import IShockwaveFlash at all, the only non IUnknown usage I see is g_pFlash->Menu = VARIANT_FALSE; and you can probably hack your way around it by creating a dummy IShockwaveFlash interface if you wanted to avoid the CRT...
Afrow UK#
New version.
1.0.0.1 - 7th January 2014
* Completely removed msvcr110.dll dependency.
* Replaced HeapAlloc with GlobalAlloc.
* Replaced Flash.ocx import with static interface definition (Flash.h).
* Added /size option for nsFlash::Window.
http://nsis.sourceforge.net/File:NsFlash.zip

Stu