Setting a value XmlConfig

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting a value XmlConfig

Natalie Carr
Hi I am trying to change a value setting in a config file using the
following:

    <Component Id="Enable32BitAppPoolComponent" Guid="*"
Directory="INSTALLLOCATION">

        <CreateFolder/>

        <util:XmlConfig Id="Enable32BitAppPool" Node="value"

 
ElementPath="//configuration/system.applicationHost/applicationPools/add[\[]
@name='DefaultAppPool'[\]]/@enable32BitAppOnWin64"

                      File="[inetsrv]\config\applicationHost.config"

                      Value="true" On="install"/>

    </Component>

This code does not change the value in the applicationHost.config file. I
tried adding the action="create" but I then got the error during the setup
that it could not open the XML file. What am I doing wrong?

 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting a value XmlConfig

John Cooper-2
1) I assume you have previously obtained permissions to the IIS [7-8] applicationHost.config file.  Not just anybody can write to it.

2) It looks like you're creating an AppPool the hard way.  One of the things the IIS Extension does really well is create AppPools.  I would use the IIS Extension unless there's a compelling reason not to.

3) here's how I use util:XmlConfig:

&lt;util:XmlConfig Id="DeleteErrorSinkSinks" Action="delete" ElementPath="/logging/categories/error" File="[#FileEnterpriseLoggingConfig]" Node="element" On="install" Sequence="10" VerifyPath="/logging/categories/error/sinks" /&gt;
&lt;util:XmlConfig Id="WriteErrorSink" Action="create" ElementPath="/logging/categories/error" File="[#FileEnterpriseLoggingConfig]" Node="document" On="install" Sequence="11" Value="[ERROR_INNERTEXT]" /&gt;

--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: Wednesday, August 28, 2013 5:16 AM
To: [hidden email]
Subject: [WiX-users] Setting a value XmlConfig

Hi I am trying to change a value setting in a config file using the
following:

    <Component Id="Enable32BitAppPoolComponent" Guid="*"
Directory="INSTALLLOCATION">

        <CreateFolder/>

        <util:XmlConfig Id="Enable32BitAppPool" Node="value"

 
ElementPath="//configuration/system.applicationHost/applicationPools/add[\[]
@name='DefaultAppPool'[\]]/@enable32BitAppOnWin64"

                      File="[inetsrv]\config\applicationHost.config"

                      Value="true" On="install"/>

    </Component>

This code does not change the value in the applicationHost.config file. I tried adding the action="create" but I then got the error during the setup that it could not open the XML file. What am I doing wrong?

 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are intended
exclusively for the individual or entity to which it is addressed. The message,
together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution
is strictly prohibited. If you have received this message in error, please
immediately advise the sender by reply email and delete all copies.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting a value XmlConfig

Natalie Carr
Hi John,

I haven't done anything regarding permissions, although I am writing to it
on a different component and that seems to be working.

I am not trying to create a AppPool as I am using the default, I am just
trying to change the enable32BitAppOnWin64 from false to true.

Thanks

-----Original Message-----
From: John Cooper [mailto:[hidden email]]
Sent: 28 August 2013 14:19
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

1) I assume you have previously obtained permissions to the IIS [7-8]
applicationHost.config file.  Not just anybody can write to it.

2) It looks like you're creating an AppPool the hard way.  One of the things
the IIS Extension does really well is create AppPools.  I would use the IIS
Extension unless there's a compelling reason not to.

3) here's how I use util:XmlConfig:

&lt;util:XmlConfig Id="DeleteErrorSinkSinks" Action="delete"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="element" On="install"
Sequence="10" VerifyPath="/logging/categories/error/sinks" /&gt;
&lt;util:XmlConfig Id="WriteErrorSink" Action="create"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="document" On="install"
Sequence="11" Value="[ERROR_INNERTEXT]" /&gt;

--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: Wednesday, August 28, 2013 5:16 AM
To: [hidden email]
Subject: [WiX-users] Setting a value XmlConfig

