2
2
// Copyright (c) James Jackson-South, Jeavon Leopold, and contributors. All rights reserved.
3
3
// Licensed under the Apache License, Version 2.0.
4
4
// </copyright>
5
+
5
6
namespace Our . Umbraco . FileSystemProviders . Azure . Installer
6
7
{
7
8
using System ;
@@ -10,6 +11,7 @@ namespace Our.Umbraco.FileSystemProviders.Azure.Installer
10
11
using System . Diagnostics ;
11
12
using System . IO ;
12
13
using System . Linq ;
14
+ using System . Web ;
13
15
using System . Web . Hosting ;
14
16
using System . Web . Http ;
15
17
using System . Xml ;
@@ -386,16 +388,21 @@ private static bool ExecuteWebConfigTransform()
386
388
387
389
private static bool ExecuteMediaWebConfigTransform ( )
388
390
{
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
+ }
396
404
397
- PackageActions . TransformConfig transformConfig = new PackageActions . TransformConfig ( ) ;
398
- return transformConfig . Execute ( "UmbracoFileSystemProviders.Azure" , transFormConfigAction ) ;
405
+ return true ;
399
406
}
400
407
401
408
private static bool ExecuteImageProcessorSecurityConfigTransform ( )
0 commit comments