Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Wed, 13 Aug 2008 12:42:35 +0100,    group: microsoft.public.dotnet.framework        back       


Customising Setup Projects   
I posted this a few days ago in microsoft.public.dotnet.framework.setup but 
haven't had any response:

VS2008 Windows Forms
As part of the process of building my application setup program, I would
like to make some modifications to certain files. I can easily write the
code to do make the necessary changes given a list of filenames, but I'm
unsure of the best way to integrate this into my setup project solution. I
have had a quick look through the help files, and there seem to be several
options (addins, macros, post-build events, etc...) but I'm not sure the
best place to start. Any suggestions appreciated.
TIA
Phil.
date: Wed, 13 Aug 2008 12:42:35 +0100   author:   Phil N/A

Re: Customising Setup Projects   
On Aug 13, 3:42 pm, "Phil" <N/A> wrote:
> I posted this a few days ago in microsoft.public.dotnet.framework.setup but
> haven't had any response:
>
> VS2008 Windows Forms
> As part of the process of building my application setup program, I would
> like to make some modifications to certain files. I can easily write the
> code to do make the necessary changes given a list of filenames, but I'm
> unsure of the best way to integrate this into my setup project solution. I
> have had a quick look through the help files, and there seem to be several
> options (addins, macros, post-build events, etc...) but I'm not sure the
> best place to start. Any suggestions appreciated.

I'd do this as a part of build process, probably indeed as a post-
build event. So long as it integrates with MSBuild, it should be fine
- so that you can set up a dedicated build server without breaking
things. If your app will also report errors as errorlevel code, its
errors will be reported as build failures (which is what it should be,
if this step is necessary to get a working build).
date: Wed, 13 Aug 2008 04:58:14 -0700 (PDT)   author:   Pavel Minaev

Re: Customising Setup Projects   
>
> > VS2008 Windows Forms
> > As part of the process of building my application setup program, I would
> > like to make some modifications to certain files. I can easily write the
> > code to do make the necessary changes given a list of filenames, but I'm
> > unsure of the best way to integrate this into my setup project solution. 
> > I
> > have had a quick look through the help files, and there seem to be 
> > several
> > options (addins, macros, post-build events, etc...) but I'm not sure the
> > best place to start. Any suggestions appreciated.
>
> I'd do this as a part of build process, probably indeed as a post-
> build event. So long as it integrates with MSBuild, it should be fine
> - so that you can set up a dedicated build server without breaking
> things. If your app will also report errors as errorlevel code, its
> errors will be reported as build failures (which is what it should be,
> if this step is necessary to get a working build).

OK. Thanks. I was looking at custom tools, but it all looks really 
complicated.
I have managed to get something very simple working using a post build 
event, so I shall continue down this route.
As a test I have used a simple dos command to rename some content files in 
the project, and that seems to work. So what I need to do now I guess, is to 
write a console app to take the filenames as parameters and make the 
necessary changes to the files.
Thanks for the tip about reporting build errors. I'm not sure how to set the 
errorlevel code, but I'll have a search for this.

Thanks
Phil.
date: Wed, 13 Aug 2008 16:34:59 +0100   author:   Phil N/A

Re: Customising Setup Projects   
On Aug 13, 7:34 pm, "Phil" <N/A> wrote:
> > > VS2008 Windows Forms
> > > As part of the process of building my application setup program, I would
> > > like to make some modifications to certain files. I can easily write the
> > > code to do make the necessary changes given a list of filenames, but I'm
> > > unsure of the best way to integrate this into my setup project solution.
> > > I
> > > have had a quick look through the help files, and there seem to be
> > > several
> > > options (addins, macros, post-build events, etc...) but I'm not sure the
> > > best place to start. Any suggestions appreciated.
>
> > I'd do this as a part of build process, probably indeed as a post-
> > build event. So long as it integrates with MSBuild, it should be fine
> > - so that you can set up a dedicated build server without breaking
> > things. If your app will also report errors as errorlevel code, its
> > errors will be reported as build failures (which is what it should be,
> > if this step is necessary to get a working build).
>
> OK. Thanks. I was looking at custom tools, but it all looks really
> complicated.
> I have managed to get something very simple working using a post build
> event, so I shall continue down this route.
> As a test I have used a simple dos command to rename some content files in
> the project, and that seems to work. So what I need to do now I guess, is to
> write a console app to take the filenames as parameters and make the
> necessary changes to the files.
> Thanks for the tip about reporting build errors. I'm not sure how to set the
> errorlevel code, but I'll have a search for this.

