Advertisement
Guest User

Untitled

a guest
Aug 21st, 2010
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. !searchreplace BASENAME "${__FILE__}" ".nsi" ""
  2. OutFile `${BASENAME}.exe`
  3. Name `${BASENAME}`
  4. Caption "$(^Name)"
  5. ShowInstDetails show
  6. !include LogicLib.nsh
  7.  
  8. !macro _GetErrorCode dwMessageId
  9.     System::Call Kernel32::FormatMessage(i0x00000100|0x00001000|0x00000200,,i${dwMessageId},i0x0400,*i.r1,,)i.r0
  10. ;   IntOp $0 $0 - 2
  11.     System::Call *$1(&t$0.r0)
  12.     System::Call Kernel32::LocalFree(ir1)
  13. !macroend
  14. !macro GetErrorCode RETURN_VALUE
  15.     Push ${RETURN_VALUE}
  16.     System::Store sR0R1
  17.     !insertmacro _GetErrorCode R0
  18.     DetailPrint 'Return Value = $0'
  19.     !insertmacro _GetErrorCode R1
  20.     DetailPrint 'last-error code = $0'
  21.     System::Store l
  22. !macroend
  23.  
  24. !define COM_CallMethod "!insertmacro _COM_CallMethod "
  25. !macro _COM_CallMethod _vto _ParamsDecl _IFacePtr _Params
  26.     System::Call `${_IFacePtr}->${_vto}${_ParamsDecl} ${_Params}`
  27. !macroend
  28.  
  29. !define IUnknown->Release "${COM_CallMethod}2 ()i. "
  30. !define ITypeLib->GetLibAttr "${COM_CallMethod}7 (*i)i. "
  31. !define ITypeLib->ReleaseTLibAttr "${COM_CallMethod}12 (i)i. "
  32.  
  33. Section
  34.  
  35. StrCpy $R0 D:\PortableApps\BurnAwarePortable\App\BurnAware\FoxSDKU32w.dll
  36. StrCpy $R0 D:\PortableApps\WinampPortable\Macromed\Flash\Flash10h.ocx
  37. StrCpy $R0 C:\WINDOWS\system32\mshtml.dll ; this is not working
  38. StrCpy $R0 C:\WINDOWS\system32\msxml.dll
  39.     System::Call 'Oleaut32::LoadTypeLib(w R0,*i.r1)i.r0'
  40.     !insertmacro GetErrorCode $0
  41.     ${If} $0 = 0
  42.         ${ITypeLib->GetLibAttr} $1 '(.R0).r0'
  43.         ${If} $0 = 0
  44.             System::Call '*$R0(&g16.R1,i.R2,i.R3,&i2.R4,&i2.R5,&i2.R6)'
  45.             ${ITypeLib->ReleaseTLibAttr} $1 (R0)
  46.            
  47.             DetailPrint 'TLIBATTR structure'
  48.             DetailPrint GUID=$R1
  49.             DetailPrint CLID=$R2
  50.             DetailPrint SYSKIND=$R3
  51.             DetailPrint MajorVerNum=$R4
  52.             DetailPrint MinorVerNum=$R5
  53.             DetailPrint LibFlags=$R6
  54.         ${EndIf}
  55.         ${IUnknown->Release} $1 ()
  56.     ${EndIf}
  57. SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement