Exemplo n.º 1
0
        // WindowsFabric AzureWrapper service should be restarted immediately upon failures
        private static bool SetServiceRecoveryOptions()
        {
            string command   = Environment.ExpandEnvironmentVariables(@"%WINDIR%\System32\Sc.exe");
            string arguments = string.Format(CultureInfo.InvariantCulture, "Failure {0} Reset= 0 Actions= Restart/0/Restart/0/Restart/0", WindowsFabricAzureWrapperServiceCommon.WindowsFabricAzureWrapperServiceName);

            LogInfo("Setting recovery options for WindowsFabricAzureWrapperService with command {0} {1}", command, arguments);

            int exitCode = WindowsFabricAzureWrapperServiceCommon.ExecuteCommand(command, arguments);

            LogInfo("Setting recovery options for WindowsFabricAzureWrapperService returns with exit code {0}", exitCode);

            return(exitCode == 0);
        }
Exemplo n.º 2
0
        private static bool TryInstallVcRuntime(string pluginDirectory)
        {
            try
            {
                string installationCommand = Path.Combine(pluginDirectory, WindowsFabricAzureWrapperServiceCommon.Vc11RuntimeInstallerBinaryName);
                string arguments           = "/q /norestart";

                LogInfo("Installing VC 11 runtime with command {0} {1}", installationCommand, arguments);

                int exitCode = WindowsFabricAzureWrapperServiceCommon.ExecuteCommand(installationCommand, arguments, TimeSpan.FromMinutes(WaitForInstallationTimeoutMinutes));

                LogInfo("Installing VC 11 runtime returns with exit code {0}", exitCode);

                return(exitCode == 0);
            }
            catch (Exception e)
            {
                LogError("Exception occurred when installing VC 11 runtime : {0}", e);

                return(false);
            }
        }