Dear NG,
ich have a problem since our upgrade for VS2003 to VS2005: In our
automated nightly build process we build some MSIs - in this process
we set the productcode and the version of the setup projects via DTE.
Therefore I wrote a VS macro, which is called through devenv
Solution.sln /command "Macros.MyMacros.Module4.testForNG
params" (example for NG, code is attached).
The problem is know: when we set the version in VS2005 through this
macro, we get a messagbox with text like this : "It is recommended to
upgrade the productcode when you change the version ... YES/NO/
CANCEL".
This is a great problem, because the messagebox stops the automated
build process ...
The question to you is:
* has anybody a solution for this on such a problem?
The only idea I have is to get a reference to this messagebox and
close it from code.
* does anybody know how to do this with DTE?
* or: which DTE Event is responsibel for this box?
An other Solution might be to write the productcode and version in the
*.vdproj via FSO - this is a solution I currently don't like to
implement.
Greetings from South Germany,
Dirk Schwier.
------------------------------------------------------------------------------------------------------------------------------------------------------------
' I have a solution with two projects:
' Project: HelloWorld.csproj, type Console App
' Project: Setup1, type: Setup Project
Sub testForNG()
Dim soln As Solution
Dim projs As Projects
Dim proj, activeProj As Project
Dim props As Properties
soln = DTE.Solution
' get all projects of current solution
projs = soln.Projects
' search project by name
For Each proj In DTE.Solution.Projects
If (proj.Name = "Setup1") Then
props = proj.Properties
End If
Next
' set ProductCode
props.Item("ProductCode").Value() = "{" &
System.Guid.NewGuid.ToString & "}"
' set Version
props.Item("Version").Value() = "1.0.0.0"
End Sub
Mirko Matytschak - 08 May 2007 13:25 GMT
I would do exactly what you want to avoid: Writing directly into the vdproj
file. The format of the file is very easy to understand. We're doing this
for our automated builds and it works fine. All you need to know to use
Encoding.Default for the FileStreams. If you need a sample code, go to
http://www.netdataobjects.com/Portal/Support/EMailSupport/tabid/75/Default.aspx
and leave your EMail address together with a short notice. I'll send you a
solution with a few classes allowing you to manipulate Vdproj files.
Regards (mit Grüßen aus Miesbach)
Mirko