If you declare your Main)( as returning int rather than void, then
whatever you return from it will be the error code.

Also, if you are going that route, then you might want to create a
custom MSBuild task rather than a console application. Here's some
info on that:

http://blogs.msdn.com/msbuild/archive/2006/01/21/515834.aspx
date: Wed, 13 Aug 2008 23:29:03 -0700 (PDT)   author:   Pavel Minaev

Re: Customising Setup Projects   
> If you declare your Main)( as returning int rather than void, then
> whatever you return from it will be the error code.

Thanks. It took a while, but I did manage to find this in the help files.
I'm coding in VB, so I had to change Sub Main() to Function Main() as 
Integer.

> Also, if you are going that route, then you might want to create a
> custom MSBuild task rather than a console application. Here's some
> info on that:
>
> http://blogs.msdn.com/msbuild/archive/2006/01/21/515834.aspx
>

OK. I've got my console app up and running now, and seems to be doing the 
job, but I'll take a look at this too.

Many thanks,
Phil.
date: Thu, 14 Aug 2008 10:32:28 +0100   author:   Phil N/A

Re: Customising Setup Projects   
Hi Phil,

Thank you for posting. And thanks for Pavel's answer. I totally agree with 
him that post build event is suitable to your requirement. Other than that, 
I have something to complement:

For how to customize your post build event, here is the instruction: 
http://msdn.microsoft.com/en-us/library/ke5z92ks.aspx
It also contains an example, I think you can follow it easily to build your 
custom tool.

For troubleshooting the error in the post build event, please check the 
guideline: http://msdn.microsoft.com/en-us/library/b0bktkzs.aspx
Although it is Visual C++ guideline, it has many common solutions to help 
you to troubleshoot. For example:
"              Add @echo on as the first command to see what your custom 
build step is actually doing. The build events and build steps are placed 
in a temporary .bat file and run when the project is built, so, you can add 
error checking to your build event or build step commands.
"              Run custom build steps and build events individually to 
check their behavior.

One thing I want to mention that VS puts these commands in a batch file and 
runs it. VS checks for build failures so it can tell you about them. 
However - it only checks for a failure of the batch file that it created - 
not for any failures within the batch file.
The solution for this limitation you can find it here: 
http://geekswithblogs.net/dchestnutt/archive/2006/05/30/80113.aspx
Check for error after every meaningful step and add code at the end to 
handle the error so VS will report it.

Hope it helps. Please let me know if you have any other concerns, or need 
anything else.

Regards,
Hongye Sun (hongyes@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 1 business day is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions or complex 
project analysis and dump analysis issues. Issues of this nature are best 
handled working with a dedicated Microsoft Support Engineer by contacting 
Microsoft Customer Support Services (CSS) at 
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
date: Thu, 14 Aug 2008 10:21:27 GMT   author:   (Hongye Sun [MSFT])

Re: Customising Setup Projects   
""Hongye Sun [MSFT]""  wrote in message
news:kRK54if$IHA.1688@TK2MSFTNGHUB02.phx.gbl...

>

Thanks for your response. I'd already figured most of this out for myself 
with Pavel's help. The problem with the error checking with multiple 
commands is certainly useful to know  about though, so thanks for that.
Note that I first posted this question in the 
microsoft.public.dotnet.framework.setup group but never got any reply. Is 
that not the most suitable group for this type of issue?

Thanks,
Phil.
date: Thu, 14 Aug 2008 13:34:53 +0100   author:   Phil N/A

Re: Customising Setup Projects   
On Aug 14, 4:34 pm, "Phil" <N/A> wrote:
> Note that I first posted this question in the
> microsoft.public.dotnet.framework.setup group but never got any reply. Is
> that not the most suitable group for this type of issue?

Not really, it's much simpler than that. Here are the Google Groups
stats for both newsgroups:

microsoft.public.dotnet.framework.setup
Language: English
150 subscribers, Messages per month: 15, Usenet

microsoft.public.dotnet.framework
Language: English
2869 subscribers, Messages per month: 412, Usenet
date: Thu, 14 Aug 2008 07:15:24 -0700 (PDT)   author:   Pavel Minaev

Re: Customising Setup Projects   
Hi Phil,

Thanks for your reply.

I think your question is ok to post in 
microsoft.public.dotnet.framework.setup, but if you're a MSDN subscriber, 
you might want to post in one of those MSDN Managed Newsgroups: 
http://msdn.microsoft.com/en-us/subscriptions/aa974230.aspx.

Regards,
Hongye Sun (hongyes@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and 
suggestions about how we can improve the support we provide to you. Please 
feel free to let my manager know what you think of the level of service 
provided. You can send feedback directly to my manager at: 
msdnmg@microsoft.com.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
date: Fri, 15 Aug 2008 03:06:53 GMT   author:   (Hongye Sun [MSFT])

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us