I also had to create a new custom action for IIS, setting the
enable32BitAppOnWin64 true or false based on the bitness of the OS, if your WIX
installer was a 32 bit installer it would ALWAYS set this to true.
There are 2 C# functions, one to set the enable32BitAppOnWin64 and the other to
determine the bitness of the OS.
I would call this custom action:
<CustomAction Id="CA_Set_ENABLE32BITAPPPOOL" Property="CA_ENABLE32BITAPPPOOL"
Value="[WEB_SITE_NAME]|"/>
<CustomAction Id="CA_ENABLE32BITAPPPOOL" BinaryKey="BIN_CustomActionMM"
DllEntry="Enable32BitApplicationPool" Impersonate="no" Execute="deferred"
Return="ignore"/>
<UI>
<ProgressText Action="CA_ENABLE32BITAPPPOOL">CA: Setting
enable32BitAppOnWin64 for TITUS Application Pool...</ProgressText>
</UI>
<InstallExecuteSequence>
<Custom Action="CA_Set_ENABLE32BITAPPPOOL" After="CostFinalize">NOT
Installed</Custom>
<Custom Action="CA_ENABLE32BITAPPPOOL" Before="InstallFinalize">NOT
Installed</Custom>
/// <summary>
/// Enable32BitApplicationPool sets the App Pool propery
enable32BitAppOnWin64
/// true or false depending on the bitness of the OS
/// </summary>
/// <param name="session"></param>
/// <returns>ActionResult.Success</returns>
[CustomAction]
public static ActionResult Enable32BitApplicationPool(Session session)
{
try
{
if (session == null)
{
throw new ArgumentNullException("session");
}
string tempString = (GetSessionProperty(session,
"CustomActionData", false));
string[] parts = tempString.Split(new[] { '|' });
string applicationPool = parts[0]; // which is [WEB_SITE_NAME]
the name of the web app pool as well
const string quote = "\"";
string cmdLineParameters = "set apppool /apppool.name:" + quote
+ applicationPool + quote + " /enable32BitAppOnWin64:false";
var cmdLineExe =
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)
{
MessageBox.Show("Enable32BitApplicationPool failed: " +
ex.Message, "Custom action exception error...", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
return ActionResult.Success;
}
/// <summary>
/// Detects whether or not the OS is 64 or 32 bit
/// </summary>
/// <returns></returns>
private static bool Is64BitWindows()
{
return
Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86));
}
Hope this helps out...
-----Original Message-----
From: Rob Mensching [mailto:[email protected]]
Sent: January-18-13 11:45 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Wix's IIS extension. How to set "Limit Interval
(minutes)" on an App Pool
Or better, just add the missing setting to the WiX CA. I can't image it's that
much work... certainly less than creating a whole new CA.
On Thu, Jan 17, 2013 at 10:54 PM, Neil Sleightholm <[email protected]>wrote:
> Looking at the source I don't think it has been implemented.
>
> You could try adding a custom action to set it or write the entry in
> to ApplicationHost.config (
> http://www.iis.net/configreference/system.applicationhost/applicationp
> ools/add/cpu
> )
>
> Neil
>
> -----Original Message-----
> From: JohnB [mailto:[email protected]]
> Sent: 18 January 2013 00:30
> To: [email protected]
> Subject: [WiX-users] Wix's IIS extension. How to set "Limit Interval
> (minutes)" on an App Pool
>
> In IIS 7, an App Pool has a settings called "Limit Interval (minutes)"
> (aka "resetInterval"). I can't seem to find a way to set this in Wix.
> I've tried the WebAppPool element's RefreshCpu, RecycleMinutes, and
> several other attributes with no luck. Is there a way? Here's a
> screen shot of what I mean. Thanks.
>
> <
> http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/file/n75
> 82998/2013-01-17_17h09_14.png
> >
>
>
>
> --
> View this message in context:
> http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Wix-s-II
> S-extension-How-to-set-Limit-Interval-minutes-on-an-App-Pool-tp7582998
> .html Sent from the wix-users mailing list archive at Nabble.com.
>
>
> ----------------------------------------------------------------------
> -------- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API
> and much more. Get web development skills now with LearnDevNow -
> 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
> SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122812
> _______________________________________________
> WiX-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
>
> ----------------------------------------------------------------------
> -------- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API
> and much more. Get web development skills now with LearnDevNow -
> 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
> SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122812
> _______________________________________________
> WiX-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get
web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users