cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
xsintill
Level 5

make IS force setting enable32bitapponwin64 to true

I'm using the following code to try to set an application pool 's property enable32bitapponwin64 to true:

function AppPoolEnable32BitApps(sApplicationPoolName)
STRING sCommand;
STRING sParameters;
NUMBER nOptions;
begin
//Check if windows 2008 64 bits
if (IsOSVersion(OSVER_WIN_2008_R2) || IsOSVersion(OSVER_WIN_2008) || IsOSVersion(OSVER_WIN_7)) && SYSINFO.bIsWow64 then

//enable 32 bits application for the application pool
sCommand = "%systemroot%\\system32\\inetsrv\\appcmd.exe";
sParameters = " set apppool /apppool.name: "+sApplicationPoolName+" /enable32bitapponwin64:true";

if LaunchAppAndWait(sCommand, sParameters, LAAW_OPTION_HIDDEN | LAAW_OPTION_WAIT)<0 then
Show("AppPoolEnable32BitApps Value could not be set");
endif;
endif;
end;


But I keep getting that the value is not being set. The setup is being run on windows 2008 64 bits.
How can I make a specific apppool 32bits enabled.
Labels (1)
0 Kudos

(1) Reply
xsintill
Level 5

The problem was that i didn't start it with cmd /c.
I changed the function a little so it also configures some other things needed for our applicationpool:

[CODE]
function ConfigureAppPool(sApplicationPoolName, bClassic, bAutoStart, bEnable32BitApps)
/*
This function will configure a given application pool.
For now it can set the following properties:
-Start application pool immediatly
-Enable 32 bits application
-managedpipeline mode
*/
STRING sCommand;
STRING sParameters;
STRING sManagedPipelineMode;
STRING sEnable32bitapponwin64;
STRING sAutoStart;
begin
//Check if windows 2008 64 bits
if (IsOSVersion(OSVER_WIN_2008_R2) || IsOSVersion(OSVER_WIN_2008) || IsOSVersion(OSVER_WIN_7)) then
if bClassic then
sManagedPipelineMode = "Classic";
else
sManagedPipelineMode = "Integrated";
endif;

if SYSINFO.bIsWow64 then
if bEnable32BitApps then
sEnable32bitapponwin64 = "/enable32bitapponwin64:true";
else
sEnable32bitapponwin64 = "/enable32bitapponwin64:false";
endif;
else
sEnable32bitapponwin64 = "";
endif;

//enable 32 bits application for the application pool
sCommand = "cmd.exe ";
sParameters = " /C %systemroot%\\system32\\inetsrv\\appcmd.exe set apppool /apppool.name:"+sApplicationPoolName+" "+sEnable32bitapponwin64+" /managedRuntimeVersion:v2.0 /managedPipelineMode:"+sManagedPipelineMode;
LaunchAppAndWait(sCommand, sParameters, LAAW_OPTION_HIDDEN | LAAW_OPTION_WAIT);

//configure autostart
if bAutoStart then
sAutoStart = "true";
else
sAutoStart = "false";
endif;
sParameters = " /C %systemroot%\\system32\\inetsrv\\appcmd.exe set config /section:applicationPools /[name='"+sApplicationPoolName+"'].autoStart:"+sAutoStart;
LaunchAppAndWait(sCommand, sParameters, LAAW_OPTION_HIDDEN | LAAW_OPTION_WAIT);
endif;
end;[/CODE]
0 Kudos