Is Macromedia Flash Player installed: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (Adding new author and category links.) |
|||
(5 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
== Description == | == Description == | ||
This function detects if Macromedia Flash is installed in the user's computer. | This function detects if Macromedia Flash is installed in the user's computer. | ||
Edit: To be able to handle if Flash was installed and the un-installed | |||
needed to get value from InprocServer32 and see if the file exists as an | |||
uninstall leaves behind the registry entry but removes the files. | |||
[[User:Caramel|Caramel]] 17:25, 21 November 2007 (PST) | |||
Also see: [[Get Macromedia Flash version]] | |||
== The Function == | == The Function == | ||
<highlight-nsis> ; IsFlashInstalled | <highlight-nsis> ; IsFlashInstalled | ||
; | ; | ||
; By Yazno | ; By Yazno (edit Caramel) | ||
; Returns on top of stack | ; Returns on top of stack | ||
; 0 (Flash is not installed) | ; 0 (Flash is not installed) | ||
Line 21: | Line 28: | ||
Push $R0 | Push $R0 | ||
ClearErrors | ClearErrors | ||
ReadRegStr $R0 HKCR "CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}" "" | ReadRegStr $R0 HKCR "CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}\InprocServer32" "" | ||
IfErrors lbl_na | IfErrors lbl_na | ||
StrCpy $R0 1 | IfFileExists $R0 0 lbl_na | ||
StrCpy $R0 1 | |||
Goto lbl_end | Goto lbl_end | ||
lbl_na: | lbl_na: |
Latest revision as of 01:25, 22 November 2007
Author: sunjammer (talk, contrib) |
Description
This function detects if Macromedia Flash is installed in the user's computer.
Edit: To be able to handle if Flash was installed and the un-installed needed to get value from InprocServer32 and see if the file exists as an uninstall leaves behind the registry entry but removes the files.
Caramel 17:25, 21 November 2007 (PST)
Also see: Get Macromedia Flash version
The Function
; IsFlashInstalled ; ; By Yazno (edit Caramel) ; Returns on top of stack ; 0 (Flash is not installed) ; or ; 1 (Flash is installed) ; ; Usage: ; Call IsFlashInstalled ; Pop $R0 ; ; $R0 at this point is "1" or "0" Function IsFlashInstalled Push $R0 ClearErrors ReadRegStr $R0 HKCR "CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}\InprocServer32" "" IfErrors lbl_na IfFileExists $R0 0 lbl_na StrCpy $R0 1 Goto lbl_end lbl_na: StrCpy $R0 0 lbl_end: Exch $R0 FunctionEnd