Hallo,
Ich habe einen Ordner der mit Tortoise SVN immer auf dem aktuellen stand gehalten wird. Wie kann ich aber die aktuelle versionsnummer der datein mit autoit auslesen?
MfG
filewalker
Hallo,
Ich habe einen Ordner der mit Tortoise SVN immer auf dem aktuellen stand gehalten wird. Wie kann ich aber die aktuelle versionsnummer der datein mit autoit auslesen?
MfG
filewalker
Mit FileGetVersion!?
das geht leider nicht. mit FileGetVErsion bekommt man immer nur 0.0.0.0.
Was sind das für Dateien?
Beziehungsweise wo (innerhalb der Datei) stehen die Versionsangaben?
Die Dateien sind mit Tortoise SVN verwaltet, ein subverison tool.
wenn man in windows ein rechtsklick auf die datein macht und dann auf eigenschaften gibt es einen extra reiter svn subversion, da stehen dann alle infos wie auch die version drin. mann kann aber auch den log befehl des programms aufrufen, dann öffnet sich ein programmfenster, welches die verisonsnummer enthällt. Nur kann ich das auch cniht auslesen
Bekommst Du hiermit die gewünschten Informationen:
#include <array.au3>
$path = FileOpenDialog("Select a file to read attributes",@ScriptDir,"All (*.*)")
$prop = _GetExtProperty($path, -1)
_ArrayDisplay($prop,"Property Array")
;===============================================================================
; 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
danke für deinen beitrag, aber das liefert auch nciht die nötigen informationen.
ich habe ein script für unix systeme welches die versionsnummer rausfindet, allerdings funktioniert das nja nciht unter windows
#!/usr/bin/env sh
# SVN Revision Extractor for Unix systems
# Written by Burlex, 2008/02/20
revision=`LC_ALL=C svn info | grep Revision | cut -d' ' -f2`
if [ -z $revision ]; then
revision=0
fi
echo "// This file was automatically generated by the SVN revision extractor." > src/test/svn_revision.h
echo "// There is no need to modify it." >> src/test/svn_revision.h
echo >> src/test/svn_revision.h
echo "#ifndef SVN_REVISION_H" >> src/test/svn_revision.h
echo "#define SVN_REVISION_H" >> src/test/svn_revision.h
echo >> src/test/svn_revision.h
echo "static const char * BUILD_TAG = \"`cat test-tag`\";" >> src/test/svn_revision.h
echo "static int BUILD_REVISION = $revision;" >> src/test/svn_revision.h
echo >> src/test/svn_revision.h
echo "#endif // SVN_REVISION_H" >> src/test/svn_revision.h
echo "1"
Alles anzeigen
Man könnte die Informationen auch direkt aus den Dateien auslesen. Dazu müsstest Du Dir mal einige Dateien mit einem Hexeditor ansehen und schreiben wo (Offset, an welcher Stelle innerhalb der Datei) die Versioninfos stehen.