Hi I am trying to change a value setting in a config file using the
following:

    <Component Id="Enable32BitAppPoolComponent" Guid="*"
Directory="INSTALLLOCATION">

        <CreateFolder/>

        <util:XmlConfig Id="Enable32BitAppPool" Node="value"

 
ElementPath="//configuration/system.applicationHost/applicationPools/add[\[]
@name='DefaultAppPool'[\]]/@enable32BitAppOnWin64"

                      File="[inetsrv]\config\applicationHost.config"

                      Value="true" On="install"/>

    </Component>

This code does not change the value in the applicationHost.config file. I
tried adding the action="create" but I then got the error during the setup
that it could not open the XML file. What am I doing wrong?

 

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are
intended exclusively for the individual or entity to which it is addressed.
The message, together with any attachment, may contain confidential and/or
privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or
distribution is strictly prohibited. If you have received this message in
error, please immediately advise the sender by reply email and delete all
copies.


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting a value XmlConfig

John Cooper-2
That just depends on the bitness of the component creating the AppPool.  Win64="yes" for enable32BitAppOnWin64 'false' and Win64="no" for enable32BitAppOnWin64 'true'.  Of course, you need to create the AppPool for this to work.

We always install and create a new AppPool for our web services.  We don't install anything into the default AppPool in part because we don't want to muck with settings that might affect other applications.

--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: Wednesday, August 28, 2013 8:41 AM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Setting a value XmlConfig

Hi John,

I haven't done anything regarding permissions, although I am writing to it on a different component and that seems to be working.

I am not trying to create a AppPool as I am using the default, I am just trying to change the enable32BitAppOnWin64 from false to true.

Thanks

-----Original Message-----
From: John Cooper [mailto:[hidden email]]
Sent: 28 August 2013 14:19
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

1) I assume you have previously obtained permissions to the IIS [7-8] applicationHost.config file.  Not just anybody can write to it.

2) It looks like you're creating an AppPool the hard way.  One of the things the IIS Extension does really well is create AppPools.  I would use the IIS Extension unless there's a compelling reason not to.

3) here's how I use util:XmlConfig:

&lt;util:XmlConfig Id="DeleteErrorSinkSinks" Action="delete"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="element" On="install"
Sequence="10" VerifyPath="/logging/categories/error/sinks" /&gt; &lt;util:XmlConfig Id="WriteErrorSink" Action="create"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="document" On="install"
Sequence="11" Value="[ERROR_INNERTEXT]" /&gt;

--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: Wednesday, August 28, 2013 5:16 AM
To: [hidden email]
Subject: [WiX-users] Setting a value XmlConfig

Hi I am trying to change a value setting in a config file using the
following:

    <Component Id="Enable32BitAppPoolComponent" Guid="*"
Directory="INSTALLLOCATION">

        <CreateFolder/>

        <util:XmlConfig Id="Enable32BitAppPool" Node="value"

 
ElementPath="//configuration/system.applicationHost/applicationPools/add[\[]
@name='DefaultAppPool'[\]]/@enable32BitAppOnWin64"

                      File="[inetsrv]\config\applicationHost.config"

                      Value="true" On="install"/>

    </Component>

This code does not change the value in the applicationHost.config file. I tried adding the action="create" but I then got the error during the setup that it could not open the XML file. What am I doing wrong?

 

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed.
The message, together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies.


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are intended
exclusively for the individual or entity to which it is addressed. The message,
together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution
is strictly prohibited. If you have received this message in error, please
immediately advise the sender by reply email and delete all copies.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting a value XmlConfig

Steve-Ogilvie
In reply to this post by Natalie Carr
I am using a custom action for that (I set mine to false) however after our product was released I saw this post:

http://stackoverflow.com/questions/11687870/wix-installer-always-changes-apppool-to-enable-32bit-app

below is my custom action just in case...

