Run install.cmd/uninstall.cmd for site extensions

Fixes #1193 
Test with `Extension Script Test`
This is a really simple workflow for now. We can discuss other useful features (log/return output of the scripts?) and add them later.
I looked at the API return payload in error, it has a few properties and some of them does contain the details. My UI happens to display the property with only the generic message for now. I will coordinate with Ahmed regarding the UI.
________________________________
From: David Ebbo<mailto:notifications@github.com>
Sent: ý6/ý5/ý2014 9:54 PM
To: projectkudu/kudu<mailto:kudu@noreply.github.com>
Cc: Mingwei Tian<mailto:Mingwei.Tian@microsoft.com>
Subject: Re: [kudu] Run install.cmd/uninstall.cmd for site extensions (#1198)


In Kudu.Core/SiteExtensions/SiteExtensionManager.cs:

> @@ -307,7 +326,18 @@ public bool UninstallExtension(string id)
>                  throw new DirectoryNotFoundException(installationDirectory);
>              }
>
> -            OperationManager.Attempt(() => FileSystemHelpers.DeleteDirectorySafe(installationDirectory));
> +            OperationManager.Attempt(() =>
> +            {
> +                var externalCommandFactory = new ExternalCommandFactory(_environment, _settings, installationDirectory);
> +                string uninstallScript = Path.Combine(installationDirectory, _uninstallScriptName);
> +                if (FileSystemHelpers.FileExists(uninstallScript))
> +                {
> +                    Executable exe = externalCommandFactory.BuildCommandExecutable(uninstallScript, installationDirectory,
> +                        _settings.GetCommandIdleTimeout(), NullLogger.Instance);


I think it was more the REST API's json payload than the UI, since we only saw a generic error when looking at the response.

—
Reply to this email directly or view it on GitHub<https://github.com/projectkudu/kudu/pull/1198/files#r13476564>.