Demonstrates using the Replace In File action to increment the version and set the product code of a VS.NET Setup project.
VBScript
Create or increment the BUILD_NUM macro
Increment Build Number
%VDPROJ_FILE%
Create a dummy .vdproj file containing a version line
create file
%DOSCMD% type "%VDPROJ_FILE%"
show file
1
%VDPROJ_FILE%
%VDPROJ_FILE%
"ProductVersion" = "8:([[^"]]*)"
0
"ProductVersion" = "8\:1.0.%BUILD_NUM%"
Update the ProductVersion to the specified value
Update version
%VDPROJ_FILE%
%VDPROJ_FILE%
"ProductCode" = "8:([[^"]]*)"
0
"ProductCode" = "8\:[Left(CreateObject("Scriptlet.Typelib").Guid,38)]"
Update the ProductCode value, generating a new GUID value
Update product code
%DOSCMD% type "%VDPROJ_FILE%"
show file
1
VDPROJ_FILE
%TEMP%\xyz.vdproj