我们目前配置了几个VS2013安装程序/安装程序项目,需要转到自动部署过程。
因此需要的一件事是安装程序的自动增量版本号(msi)。
在VS2013中有没有办法做到这一点?我们使用TeamCity进行构建和部署,并使用git进行源代码控制。
我认为还有其他软件包(例如Wix)已经支持这个,但如果我们能坚持使用对我们来说最好的VS2013。
答案 0 :(得分:1)
您可以使用vs扩展程序 - 自动版本增量程序:
https://visualstudiogallery.msdn.microsoft.com/e30465a4-dab9-44ca-815b-b390ceeef6ab
更新:请求可以通过以下文章实现:http://www.codeproject.com/Articles/22256/NewSetupVersion-for-MSI-Projects
以及其中描述的脚本:
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'' Increment the version number of an MSI setup project
'' and update relevant GUIDs
''
'' Hans-Jürgen Schmidt / 19.12.2007
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
set a = wscript.arguments
if a.count = 0 then wscript.quit 1
'read and backup project file
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(a(0))
s = f.ReadAll
f.Close
fbak = a(0) & ".bak"
if fso.fileexists(fbak) then fso.deletefile fbak
fso.movefile a(0), fbak
'find, increment and replace version number
set re = new regexp
re.global = true
re.pattern = "(""ProductVersion"" = ""8:)(\d+(\.\d+)+)"""
set m = re.execute(s)
v = m(0).submatches(1)
v1 = split(v, ".")
v1(ubound(v1)) = v1(ubound(v1)) + 1
vnew = join(v1, ".")
'msgbox v & " --> " & vnew
s = re.replace(s, "$1" & vnew & """")
'replace ProductCode
re.pattern = "(""ProductCode"" = ""8:)(\{.+\})"""
guid = CreateObject("Scriptlet.TypeLib").Guid
guid = left(guid, len(guid) - 2)
s = re.replace(s, "$1" & guid & """")
'replace PackageCode
re.pattern = "(""PackageCode"" = ""8:)(\{.+\})"""
guid = CreateObject("Scriptlet.TypeLib").Guid
guid = left(guid, len(guid) - 2)
s = re.replace(s, "$1" & guid & """")
'write project file
fnew = a(0)
set f = fso.CreateTextfile(fnew, true)
f.write(s)
f.close