Skip to content

Commit fc12391

Browse files
committed
Fix the Umbraco Installer for < v7.5
1 parent 7a9d013 commit fc12391

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

src/UmbracoFileSystemProviders.Azure.Installer/InstallerController.cs

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright (c) James Jackson-South, Jeavon Leopold, and contributors. All rights reserved.
33
// Licensed under the Apache License, Version 2.0.
44
// </copyright>
5+
56
namespace Our.Umbraco.FileSystemProviders.Azure.Installer
67
{
78
using System;
@@ -10,6 +11,7 @@ namespace Our.Umbraco.FileSystemProviders.Azure.Installer
1011
using System.Diagnostics;
1112
using System.IO;
1213
using System.Linq;
14+
using System.Web;
1315
using System.Web.Hosting;
1416
using System.Web.Http;
1517
using System.Xml;
@@ -386,16 +388,21 @@ private static bool ExecuteWebConfigTransform()
386388

387389
private static bool ExecuteMediaWebConfigTransform()
388390
{
389-
XmlNode transFormConfigAction =
390-
helper.parseStringToXmlNode("<Action runat=\"install\" "
391-
+ "undo=\"true\" "
392-
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
393-
+ "file=\"~/Media/web.config\" "
394-
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/media-web.config\">"
395-
+ "</Action>").FirstChild;
391+
if (File.Exists(HttpContext.Current.Server.MapPath("~/Media/web.config")))
392+
{
393+
XmlNode transFormConfigAction =
394+
helper.parseStringToXmlNode("<Action runat=\"install\" "
395+
+ "undo=\"true\" "
396+
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
397+
+ "file=\"~/Media/web.config\" "
398+
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/media-web.config\">"
399+
+ "</Action>").FirstChild;
400+
401+
PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
402+
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
403+
}
396404

397-
PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
398-
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
405+
return true;
399406
}
400407

401408
private static bool ExecuteImageProcessorSecurityConfigTransform()

0 commit comments

Comments
 (0)