Is there a way to include the version number as part of the output.msi filename in a VS2008 Setup Project?
I\'d like for example an output file called: \"myinstall
Same concept as Jim Grimmett's answer, but with less dependencies:
FOR /F "tokens=2 delims== " %%V IN ('FINDSTR /B /R /C:" *\"ProductVersion\"" "$(ProjectDir)MySetupProjectName.vdproj"') DO FOR %%I IN ("$(BuiltOuputPath)") DO REN "$(BuiltOuputPath)" "%%~nI-%%~nxV%%~xI"
MySetupProjectName.vdproj should be changed to the name of your project file. Forgetting to change this results in a build error: 'PostBuildEvent' failed with error code '1' and the Output window shows which file FINDSTR could not open.
FINDSTR /B /R /C:" *\"ProductVersion\"" $(ProjectDir)MySetupProjectName.vdproj
"ProductVersion" = "8:x.y.z.etc" line from the project file.FOR /F "tokens=2 delims== " %%V IN (...) DO ... %%~nxV ...
x.y.z.etc part from the above result.$(BuiltOuputPath)
FOR %%I IN (...) DO ... %%~nI-%%~nxV%%~xI
foo.msi to foo-x.y.z.etc.msi.REN "$(BuiltOuputPath)" ...
FOR ... DO FOR .. DO REN ...