Old 6th January 2014, 18:37   #1
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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:
Quote:
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
Afrow UK is offline   Reply With Quote
Old 6th January 2014, 20:35   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
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...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 6th January 2014, 23:09   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Quote:
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?
Quote:
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).
Quote:
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
Afrow UK is offline   Reply With Quote
Old 7th January 2014, 00:52   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,172
Quote:
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...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th January 2014, 15:30   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
New version.
Quote:
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
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump