Advertisement
Guest User

Anders

a guest
Nov 16th, 2009
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function GetFileVerFirstLangProductVersion
  2. System::Store S
  3. pop $3
  4. push "" ;failed ret
  5. System::Call 'version::GetFileVersionInfoSize(t"$3",i.r2)i.r0'
  6. ${If} $0 <> 0
  7.     System::Alloc $0
  8.     System::Call 'version::GetFileVersionInfo(t"$3",ir2,ir0,isr1)i.r0 ? e'
  9.     pop $2
  10.     ${If} $0 <> 0
  11.     ${AndIf} $2 = 0 ;a user comment on MSDN said you should check GLE to avoid crash
  12.         System::Call 'version::VerQueryValue(i r1,t "\VarFileInfo\Translation",*i0r2,*i0)i.r0'
  13.         ${If} $0 <> 0
  14.             System::Call '*$2(&i2.r2,&i2.r3)'
  15.             IntFmt $2 %04x $2
  16.             IntFmt $3 %04x $3
  17.             System::Call 'version::VerQueryValue(i r1,t "\StringFileInfo\$2$3\ProductVersion",*i0r2,*i0r3)i.r0'
  18.             ${If} $0 <> 0
  19.                 pop $0
  20.                 System::Call *$2(&t$3.s)
  21.             ${EndIf}
  22.         ${EndIf}
  23.     ${EndIf}
  24.     System::Free $1
  25. ${EndIf}
  26. System::Store L
  27. FunctionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement