Archive: Get Flash Player version


Get Flash Player version
http://nsis.sourceforge.net/wiki/Get..._Flash_version

Edit:
What happened here lol
My reply went to the top...

-Stu


Get Flash Player version
Hi!

Read example "Macromedia Flash Player installed?". Very good!

Question: flash player version?

Thx answer!


Name "Output"
OutFile "Output.exe"

!include "WordFunc.nsh"
!insertmacro WordFind

!include "FileFunc.nsh"
!insertmacro GetFileVersion

Section
ReadRegStr $0 HKCR "ShockwaveFlash.ShockwaveFlash\shell\open\command" ""
IfErrors notinst

${WordFind} '$0' '"' '+1' $0

${GetFileVersion} '$0' $1
IfErrors notinst

MessageBox MB_OK '$$0={$0}$\n$$1={$1}' IDOK end

notinst:
MessageBox MB_OK 'Macromedia Flash Player is not found'

end:
SectionEnd

Unfortunetly, the examples don't work right! :-(
Macromedia MX is installed on my system ( with flash 6 integrated ), and after it i installed the Flash Player 8.

After it the values that were given back to the version numbers: 6.0.21.0 and 7.0.19.0.

How will I know the right version number?

Thank you in anticipation!


This code to return Macromedia Flash Player version of the default player for the .spl and .swf. If you run "file.swf" from the explorer you can check it. This code doesn't return version of the default browser flash plugin.

Name "Output"
OutFile "Output.exe"

!include "WordFunc.nsh"
!insertmacro WordFind

!include "FileFunc.nsh"
!insertmacro GetFileVersion

Section
ReadRegStr $0 HKEY_CLASSES_ROOT "ShockwaveFlash.ShockwaveFlash\shell\open\command" ""
IfErrors notinst

${WordFind} '$0' ' %1' '-1{' $0
${WordFind} '$0' '"' '+1' $0

${GetFileVersion} '$0' $1
IfErrors notinst


MessageBox MB_OK '$$0={$0}$\n$$1={$1}' IDOK end

notinst:
MessageBox MB_OK 'Macromedia Flash Player is not installed'

end:
SectionEnd

I'm sorry... :-( Question bad. :-(
Aright question: return version of the default browser flash plugin?
Default browser - only - Internet Explorer.


For Internet Explorer:

Name "Output"
OutFile "Output.exe"

!include "FileFunc.nsh"
!insertmacro GetFileVersion

Section
ReadRegStr $0 HKCR "CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}\InprocServer32" ""
IfErrors notinst

${GetFileVersion} '$0' $1
IfErrors notinst

MessageBox MB_OK '$$0={$0}$\n$$1={$1}' IDOK end

notinst:
MessageBox MB_OK 'Macromedia Flash Player component for IE is not found'

end:
SectionEnd

Very, very good!
Thx!


Re: Get Flash Player version

Originally posted by Afrow UK
http://nsis.sourceforge.net/wiki/Get..._Flash_version

Edit:
What happened here lol
My reply went to the top...

-Stu
This doesn't work for flash version 8 as it installs ocx with another name (flash8.ocx).

But it has Push "flash.ocx" for the function call which you can change (or did you add that in just now?)

-Stu


So, I need two calls in order to determine flash version - one for flash 8 and (in case of failure) for flash with previous version?


I guess so yes :)

-Stu


Can NSIS be used to download the flash player if it can not find the proper version?


Yes. Use the NSISdl plugin (included with NSIS), or the InetLoad plug-in to download it.