How to include version number in VS Setup Project output filename

前端 未结 6 1251
既然无缘
既然无缘 2020-12-08 04:58

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

6条回答
  •  春和景丽
    2020-12-08 05:52

    I did it with 2 lines in powershell.

    $versionText=(Get-Item MyProgram.exe).VersionInfo.FileVersion
    (Get-Content MySetup.vdproj.template).replace('${VERSION}', $($versionText)) | Set-Content MySetup.vdproj
    

    Rename your existing .vdproj to be MySetup.vdproj.template and insert "${VERSION}" wherever you want to insert the version of your primary exe file.

    VS will then detect the change in the vdproj file and ask you if you want to reload it.

提交回复
热议问题