How to customize web.config?

Mike Fiore's picture

I've used Wise installation products for years for Windows programs, but am only now using WIS7 to install a Web appliation.



My application is built with Visual Studio 2008, and includes a Web.config file that I've customized a bit. I added this file to the Web Files page.



The problem is that I'm installing a virtual directory and WIS7 is adding its own web.config (all lower case) with the settings for the virtual directory.



When I install my applicaiton on a test system, my Web.config is not installed or is overwritten by the web.config that WIS7 adds, so the settings I need are not there. I can't figure out how to add my customizations from Web.config to the web.config WIS7 creates. I'm not even sure if I'd doing this correctly...the Help file isn't all that helpful.



If I try removing web.config, a message says it's necessary and if I delete it it will also remove the virtual directory.



Anybody...please...help me understand this.

EdT's picture

Does the section "To install Web Settings from a file" on Page 273 of the Windows Installer Editor PDF file not help?



The alternative would be to read in the web.config file at the start of your installation, and then restore the critical settings at the end of the install.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Uma's picture

Hi, I have the exact same

Hi,

I have the exact same problem. Wise Installation Studio 7.0 edits my customized web.config. This breaks the functionality that I have in my web.config. 

What is the best work around? Is editing the web.config(by removing the edits added by WIS 7) after it gets installed the only solution?

Thanks!

Uma-

AngelD's picture

KB Article: 41249

Does KB Article: 41249 help in any way?

https://kb.altiris.com/article.asp?article=41249&p=1

 

Uma's picture

Hi AngelD, I think this KB is

Hi AngelD,

I think this KB is not helping me. I am not seeing the "xmlns" string in the web.config.  So the workaround explained in this KB does not apply.

In my web.config, WIS 7 adds the following lines. Our functionality is breaking because of this:

<security>
<authentication>
<anonymousAuthentication enabled="true"/>
<basicAuthentication enabled="false"/>
<windowsAuthentication enabled="true"/>
<digestAuthentication enabled="false"/></authentication></security>
<directoryBrowse enabled="false"/>
<httpLogging dontLog="false"/>
<defaultDocument enabled="false"/>
<staticContent enableDocFooter="false" isDocFooterFileName="true">
<clientCache cacheControlMode="NoControl"/></staticContent>
<asp enableParentPaths="false" scriptLanguage="VBScript" bufferingOn="true">
<limits scriptTimeout="00:01:30"/>
<session allowSessionState="true" timeout="00:20:00"/></asp></system.webServer>

 

Thanks!

Uma-

 

 

kdarty's picture

Similar Problems Here

I ran into similar problems with WIS7 SP1.

The first time I used WIS7 to create a Web Site Install, it read in the files, determined I had several ASP.NET Web Sites and created new Web.config files within the same folder as the .wsi file.

As you said Mike, these Web.config files only consisted only of Web Server Settings and not my customized Web.config.

After scratching my head for a bit I simply copied in the contents of my own Config files and continued working.

The next problem I had was that the "Add New Virtual Directory" Dialog by default will create a sub-folder as the "root" of your new Virtual Directory.

This won't work as none of your web files are there.

The only thing it installs here is the Web.config.

Very odd and very frustrating.

I had a lot of problems with this Install Script and it eventually got corrupted beyond repair.

I think it got corrupted because WIS7 SP1 for some reason keeps losing Files in your Installation and asks to remove them. The other problem I believe is the fact that I changed the names of some Features and I don't think WIS7 cleaned up the Windows Installer Tables correctly.

But back to the VD and Config file problem.

After completely hosing my Install Script I decided to screen shot and take notes of everything important and start over.

This time WIS7 recognized my Web.config Files in their exact locations and all was good.

I'm not sure if this initially was a problem with WIS7 or the fact that I was leaving the "optional" sub-folder listed when creating my Virtual Directory.

By the way, when you create a Virtual Directory in WIS7 the dialog has a Field Entry and below that is a Directory/Path Selector but right next to that is another Field that gets filled in automatically for you.  While the Dialog doesn't tell you this, this Field is completely optional and if used will create a New Sub-Folder within your Web Site Folder Structure and set the Virtual Directory Path to that location.

Very weird.

Check your Install Script to verify if this is causing you the problem.

I should warn you that going in and removing this "optional" sub-folder from the Virtual Directory settings can be done via the "Details" screen, however, after doing this, WIS7 will ask "do you want to move your files to the new location".

This sounds really bizarre but if you are setting the correct "Home Directory" to where your Feature/Files are installed then there is nothing to move... except that Web.config.

Just be mindful of that and whatch what you are doing.