[CustomAction]
        public static ActionResult Enable32BitApplicationPool(Session session)
        {
            try
            {
                if (session == null)
                {
                    throw new ArgumentNullException("session");
                }

                var tempString = GetSessionProperty(session, "CustomActionData", false);
                var parts = tempString.Split(new[] { '|' });
                var applicationPool = parts[0];
                const string Quote = "\"";
                var cmdLineParameters = "set apppool /apppool.name:" + Quote + applicationPool + Quote + " /enable32BitAppOnWin64:false";

                var cmdLineExe = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "inetsrv\\appcmd.exe");

                // Prepare the process to run
                var startInfo = new ProcessStartInfo
                {
                    UseShellExecute = true,
                    Arguments = cmdLineParameters,
                    FileName = cmdLineExe,
                    WindowStyle = ProcessWindowStyle.Hidden,
                    CreateNoWindow = true
                };

                // Run the external process & wait for it to finish
                using (Process proc = Process.Start(startInfo))
                {
                    proc.WaitForExit();
                }
            }
            catch (Exception ex)
            {
                WriteErrorLogInstall(session, "Enable32BitApplicationPool failed: ", ex, true);
            }

            return ActionResult.Success;
        }

-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: August-28-13 9:41 AM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Setting a value XmlConfig

Hi John,

I haven't done anything regarding permissions, although I am writing to it on a different component and that seems to be working.

I am not trying to create a AppPool as I am using the default, I am just trying to change the enable32BitAppOnWin64 from false to true.

Thanks

-----Original Message-----
From: John Cooper [mailto:[hidden email]]
Sent: 28 August 2013 14:19
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

1) I assume you have previously obtained permissions to the IIS [7-8] applicationHost.config file.  Not just anybody can write to it.

2) It looks like you're creating an AppPool the hard way.  One of the things the IIS Extension does really well is create AppPools.  I would use the IIS Extension unless there's a compelling reason not to.

3) here's how I use util:XmlConfig:

&lt;util:XmlConfig Id="DeleteErrorSinkSinks" Action="delete"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="element" On="install"
Sequence="10" VerifyPath="/logging/categories/error/sinks" /&gt; &lt;util:XmlConfig Id="WriteErrorSink" Action="create"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="document" On="install"
Sequence="11" Value="[ERROR_INNERTEXT]" /&gt;

--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: Wednesday, August 28, 2013 5:16 AM
To: [hidden email]
Subject: [WiX-users] Setting a value XmlConfig

Hi I am trying to change a value setting in a config file using the
following:

    <Component Id="Enable32BitAppPoolComponent" Guid="*"
Directory="INSTALLLOCATION">

        <CreateFolder/>

        <util:XmlConfig Id="Enable32BitAppPool" Node="value"

 
ElementPath="//configuration/system.applicationHost/applicationPools/add[\[]
@name='DefaultAppPool'[\]]/@enable32BitAppOnWin64"

                      File="[inetsrv]\config\applicationHost.config"

                      Value="true" On="install"/>

    </Component>

This code does not change the value in the applicationHost.config file. I tried adding the action="create" but I then got the error during the setup that it could not open the XML file. What am I doing wrong?

 

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed.
The message, together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies.


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting a value XmlConfig

Natalie Carr
Steven,

Thanks I was using that but decided to try a different approach. Just a
quick question as appcmd is not available on iis 6 do you use another method
or do you not support it?

Thanks
Natalie

-----Original Message-----
From: Steven Ogilvie [mailto:[hidden email]]
Sent: 28 August 2013 14:56
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

I am using a custom action for that (I set mine to false) however after our
product was released I saw this post:

http://stackoverflow.com/questions/11687870/wix-installer-always-changes-app
pool-to-enable-32bit-app

below is my custom action just in case...

