Detect installed Acrobat Reader version: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (Added category links.) |
m (Adding new author and category links.) |
||
Line 1: | Line 1: | ||
{ | {{PageAuthor|alessiog}} | ||
== Description == | == Description == | ||
Here is a function to detect which version of Acrobat Reader is installed on PC. | Here is a function to detect which version of Acrobat Reader is installed on PC. | ||
Line 68: | Line 66: | ||
</highlight-nsis> | </highlight-nsis> | ||
[[ | [[Category:Other Products Version Detection Functions]] |
Revision as of 12:06, 24 June 2005
Author: alessiog (talk, contrib) |
Description
Here is a function to detect which version of Acrobat Reader is installed on PC.
The Function
;------------------------------------------------------------------------------- ; GetAcrobatReaderVersion ; Author: Alessio Garbi (e-Project srl) <agarbi@e-project.it> ; ; input: ; none ; output: ; top of stack: string version ("xx.xx.xx.xx" formatted; "0.0.0.0" if not found) ; note: ; Function tested with Acrobat Reader ver 4, 5, 6 and language ITA, ENG ; $R0, $R1, $R2, $R3, $R4, $R5 are NOT saved in stack so you have to preserve them ; outside this function! Function GetAcrobatReaderVersion ;check Acrobat Reader 6 (and probably next versions) ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\ACRORD32.EXE" "" StrCmp "$R0" "" CheckPreviousVersion6 ;acquire ACRORD32.EXE file version GetDllVersion "$R0" $R0 $R1 IntOp $R2 $R0 / 0x00010000 IntOp $R3 $R0 & 0x0000FFFF IntOp $R4 $R1 / 0x00010000 IntOp $R5 $R1 & 0x0000FFFF Goto EndGetAcrobatReaderVersion CheckPreviousVersion6: ;check Acrobat Reader 5 or previous versions ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\ACROBAT.EXE" "" StrCmp "$R0" "" SetAcrobatReader0 ;acquire ACROBAT.EXE file version GetDllVersion "$R0" $R0 $R1 IntOp $R2 $R0 / 0x00010000 IntOp $R3 $R0 & 0x0000FFFF IntOp $R4 $R1 / 0x00010000 IntOp $R5 $R1 & 0x0000FFFF Goto EndGetAcrobatReaderVersion SetAcrobatReader0: ;set null version 0.0.0.0 StrCpy $R2 "0" StrCpy $R3 "0" StrCpy $R4 "0" StrCpy $R5 "0" EndGetAcrobatReaderVersion: Push "$R2.$R3.$R4.$R5" FunctionEnd