shai Posted December 31, 2013 Posted December 31, 2013 i try use dllcall for call MsiGetFileVersion func from msi.dll. but i dont get it. this is me trying code: $a = DllCall("msi.dll","long","MsiGetFileVersion","str","c:\anymsifile.msi",Binary(1024),Binary(4),0,0) MsgBox(0,'', $a) this is a article in microsoft about this function http://msdn.microsoft.com/en-us/library/aa370122(v=vs.85).aspx thanks for your help.
MilesAhead Posted December 31, 2013 Posted December 31, 2013 Try specifying cdecl calling convention. See remarks for DllCall My Freeware Page
MilesAhead Posted December 31, 2013 Posted December 31, 2013 It's a calling convention. If you search it and read the help you will find. My Freeware Page
shai Posted January 1, 2014 Author Posted January 1, 2014 (edited) i write this func for the get version of msi file: Func get_msiversion($FilePath) If Not FileExists($FilePath) Then Return SetError(1, 0, 0) Dim $installer, $database, $view, $result $installer = ObjCreate("WindowsInstaller.Installer") $database = $installer.OpenDatabase ($FilePath, 0) if @error Then Return SetError(2, 0, 0) $view = $database.OpenView ("SELECT Value FROM Property WHERE Property='ProductVersion'") $view.Execute $result = $view.Fetch Return $result.StringData(1) EndFunc but I prefer use dllcall. sameone can help me to do this? Edited January 1, 2014 by shai
LarsJ Posted January 1, 2014 Posted January 1, 2014 MsiGetFileVersion is a function that reads the version resource information from a PE file (.exe or .dll) the same way the Windows Installer does. It will not get you the version information out of an MSI. Use the MsiGetProduct... functions to get this information. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions
MilesAhead Posted January 1, 2014 Posted January 1, 2014 (edited) you mean "return type"? No. Calling convention has to do with order of parameters passed to function calls. If the calling program and called function don't use the same conventions the data passed in will be scrambled. Also it can cause the program to crash. For detailed explanation you should search. Edit: this should get you started. http://en.wikipedia.org/wiki/Calling_convention Edited January 1, 2014 by MilesAhead My Freeware Page
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now