[CustomAction]
        public static ActionResult Enable32BitApplicationPool(Session
session)
        {
            try
            {
                if (session == null)
                {
                    throw new ArgumentNullException("session");
                }

                var tempString = GetSessionProperty(session,
"CustomActionData", false);
                var parts = tempString.Split(new[] { '|' });
                var applicationPool = parts[0];
                const string Quote = "\"";
                var cmdLineParameters = "set apppool /apppool.name:" + Quote
+ applicationPool + Quote + " /enable32BitAppOnWin64:false";

                var cmdLineExe =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),
"inetsrv\\appcmd.exe");

                // Prepare the process to run
                var startInfo = new ProcessStartInfo
                {
                    UseShellExecute = true,
                    Arguments = cmdLineParameters,
                    FileName = cmdLineExe,
                    WindowStyle = ProcessWindowStyle.Hidden,
                    CreateNoWindow = true
                };

                // Run the external process & wait for it to finish
                using (Process proc = Process.Start(startInfo))
                {
                    proc.WaitForExit();
                }
            }
            catch (Exception ex)
            {
                WriteErrorLogInstall(session, "Enable32BitApplicationPool
failed: ", ex, true);
            }

            return ActionResult.Success;
        }

-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: August-28-13 9:41 AM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Setting a value XmlConfig

Hi John,

I haven't done anything regarding permissions, although I am writing to it
on a different component and that seems to be working.

I am not trying to create a AppPool as I am using the default, I am just
trying to change the enable32BitAppOnWin64 from false to true.

Thanks

-----Original Message-----
From: John Cooper [mailto:[hidden email]]
Sent: 28 August 2013 14:19
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

1) I assume you have previously obtained permissions to the IIS [7-8]
applicationHost.config file.  Not just anybody can write to it.

2) It looks like you're creating an AppPool the hard way.  One of the things
the IIS Extension does really well is create AppPools.  I would use the IIS
Extension unless there's a compelling reason not to.

3) here's how I use util:XmlConfig:

&lt;util:XmlConfig Id="DeleteErrorSinkSinks" Action="delete"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="element" On="install"
Sequence="10" VerifyPath="/logging/categories/error/sinks" /&gt;
&lt;util:XmlConfig Id="WriteErrorSink" Action="create"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="document" On="install"
Sequence="11" Value="[ERROR_INNERTEXT]" /&gt;

--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: Wednesday, August 28, 2013 5:16 AM
To: [hidden email]
Subject: [WiX-users] Setting a value XmlConfig

Hi I am trying to change a value setting in a config file using the
following:

    <Component Id="Enable32BitAppPoolComponent" Guid="*"
Directory="INSTALLLOCATION">

        <CreateFolder/>

        <util:XmlConfig Id="Enable32BitAppPool" Node="value"

 
ElementPath="//configuration/system.applicationHost/applicationPools/add[\[]
@name='DefaultAppPool'[\]]/@enable32BitAppOnWin64"

                      File="[inetsrv]\config\applicationHost.config"

                      Value="true" On="install"/>

    </Component>

This code does not change the value in the applicationHost.config file. I
tried adding the action="create" but I then got the error during the setup
that it could not open the XML file. What am I doing wrong?

 

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are
intended exclusively for the individual or entity to which it is addressed.
The message, together with any attachment, may contain confidential and/or
privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or
distribution is strictly prohibited. If you have received this message in
error, please immediately advise the sender by reply email and delete all
copies.


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting a value XmlConfig

Natalie Carr
In reply to this post by Steve-Ogilvie
Steven,

Just to show you how I done it within WiX: :)

                <CustomAction Id="Enable32BitAppPool_Cmd"
Property="Enable32BitAppPool"
Value="&quot;[SystemFolder]inetsrv\appcmd&quot; set apppool
/apppool.name:&quot;Map_Pool&quot; /enable32BitAppOnWin64:true"
Execute="immediate"/>
                <CustomAction Id="Enable32BitAppPool" BinaryKey="WixCA"
DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>


-----Original Message-----
From: Steven Ogilvie [mailto:[hidden email]]
Sent: 28 August 2013 14:56
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

I am using a custom action for that (I set mine to false) however after our
product was released I saw this post:

http://stackoverflow.com/questions/11687870/wix-installer-always-changes-app
pool-to-enable-32bit-app

below is my custom action just in case...

[CustomAction]
        public static ActionResult Enable32BitApplicationPool(Session
session)
        {
            try
            {
                if (session == null)
                {
                    throw new ArgumentNullException("session");
                }

                var tempString = GetSessionProperty(session,
"CustomActionData", false);
                var parts = tempString.Split(new[] { '|' });
                var applicationPool = parts[0];
                const string Quote = "\"";
                var cmdLineParameters = "set apppool /apppool.name:" + Quote
+ applicationPool + Quote + " /enable32BitAppOnWin64:false";

                var cmdLineExe =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),
"inetsrv\\appcmd.exe");

                // Prepare the process to run
                var startInfo = new ProcessStartInfo
                {
                    UseShellExecute = true,
                    Arguments = cmdLineParameters,
                    FileName = cmdLineExe,
                    WindowStyle = ProcessWindowStyle.Hidden,
                    CreateNoWindow = true
                };

                // Run the external process & wait for it to finish
                using (Process proc = Process.Start(startInfo))
                {
                    proc.WaitForExit();
                }
            }
            catch (Exception ex)
            {
                WriteErrorLogInstall(session, "Enable32BitApplicationPool
failed: ", ex, true);
            }

            return ActionResult.Success;
        }

-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: August-28-13 9:41 AM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Setting a value XmlConfig

Hi John,

I haven't done anything regarding permissions, although I am writing to it
on a different component and that seems to be working.

I am not trying to create a AppPool as I am using the default, I am just
trying to change the enable32BitAppOnWin64 from false to true.

Thanks

-----Original Message-----
From: John Cooper [mailto:[hidden email]]
Sent: 28 August 2013 14:19
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

1) I assume you have previously obtained permissions to the IIS [7-8]
applicationHost.config file.  Not just anybody can write to it.

2) It looks like you're creating an AppPool the hard way.  One of the things
the IIS Extension does really well is create AppPools.  I would use the IIS
Extension unless there's a compelling reason not to.

3) here's how I use util:XmlConfig:

&lt;util:XmlConfig Id="DeleteErrorSinkSinks" Action="delete"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="element" On="install"
Sequence="10" VerifyPath="/logging/categories/error/sinks" /&gt;
&lt;util:XmlConfig Id="WriteErrorSink" Action="create"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="document" On="install"
Sequence="11" Value="[ERROR_INNERTEXT]" /&gt;

--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: Wednesday, August 28, 2013 5:16 AM
To: [hidden email]
Subject: [WiX-users] Setting a value XmlConfig

Hi I am trying to change a value setting in a config file using the
following:

    <Component Id="Enable32BitAppPoolComponent" Guid="*"
Directory="INSTALLLOCATION">

        <CreateFolder/>

        <util:XmlConfig Id="Enable32BitAppPool" Node="value"

 
ElementPath="//configuration/system.applicationHost/applicationPools/add[\[]
@name='DefaultAppPool'[\]]/@enable32BitAppOnWin64"

                      File="[inetsrv]\config\applicationHost.config"

                      Value="true" On="install"/>

    </Component>

This code does not change the value in the applicationHost.config file. I
tried adding the action="create" but I then got the error during the setup
that it could not open the XML file. What am I doing wrong?

 

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are
intended exclusively for the individual or entity to which it is addressed.
The message, together with any attachment, may contain confidential and/or
privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or
distribution is strictly prohibited. If you have received this message in
error, please immediately advise the sender by reply email and delete all
copies.


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting a value XmlConfig

John Cooper-2
In reply to this post by Steve-Ogilvie
Yes, I've used AppCmd (mostly for auto start and non-HTTP protocol setup).   I would recommend AppCmd before I would recommend direct hacking of the IIS config files.  You'll need special permissions on those files before you even attempt the write, and you'll have to contend with IIS unpredictably taking exclusive locks on those files.

--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Steven Ogilvie [mailto:[hidden email]]
Sent: Wednesday, August 28, 2013 8:56 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

I am using a custom action for that (I set mine to false) however after our product was released I saw this post:

http://stackoverflow.com/questions/11687870/wix-installer-always-changes-apppool-to-enable-32bit-app

