I am looking for an MSBuild task/script that will allow me to control the version of an old VB6 project?
The .vbp stores the version information as .ini style, but I cannot find a simple way to read and write the three entries.
I am looking for an MSBuild task/script that will allow me to control the version of an old VB6 project?
The .vbp stores the version information as .ini style, but I cannot find a simple way to read and write the three entries.
I'm not sure that its implemented in any library
You could implement a custom task that calls GetPrivateProfileString.
However a novel idea would be to convert the file automatically to XML via an MSBUILD exec call and then parse that xml using the msbuild more easily.
I always use the FileUpdate-task from the MSBuildCommunityTasks, found on http://msbuildtasks.tigris.org/
You can use regular expressions to find the pattern and then replace in the text you want. For example: to replace the versionnumber in an assembly-info.cs:
<FileUpdate Files="@(VersioningAssemblyInfoFiles)"
Regex="AssemblyFileVersion\(".*"\)\]"
ReplacementText="AssemblyFileVersion("$(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)")]" />