cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
naile_sucu
Level 3

How do I update Windows features

Hello,

I want to update Windows features in installscript, I do it as follows. It crashes because it takes a long time and sometimes it works/sometimes it doesn't. Therefore, is there any different function/step you can suggest?

function RunPowerShellCommand()
STRING strCmd,sResult;
NUMBER nResult;
begin
LAAW_SHELLEXECUTEVERB = "runas";


strCmd = "Dism /online /Enable-Feature /FeatureName:NetFx4-AdvSrvs";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:NetFx4Extended-ASPNET45";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WCF-Services45";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WCF-HTTP-Activation45";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WCF-TCP-Activation45";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WCF-Pipe-Activation45";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WCF-MSMQ-Activation45";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WCF-TCP-PortSharing45";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-WebServerRole";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-WebServer";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-CommonHttpFeatures";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-HttpErrors";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-HttpRedirect";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ApplicationDevelopment";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-Security";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-RequestFiltering";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-NetFxExtensibility";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-NetFxExtensibility45";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-HealthAndDiagnostics";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-HttpLogging";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-LoggingLibraries";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-RequestMonitor";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-HttpTracing";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-URLAuthorization";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-IPSecurity";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-Performance";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-HttpCompressionDynamic";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-WebServerManagementTools";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ManagementScriptingTools";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-IIS6ManagementCompatibility";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-Metabase";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WAS-WindowsActivationService";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WAS-ProcessModel";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WAS-NetFxEnvironment";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WAS-ConfigurationAPI";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WCF-HTTP-Activation";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:WCF-NonHTTP-Activation";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-StaticContent";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-DefaultDocument";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-DirectoryBrowsing";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-WebDAV";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-WebSockets";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ApplicationInit";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ISAPIFilter";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ISAPIExtensions";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ASPNET";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ASPNET45";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ASP";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-CGI";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ServerSideIncludes";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-CustomLogging";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-BasicAuthentication";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-HttpCompressionStatic";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ManagementConsole";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ManagementService";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-WMICompatibility";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-LegacyScripts";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-LegacySnapIn";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-FTPServer";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-FTPSvc";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-FTPExtensibility";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:MSMQ-Container";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:MSMQ-Server";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-CertProvider";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-WindowsAuthentication";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-DigestAuthentication";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ClientCertificateMappingAuthentication";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-IISCertificateMappingAuthentication";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:IIS-ODBCLogging";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:SearchEngine-Client-Package";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

strCmd = "Dism /online /Enable-Feature /FeatureName:NetFx3";
nResult = LaunchApplication("powershell", strCmd, "", SW_HIDE, INFINITE, WAIT);

end;

 
Labels (1)
0 Kudos
(0) Replies