below is my custom action just in case...

[CustomAction]
        public static ActionResult Enable32BitApplicationPool(Session session)
        {
            try
            {
                if (session == null)
                {
                    throw new ArgumentNullException("session");
                }

                var tempString = GetSessionProperty(session, "CustomActionData", false);
                var parts = tempString.Split(new[] { '|' });
                var applicationPool = parts[0];
                const string Quote = "\"";
                var cmdLineParameters = "set apppool /apppool.name:" + Quote + applicationPool + Quote + " /enable32BitAppOnWin64:false";

                var cmdLineExe = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "inetsrv\\appcmd.exe");

                // Prepare the process to run
                var startInfo = new ProcessStartInfo
                {
                    UseShellExecute = true,
                    Arguments = cmdLineParameters,
                    FileName = cmdLineExe,
                    WindowStyle = ProcessWindowStyle.Hidden,
                    CreateNoWindow = true
                };

                // Run the external process & wait for it to finish
                using (Process proc = Process.Start(startInfo))
                {
                    proc.WaitForExit();
                }
            }
            catch (Exception ex)
            {
                WriteErrorLogInstall(session, "Enable32BitApplicationPool failed: ", ex, true);
            }

            return ActionResult.Success;
        }

-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: August-28-13 9:41 AM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Setting a value XmlConfig

Hi John,

I haven't done anything regarding permissions, although I am writing to it on a different component and that seems to be working.

I am not trying to create a AppPool as I am using the default, I am just trying to change the enable32BitAppOnWin64 from false to true.

Thanks

-----Original Message-----
From: John Cooper [mailto:[hidden email]]
Sent: 28 August 2013 14:19
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

1) I assume you have previously obtained permissions to the IIS [7-8] applicationHost.config file.  Not just anybody can write to it.

2) It looks like you're creating an AppPool the hard way.  One of the things the IIS Extension does really well is create AppPools.  I would use the IIS Extension unless there's a compelling reason not to.

3) here's how I use util:XmlConfig:

&lt;util:XmlConfig Id="DeleteErrorSinkSinks" Action="delete"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="element" On="install"
Sequence="10" VerifyPath="/logging/categories/error/sinks" /&gt; &lt;util:XmlConfig Id="WriteErrorSink" Action="create"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="document" On="install"
Sequence="11" Value="[ERROR_INNERTEXT]" /&gt;

--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: Wednesday, August 28, 2013 5:16 AM
To: [hidden email]
Subject: [WiX-users] Setting a value XmlConfig

Hi I am trying to change a value setting in a config file using the
following:

    <Component Id="Enable32BitAppPoolComponent" Guid="*"
Directory="INSTALLLOCATION">

        <CreateFolder/>

        <util:XmlConfig Id="Enable32BitAppPool" Node="value"

 
ElementPath="//configuration/system.applicationHost/applicationPools/add[\[]
@name='DefaultAppPool'[\]]/@enable32BitAppOnWin64"

                      File="[inetsrv]\config\applicationHost.config"

                      Value="true" On="install"/>

    </Component>

This code does not change the value in the applicationHost.config file. I tried adding the action="create" but I then got the error during the setup that it could not open the XML file. What am I doing wrong?

 

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed.
The message, together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies.


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are intended
exclusively for the individual or entity to which it is addressed. The message,
together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution
is strictly prohibited. If you have received this message in error, please
immediately advise the sender by reply email and delete all copies.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting a value XmlConfig

Steve-Ogilvie
In reply to this post by Natalie Carr
We support 7.5 and up

-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: August-28-13 10:11 AM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Setting a value XmlConfig

Steven,

Thanks I was using that but decided to try a different approach. Just a quick question as appcmd is not available on iis 6 do you use another method or do you not support it?

Thanks
Natalie

-----Original Message-----
From: Steven Ogilvie [mailto:[hidden email]]
Sent: 28 August 2013 14:56
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

I am using a custom action for that (I set mine to false) however after our product was released I saw this post:

