Modify AppSettings during Install

N

Neelima Godugu

Hi All,
Is there a way to modify AppSettings key values during installation of a web
app using a web setup project.

Thanks in advance.
Neelima
 
C

Cowboy

Yes, through a custom installer. Unfortunately, I do not know of any great
source for the information on building a custom installer component. You
basically grab the file, as XML, prior to deploying. If you run this after
the install, the file gets locked.

Another option is to incorporate the Configuration Management Application
Block (free download, full source) from MSDN:

download =
http://www.microsoft.com/downloads/...53-8CA7-4A92-85E3-E4795BD27FEB&displaylang=en

info =
http://msdn.microsoft.com/library/en-us/dnbda/html/cmab.asp?_r=1


With custom configuration, you create additional config files that can be
set at any time (a way around the web.config lock from application code). In
addition, you can add the DPAPI (data protection API) to encrypt the
information; the DPAPI is already coded into the Block, so you basically
tell it to encrypt and it encrypts. Very easy to use once you get used to
it.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
R

Rick Strahl [MVP]

There's no automatic way to do this. You can copy a Web.config of course,
but customizing it is not directly supported.

You can do this with a custom action from you install, but what I prefer to
do is have the application start and automatically run a configuration page
the first time it runs. The app can even do this by checkign for some
setting in the configuration. if not found you can redirect to the config
page.

On the other hand this requires that the ASP.Net app can write to the
directory or at least web.config.

+++ Rick ---
--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
http://www.west-wind.com/articles.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top