Skip to content

Commit 600a995

Browse files
committed
Umbraco Installer support for Umbraco v6!
1 parent d509751 commit 600a995

File tree

4 files changed

+56
-15
lines changed

4 files changed

+56
-15
lines changed

src/UmbracoFileSystemProviders.Azure.Installer/Configurator/Views/Configure.ascx

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
<%@ Control Language="c#" AutoEventWireup="True" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
2-
<script src="/umbraco/lib/angular/1.1.5/angular.min.js"></script>
2+
<%@ Import Namespace="Our.Umbraco.FileSystemProviders.Azure.Installer" %>
3+
4+
<%
5+
string angularSrc = "/umbraco/lib/angular/1.1.5/angular.min.js";
6+
string span = string.Empty;
7+
if (Helpers.GetUmbracoVersion().Major < 7)
8+
{
9+
angularSrc = "//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.js";
10+
span = " class=\"span12\"";
11+
%>
12+
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/css/bootstrap.css" type="text/css" rel="stylesheet"/>
13+
<%
14+
}
15+
%>
16+
17+
<script src="<%=angularSrc%>"></script>
318
<script src="/App_Plugins/UmbracoFileSystemProviders/Azure/Install/Configurator/Controllers/Configure.js"></script>
419

520
<div ng-app ="UFSPLoader">
@@ -14,7 +29,7 @@
1429
<div><hr /></div>
1530
</div>
1631
<div class="row" ng-show="!saved">
17-
<div>
32+
<div<%=span %>>
1833
<fieldset>
1934
<legend><h4>To complete installation, please enter the required parameters for the Azure storage provider below</h4></legend>
2035
<form name="paramForm" class="form-horizontal" role="form">
@@ -43,18 +58,20 @@
4358
</div>
4459

4560
<div class="row">
46-
<div class="alert alert-success" ng-show="saved && (status === 'Ok' || status === 'ImageProcessorWebCompatibility')">
47-
The Azure storage provider was sucessfully configured and your media is now as light as candyfloss
48-
</div>
49-
<div class="alert alert-info" ng-show="saved && status === 'ImageProcessorWebCompatibility'">
50-
<strong>Warning!</strong> You need to upgrade the installed version of ImageProcessor.Web to v4.3.2+ to be fully compatible with this package <a href="https://our.umbraco.org/projects/collaboration/imageprocessor/" target="_blank">https://our.umbraco.org/projects/collaboration/imageprocessor/</a>
51-
</div>
52-
<div class="alert alert-error" ng-show="saved && status != 'Ok' && status != 'ImageProcessorWebCompatibility'">
53-
<strong>Oh no</strong>, something went wrong saving, please check Umbraco log files for exceptions
61+
<div<%=span %>>
62+
<div class="alert alert-success" ng-show="saved && (status === 'Ok' || status === 'ImageProcessorWebCompatibility')">
63+
The Azure storage provider was sucessfully configured and your media is now as light as candyfloss
64+
</div>
65+
<div class="alert alert-info" ng-show="saved && status === 'ImageProcessorWebCompatibility'">
66+
<strong>Warning!</strong> You need to upgrade the installed version of ImageProcessor.Web to v4.3.2+ to be fully compatible with this package <a href="https://our.umbraco.org/projects/collaboration/imageprocessor/" target="_blank">https://our.umbraco.org/projects/collaboration/imageprocessor/</a>
67+
</div>
68+
<div class="alert alert-error" ng-show="saved && status != 'Ok' && status != 'ImageProcessorWebCompatibility'">
69+
<strong>Oh no</strong>, something went wrong saving, please check Umbraco log files for exceptions
70+
</div>
71+
<div class="alert alert-error" ng-show="!saved && status === 'ConnectionError'">
72+
<strong>Oh no</strong>, there was something wrong with your Azure connection string, please check and try again, more info in the Umbraco log files
73+
</div>
5474
</div>
55-
<div class="alert alert-error" ng-show="!saved && status === 'ConnectionError'">
56-
<strong>Oh no</strong>, there was something wrong with your Azure connection string, please check and try again, more info in the Umbraco log files
57-
</div>
5875
</div>
5976

6077
</div>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// <copyright file="Helpers.cs" company="James Jackson-South">
2+
// Copyright (c) James Jackson-South. All rights reserved.
3+
// Licensed under the Apache License, Version 2.0.
4+
// </copyright>
5+
6+
namespace Our.Umbraco.FileSystemProviders.Azure.Installer
7+
{
8+
using System;
9+
using System.Configuration;
10+
11+
public static class Helpers
12+
{
13+
public static Version GetUmbracoVersion()
14+
{
15+
var umbracoVersion = new Version(ConfigurationManager.AppSettings["umbracoConfigurationStatus"]);
16+
return umbracoVersion;
17+
}
18+
}
19+
}

src/UmbracoFileSystemProviders.Azure.Installer/InstallerController.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ namespace Our.Umbraco.FileSystemProviders.Azure.Installer
1515
using System.Collections.Generic;
1616
using System.Configuration;
1717
using System.Diagnostics;
18+
using System.IO;
1819
using System.Linq;
1920
using System.Web.Hosting;
2021
using System.Web.Http;
@@ -218,10 +219,13 @@ private static bool TestAzureCredentials(string connectionString, string contain
218219

219220
private static bool CheckImageProcessorWebCompatibleVersion(Version imageProcessorWebMinRequiredVersion)
220221
{
221-
var fileVersionInfo = FileVersionInfo.GetVersionInfo(ImageProcessorWebAssemblyPath);
222+
if (!File.Exists(ImageProcessorWebAssemblyPath))
223+
{
224+
return false;
225+
}
222226

227+
var fileVersionInfo = FileVersionInfo.GetVersionInfo(ImageProcessorWebAssemblyPath);
223228
var currentImageProcessorWebVersionInfo = new Version(fileVersionInfo.ProductVersion);
224-
225229
return currentImageProcessorWebVersionInfo >= imageProcessorWebMinRequiredVersion;
226230
}
227231
}

src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@
258258
</ItemGroup>
259259
<ItemGroup>
260260
<Compile Include="Enums\InstallerStatus.cs" />
261+
<Compile Include="Helpers.cs" />
261262
<Compile Include="Properties\AssemblyInfo.cs" />
262263
<Compile Include="Models\Parameter.cs" />
263264
<Compile Include="InstallerController.cs" />

0 commit comments

Comments
 (0)