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+
56namespace 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