Filegetversion liefert nicht immer alle Informationen

  • Hallo ich versuche mit Filegetversion Infos aus einer Setupdatei (Installshield) auszulesen.
    Leider klappt es nicht, nutze AutoIt 3.3.6.1 und Win7@64

    [autoit]


    $exe = "G:\Install\setup.exe"
    ;~ $exe = "D:\Setups\System\WindowsServer2003-KB914961-SP2-x86-DEU.exe"

    [/autoit][autoit][/autoit][autoit][/autoit][autoit]

    $a = FileGetVersion($exe,"ProductVersion")
    $b = FileGetVersion($exe,"ProductName")
    $c = FileGetVersion($exe,"FileDescription")
    ConsoleWrite($exe & @CRLF & $a & @CRLF & $b & @CRLF & $c & @CRLF)
    Exit

    [/autoit]
    Zitat

    >Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Dietmar\Desktop\Install Update Tool.au3"
    G:\Install\setup.exe


    +>19:13:32 AutoIT3.exe ended.rc:0
    >Exit code: 0 Time: 1.044

    Output beim Test der anderen Exe (SP für Win2k3)

    Wie komme ich an die Infos ran unter Windows sind die im Explorer sichtbar und auch bei den Dateieigenschaften unter Details.
    Habe auch #requireadmin probiert da ja dieses UAC Schild an der SetupDatei zu sehen ist.

    Gruß Dietmar


    Hab es mal erweitert damit man sieht, das die datei auch da it :)

    [autoit]

    $exe = "G:\Install\setup.exe"
    ;~ $exe = "D:\Setups\System\WindowsServer2003-KB914961-SP2-x86-DEU.exe"

    [/autoit][autoit][/autoit][autoit]

    $z = FileGetVersion($exe)
    $a = FileGetVersion($exe,"ProductVersion")
    $b = FileGetVersion($exe,"ProductName")
    $c = FileGetVersion($exe,"FileDescription")
    ConsoleWrite($exe & @CRLF & $z & @CRLF & $a & @CRLF & $b & @CRLF & $c & @CRLF)
    Exit

    [/autoit]

    Output:

    Zitat

    >Running:(3.3.6.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Dietmar\Desktop\Install Update Tool.au3"
    G:\Install\setup.exe
    16.0.0.400


    +>19:22:13 AutoIT3.exe ended.rc:0
    >Exit code: 0 Time: 1.034

    Dummerweise interessiert mich nicht die Versionsnummer des Installprogrammes, sondern die des Inhalts. :wacko:

    Achtung Anfänger! :whistling:

    Betrachten des Quellcodes auf eigene Gefahr, bei Übelkeit,Erbrechen,Kopfschmerzen übernehme ich keine Haftung. 8o

    Einmal editiert, zuletzt von Dietmar (9. Juli 2011 um 19:26)

  • Du kannst ja mal mit dieser Funktion experimentieren...

    Spoiler anzeigen
    [autoit]

    ;===============================================================================
    ; Function Name: GetExtProperty($sPath,$iProp)
    ; Description: Returns an extended property of a given file.
    ; Parameter(s): $sPath - The path to the file you are attempting to retrieve an extended property from.
    ; $iProp - The numerical value for the property you want returned. If $iProp is is set
    ; to -1 then all properties will be returned in a 1 dimensional array in their corresponding order.
    ; The properties are as follows:
    ; Name = 0
    ; Size = 1
    ; Type = 2
    ; DateModified = 3
    ; DateCreated = 4
    ; DateAccessed = 5
    ; Attributes = 6
    ; Status = 7
    ; Owner = 8
    ; Author = 9
    ; Title = 10
    ; Subject = 11
    ; Category = 12
    ; Pages = 13
    ; Comments = 14
    ; Copyright = 15
    ; Artist = 16
    ; AlbumTitle = 17
    ; Year = 18
    ; TrackNumber = 19
    ; Genre = 20
    ; Duration = 21
    ; BitRate = 22
    ; Protected = 23
    ; CameraModel = 24
    ; DatePictureTaken = 25
    ; Dimensions = 26
    ; Width = 27
    ; Height = 28
    ; Company = 30
    ; Description = 31
    ; FileVersion = 32
    ; ProductName = 33
    ; ProductVersion = 34
    ; Requirement(s): File specified in $spath must exist.
    ; Return Value(s): On Success - The extended file property, or if $iProp = -1 then an array with all properties
    ; On Failure - 0, @Error - 1 (If file does not exist)
    ; Author(s): Simucal ([email='Simucal@gmail.com'][/email])
    ; Note(s):
    ;
    ;===============================================================================
    Func _GetExtProperty($sPath, $iProp)
    Local $iExist, $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty
    $iExist = FileExists($sPath)
    If $iExist = 0 Then
    SetError(1)
    Return 0
    Else
    $sFile = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1))
    $sDir = StringTrimRight($sPath, (StringLen($sPath) - StringInStr($sPath, "\", 0, -1)))
    $oShellApp = ObjCreate ("shell.application")
    $oDir = $oShellApp.NameSpace ($sDir)
    $oFile = $oDir.Parsename ($sFile)
    If $iProp = -1 Then
    Local $aProperty[35]
    For $i = 0 To 34
    $aProperty[$i] = $oDir.GetDetailsOf ($oFile, $i)
    Next
    Return $aProperty
    Else
    $sProperty = $oDir.GetDetailsOf ($oFile, $iProp)
    If $sProperty = "" Then
    Return 0
    Else
    Return $sProperty
    EndIf
    EndIf
    EndIf
    EndFunc ;==>_GetExtProperty

    [/autoit]
  • Nette Funktion aber leider nicht erfolgreich

    [autoit]

    for $i = 0 to 35
    ConsoleWrite(_GetExtProperty($exe,$i) & @CRLF)
    Next

    [/autoit]

    Wobei das mit den nummern ja Os-/Länderspezifisch ja nicht immer gleich ist.

    Output:

    Achtung Anfänger! :whistling:

    Betrachten des Quellcodes auf eigene Gefahr, bei Übelkeit,Erbrechen,Kopfschmerzen übernehme ich keine Haftung. 8o