http://stackoverflow.com/questions/11687870/wix-installer-always-changes-app
pool-to-enable-32bit-app

below is my custom action just in case...

[CustomAction]
        public static ActionResult Enable32BitApplicationPool(Session
session)
        {
            try
            {
                if (session == null)
                {
                    throw new ArgumentNullException("session");
                }

                var tempString = GetSessionProperty(session, "CustomActionData", false);
                var parts = tempString.Split(new[] { '|' });
                var applicationPool = parts[0];
                const string Quote = "\"";
                var cmdLineParameters = "set apppool /apppool.name:" + Quote
+ applicationPool + Quote + " /enable32BitAppOnWin64:false";

                var cmdLineExe =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),
"inetsrv\\appcmd.exe");

                // Prepare the process to run
                var startInfo = new ProcessStartInfo
                {
                    UseShellExecute = true,
                    Arguments = cmdLineParameters,
                    FileName = cmdLineExe,
                    WindowStyle = ProcessWindowStyle.Hidden,
                    CreateNoWindow = true
                };

                // Run the external process & wait for it to finish
                using (Process proc = Process.Start(startInfo))
                {
                    proc.WaitForExit();
                }
            }
            catch (Exception ex)
            {
                WriteErrorLogInstall(session, "Enable32BitApplicationPool
failed: ", ex, true);
            }

            return ActionResult.Success;
        }

-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: August-28-13 9:41 AM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Setting a value XmlConfig

Hi John,

I haven't done anything regarding permissions, although I am writing to it on a different component and that seems to be working.

I am not trying to create a AppPool as I am using the default, I am just trying to change the enable32BitAppOnWin64 from false to true.

Thanks

-----Original Message-----
From: John Cooper [mailto:[hidden email]]
Sent: 28 August 2013 14:19
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

1) I assume you have previously obtained permissions to the IIS [7-8] applicationHost.config file.  Not just anybody can write to it.

2) It looks like you're creating an AppPool the hard way.  One of the things the IIS Extension does really well is create AppPools.  I would use the IIS Extension unless there's a compelling reason not to.

3) here's how I use util:XmlConfig:

&lt;util:XmlConfig Id="DeleteErrorSinkSinks" Action="delete"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="element" On="install"
Sequence="10" VerifyPath="/logging/categories/error/sinks" /&gt; &lt;util:XmlConfig Id="WriteErrorSink" Action="create"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="document" On="install"
Sequence="11" Value="[ERROR_INNERTEXT]" /&gt;

--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: Wednesday, August 28, 2013 5:16 AM
To: [hidden email]
Subject: [WiX-users] Setting a value XmlConfig

Hi I am trying to change a value setting in a config file using the
following:

    <Component Id="Enable32BitAppPoolComponent" Guid="*"
Directory="INSTALLLOCATION">

        <CreateFolder/>

        <util:XmlConfig Id="Enable32BitAppPool" Node="value"

 
ElementPath="//configuration/system.applicationHost/applicationPools/add[\[]
@name='DefaultAppPool'[\]]/@enable32BitAppOnWin64"

                      File="[inetsrv]\config\applicationHost.config"

                      Value="true" On="install"/>

    </Component>

This code does not change the value in the applicationHost.config file. I tried adding the action="create" but I then got the error during the setup that it could not open the XML file. What am I doing wrong?

 

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed.
The message, together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies.


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Reply | Threaded
Open this post in threaded view
|

Re: Setting a value XmlConfig

Steve-Ogilvie
In reply to this post by Natalie Carr
Nice maybe I will switch it to the WIX instead of custom action dll

-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: August-28-13 10:14 AM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Setting a value XmlConfig

Steven,

Just to show you how I done it within WiX: :)

                <CustomAction Id="Enable32BitAppPool_Cmd"
Property="Enable32BitAppPool"
Value="&quot;[SystemFolder]inetsrv\appcmd&quot; set apppool /apppool.name:&quot;Map_Pool&quot; /enable32BitAppOnWin64:true"
Execute="immediate"/>
                <CustomAction Id="Enable32BitAppPool" BinaryKey="WixCA"
DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no"/>


-----Original Message-----
From: Steven Ogilvie [mailto:[hidden email]]
Sent: 28 August 2013 14:56
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

I am using a custom action for that (I set mine to false) however after our product was released I saw this post:

http://stackoverflow.com/questions/11687870/wix-installer-always-changes-app
pool-to-enable-32bit-app

below is my custom action just in case...

[CustomAction]
        public static ActionResult Enable32BitApplicationPool(Session
session)
        {
            try
            {
                if (session == null)
                {
                    throw new ArgumentNullException("session");
                }

                var tempString = GetSessionProperty(session, "CustomActionData", false);
                var parts = tempString.Split(new[] { '|' });
                var applicationPool = parts[0];
                const string Quote = "\"";
                var cmdLineParameters = "set apppool /apppool.name:" + Quote
+ applicationPool + Quote + " /enable32BitAppOnWin64:false";

                var cmdLineExe =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),
"inetsrv\\appcmd.exe");

                // Prepare the process to run
                var startInfo = new ProcessStartInfo
                {
                    UseShellExecute = true,
                    Arguments = cmdLineParameters,
                    FileName = cmdLineExe,
                    WindowStyle = ProcessWindowStyle.Hidden,
                    CreateNoWindow = true
                };

                // Run the external process & wait for it to finish
                using (Process proc = Process.Start(startInfo))
                {
                    proc.WaitForExit();
                }
            }
            catch (Exception ex)
            {
                WriteErrorLogInstall(session, "Enable32BitApplicationPool
failed: ", ex, true);
            }

            return ActionResult.Success;
        }

-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: August-28-13 9:41 AM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Setting a value XmlConfig

Hi John,

I haven't done anything regarding permissions, although I am writing to it on a different component and that seems to be working.

I am not trying to create a AppPool as I am using the default, I am just trying to change the enable32BitAppOnWin64 from false to true.

Thanks

-----Original Message-----
From: John Cooper [mailto:[hidden email]]
Sent: 28 August 2013 14:19
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Setting a value XmlConfig

1) I assume you have previously obtained permissions to the IIS [7-8] applicationHost.config file.  Not just anybody can write to it.

2) It looks like you're creating an AppPool the hard way.  One of the things the IIS Extension does really well is create AppPools.  I would use the IIS Extension unless there's a compelling reason not to.

3) here's how I use util:XmlConfig:

&lt;util:XmlConfig Id="DeleteErrorSinkSinks" Action="delete"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="element" On="install"
Sequence="10" VerifyPath="/logging/categories/error/sinks" /&gt; &lt;util:XmlConfig Id="WriteErrorSink" Action="create"
ElementPath="/logging/categories/error"
File="[#FileEnterpriseLoggingConfig]" Node="document" On="install"
Sequence="11" Value="[ERROR_INNERTEXT]" /&gt;

--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.(r)
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
[hidden email]
www.jackhenry.com




-----Original Message-----
From: Natalie Carr [mailto:[hidden email]]
Sent: Wednesday, August 28, 2013 5:16 AM
To: [hidden email]
Subject: [WiX-users] Setting a value XmlConfig

Hi I am trying to change a value setting in a config file using the
following:

    <Component Id="Enable32BitAppPoolComponent" Guid="*"
Directory="INSTALLLOCATION">

        <CreateFolder/>

        <util:XmlConfig Id="Enable32BitAppPool" Node="value"

 
ElementPath="//configuration/system.applicationHost/applicationPools/add[\[]
@name='DefaultAppPool'[\]]/@enable32BitAppOnWin64"

                      File="[inetsrv]\config\applicationHost.config"

                      Value="true" On="install"/>

    </Component>

This code does not change the value in the applicationHost.config file. I tried adding the action="create" but I then got the error during the setup that it could not open the XML file. What am I doing wrong?

 

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed.
The message, together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies.


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

----------------------------------------------------------------------------
--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and advance your career. Get an incredible 1,500+ hours of step-by-step tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users