Same idea as Cece's solution but with a .vbs script that takes the .vdproj filename as first argument and the version as 2nd argument (**.**.** format) :
'Function that generates a new GUID
Function CreateGUID
Dim TypeLib
Set TypeLib = CreateObject("Scriptlet.TypeLib")
CreateGUID = Mid(TypeLib.Guid, 2, 36)
End Function
Const ForReading = 1
Const ForWriting = 2
'Read vdproj filename and new version from arguments and generate new Guid
installerFileName = Wscript.Arguments(0)
newProductVersion = Wscript.Arguments(1)
newProductCode = CreateGUID()
newPackageCode = CreateGUID()
'Prepare Regexs
Set productVersionRegex = New RegExp
With productVersionRegex
.Pattern = Chr(34) & "ProductVersion" & Chr(34) & " = " & Chr(34) & "8:(.*)" & Chr(34)
.IgnoreCase = False
End With
Set productCodeRegex = New RegExp
With productCodeRegex
.Pattern = Chr(34) & "ProductCode" & Chr(34) & " = " & Chr(34) & "8:{(.*)}" & Chr(34)
.IgnoreCase = False
End With
Set packageCodeRegex = New RegExp
With packageCodeRegex
.Pattern = Chr(34) & "PackageCode" & Chr(34) & " = " & Chr(34) & "8:{(.*)}" & Chr(34)
.IgnoreCase = False
End With
'Read Text from installer file
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(installerFileName, ForReading)
installerText = objFile.ReadAll
objFile.Close
'Replace ProductVersion
newProductVersionString = Chr(34) & "ProductVersion" & Chr(34) & " = " & Chr(34) & "8:" & newProductVersion & Chr(34)
installerNewText = productVersionRegex.Replace(installerText, newProductVersionString)
'Replace ProductCode Guid
newProductCodeString = Chr(34) & "ProductCode" & Chr(34) & " = " & Chr(34) & "8:{" & newProductCode & "}" & Chr(34)
installerNewText = productCodeRegex.Replace(installerNewText, newProductCodeString)
'Replace UpgradeCode Guid
newPackageCodeString = Chr(34) & "PackageCode" & Chr(34) & " = " & Chr(34) & "8:{" & newPackageCode & "}" & Chr(34)
installerNewText = packageCodeRegex.Replace(installerNewText, newPackageCodeString)
'Write new Text in installer file
Set objFile = objFSO.OpenTextFile(installerFileName, ForWriting)
objFile.Write installerNewText
objFile.Close
The script can be called like this :
cscript script.vbs Installer.vdproj 1.2.5