cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sasikumar
Level 4

InstallShield removes namespace from web.config file in InstallScript project

Jump to solution

Hi,

I have a weird issue like web.config is changed after installation using InstallScript project.

In web.config, I have the nwebsec section like below before installation

 <nwebsec>
    <httpHeaderSecurityModule xsi:noNamespaceSchemaLocation="NWebsecConfig/HttpHeaderSecurityModuleConfig.xsd" xmlns="http://nwebsec.com/HttpHeaderSecurityModuleConfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <x-Robots-Tag enabled="true" noIndex="true" noFollow="true" />
      <securityHttpHeaders>
        <x-XSS-Protection policy="FilterEnabled" blockMode="true" />
        <x-Frame-Options policy="Deny" />
        <x-Content-Type-Options enabled="true" />
        <referrer-Policy enabled="true" policy="origin-when-cross-origin" />
        <content-Security-Policy enabled="true">
          <default-src self="true" />
          <script-src self="true" unsafeInline="true" unsafeEval="true" />
          <style-src self="true" unsafeInline="true" />
          <img-src self="true">
            <add source="data:" />
          </img-src>
        </content-Security-Policy>
      </securityHttpHeaders>
    </httpHeaderSecurityModule>
  </nwebsec>

 After Installing, it was omitting xsi:  and have only noNamespaceSchemaLocation like below

<nwebsec>
		<httpHeaderSecurityModule noNamespaceSchemaLocation="NWebsecConfig/HttpHeaderSecurityModuleConfig.xsd" xmlns="http://nwebsec.com/HttpHeaderSecurityModuleConfig.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
			<x-Robots-Tag enabled="true" noIndex="true" noFollow="true"></x-Robots-Tag>
			<securityHttpHeaders>
				<x-XSS-Protection policy="FilterEnabled" blockMode="true"></x-XSS-Protection>
				<x-Frame-Options policy="Deny"></x-Frame-Options>
				<x-Content-Type-Options enabled="true"></x-Content-Type-Options>
				<referrer-Policy enabled="true" policy="origin-when-cross-origin"></referrer-Policy>
				<content-Security-Policy enabled="true">
					<default-src self="true"></default-src>
					<script-src self="true" unsafeInline="true" unsafeEval="true"></script-src>
					<style-src self="true" unsafeInline="true"></style-src>
					<img-src self="true">
						<add source="data:"></add>
					</img-src>
				</content-Security-Policy>
			</securityHttpHeaders>
		</httpHeaderSecurityModule>
	</nwebsec>

 Can anyone give the suggestion or way to stop these changes?

***we faced the same issue with InstallScript MSI project.  we changed using Text File changes in System Configuration. but Installscript project is not having that section. 

Thanks in advance

with regards,

Sasikumar.A

Labels (1)
0 Kudos
(2) Solutions

Hi @sasikumar ,

To answer to your followup question:

" Can you give one example and how it will be changing in web.config file?"

I had attached sample .rul file which you can refer.

For your actual issue,I would need few more details to assist you with:

  • What is the web.config you refer here?Is it the one from "C:\inetpub\wwwroot\web.config"?
  • What is the scenario it is removing those tags, just installing the setup?Or any specific custom action/settings are you trying to add?

If possible can you give InstallShield project file with supported files as an attachments?If you dont want to share in public forum,feel free to send it via private messaging feature.

 

Thanks,

Jenifer

View solution in original post

Hi @Jenifer ,

Please find the reply below.

1, What is the web.config you refer here?Is it the one from "C:\inetpub\wwwroot\web.config"?

 Answer: yes in IIS folder with the Application name. Application will be installed in C:\inetpub\wwwroot\ApplicationName\web.config"

2, What is the scenario it is removing those tags, just installing the setup? Or any specific custom action/settings are you trying to add?

Answer: yes it's removing the tag while installing the setup.

Please find attached web.config file thanks

with regards 

Sasikumar.A

View solution in original post

0 Kudos
(6) Replies
Jenifer
Flexera Alumni

Hi @sasikumar ,

 

How about using string functions to replace and modify text in InstallScript projects which would be similar to Text File Changes in InstallScript MSI Project?

 

Link to refer:https://helpnet.flexerasoftware.com/installshield19helplib/helplibrary/TextFileChanges-SrchRplc.htm

 

Thanks,

Jenifer

Hi @Jenifer ,

Thank you for your reply.  I saw that Link already. Can you give one example and how it will be changing in web.config file? Thanks

 

with regards,

Sasikumar.A

Hi @sasikumar ,

To answer to your followup question:

" Can you give one example and how it will be changing in web.config file?"

I had attached sample .rul file which you can refer.

For your actual issue,I would need few more details to assist you with:

  • What is the web.config you refer here?Is it the one from "C:\inetpub\wwwroot\web.config"?
  • What is the scenario it is removing those tags, just installing the setup?Or any specific custom action/settings are you trying to add?

If possible can you give InstallShield project file with supported files as an attachments?If you dont want to share in public forum,feel free to send it via private messaging feature.

 

Thanks,

Jenifer

Hi @Jenifer ,

Please find the reply below.

1, What is the web.config you refer here?Is it the one from "C:\inetpub\wwwroot\web.config"?

 Answer: yes in IIS folder with the Application name. Application will be installed in C:\inetpub\wwwroot\ApplicationName\web.config"

2, What is the scenario it is removing those tags, just installing the setup? Or any specific custom action/settings are you trying to add?

Answer: yes it's removing the tag while installing the setup.

Please find attached web.config file thanks

with regards 

Sasikumar.A

0 Kudos

Hi @sasikumar ,

 

I had added the web.config file you had sent as file component that has INSTALLDIR of <IISROOTFOLDER>\<FLEXFLOWINSTANCEID>.As well i had commented OnSQLServerInitialize function.With which it seems to working fine i.e not removing xsi specifically.Is that something from OnSQLServerInitialize function making it to be removed?

0 Kudos

Hi @Jenifer ,

Thanks a lot, for your help.  I have customized your string replace file for my required and it was working.

Good sharing and it will help most of the Installscript project developer. Thanks

with regards,

Sasikumar.A

 

0 Kudos