Skip to content

Commit

Permalink
Merge pull request #576 from Sitecore/rc/1.10.1
Browse files Browse the repository at this point in the history
Merge rc/1.10.1 to master
  • Loading branch information
AndreyFilchenkov authored Apr 9, 2021
2 parents 1b2610c + a5e5214 commit cb446c1
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 20 deletions.
16 changes: 11 additions & 5 deletions src/SIM.ContainerInstaller/EnvModel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -232,9 +231,16 @@ public static EnvModel LoadFromFile(string path)
while (!string.IsNullOrEmpty(line))
{
int num = line.IndexOf('=');
string key = line.Substring(0, num);
string value = line.Substring(num + 1);
model[key] = value;

if (num > 0)
{
string key = line.Substring(0, num);

string value = line.Substring(num + 1);

model[key] = value;
}

line = reader.ReadLine();
}
}
Expand Down
24 changes: 19 additions & 5 deletions src/SIM.Instances/Instance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -475,19 +475,33 @@ public InstanceType Type
return InstanceType.SitecoreContainer;
}

if (Product == Product.Undefined || Product.Release == null)
if (Product == Product.Undefined)
{
return InstanceType.SitecoreMember;
}

if (Product.Release.Version.MajorMinorInt < 90)
int version;

if (Product.Release != null)
{
version = Product.Release.Version.MajorMinorInt;
}
else
{
return InstanceType.Sitecore8AndEarlier;
int.TryParse(Product.ShortVersion, out version);
}

if (Product.Release.Version.MajorMinorInt >= 90)
if (version != default(int))
{
return InstanceType.Sitecore9AndLater;
if (version < 90)
{
return InstanceType.Sitecore8AndEarlier;
}

if (version >= 90)
{
return InstanceType.Sitecore9AndLater;
}
}

return InstanceType.Unknown;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@ public override bool IsVisible(Window mainWindow, Instance instance)
if (base.IsVisible(mainWindow, instance))
{
// Check if instance is Sitecore XP 9.0 or earlier
if (instance.Product.Release.Version.MajorMinorInt <= 90)
int version;

if (instance.Product.Release != null)
{
version = instance.Product.Release.Version.MajorMinorInt;
}
else
{
int.TryParse(instance.Product.ShortVersion, out version);
}

if (version != default(int) && version <= 90)
{
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected bool IsSitecoreContainer(Instance selectedInstance)

protected bool IsSitecoreMember(Instance selectedInstance)
{
if (selectedInstance.Product == Product.Undefined || selectedInstance.Product.Release == null)
if (selectedInstance.Product == Product.Undefined)
{
return true;
}
Expand All @@ -73,7 +73,9 @@ protected bool IsSitecoreMember(Instance selectedInstance)

protected bool IsSitecore9AndLater(Instance selectedInstance)
{
if (selectedInstance.Product.Release.Version.MajorMinorInt >= 90)
int version = this.GetSitecoreVersion(selectedInstance);

if (version != default(int) && version >= 90)
{
return true;
}
Expand All @@ -83,14 +85,32 @@ protected bool IsSitecore9AndLater(Instance selectedInstance)

protected bool IsSitecore8AndEarlier(Instance selectedInstance)
{
if (selectedInstance.Product.Release.Version.MajorMinorInt < 90)
int version = this.GetSitecoreVersion(selectedInstance);

if (version != default(int) && version < 90)
{
return true;
}

return false;
}

protected int GetSitecoreVersion(Instance selectedInstance)
{
int version;

if (selectedInstance.Product.Release != null)
{
version = selectedInstance.Product.Release.Version.MajorMinorInt;
}
else
{
int.TryParse(selectedInstance.Product.ShortVersion, out version);
}

return version;
}

#endregion
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Parameters": {
//global
"SIFVersion": "2.0.0",
"SIFVersion": "2.1.0",
"SqlServer": "",
"SqlAdminUser": "",
"SqlAdminPassword": "",
Expand Down Expand Up @@ -57,7 +57,7 @@
"InstallSIF": {
"Type": "SIM.Sitecore9Installer.Tasks.InstallSIFTask, SIM.Sitecore9Installer",
"TaskOptions": {
"InstallVersion": "2.0.0",
"InstallVersion": "2.1.0",
"Repository": "https://sitecore.myget.org/F/sc-powershell/api/v2",
"ExecutionOrder": "-100"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Parameters": {
//global
"SIFVersion": "2.0.0",
"SIFVersion": "2.1.0",
"SqlServer": "",
"SqlAdminUser": "",
"SqlAdminPassword": "",
Expand Down Expand Up @@ -122,7 +122,7 @@
"InstallSIF": {
"Type": "SIM.Sitecore9Installer.Tasks.InstallSIFTask, SIM.Sitecore9Installer",
"TaskOptions": {
"InstallVersion": "2.0.0",
"InstallVersion": "2.1.0",
"Repository": "https://sitecore.myget.org/F/sc-powershell/api/v2",
"ExecutionOrder": "-100"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Parameters": {
//global
"SIFVersion": "2.0.0",
"SIFVersion": "2.1.0",
"SqlServer": "",
"SqlAdminUser": "",
"SqlAdminPassword": "",
Expand Down Expand Up @@ -112,7 +112,7 @@
"InstallSIF": {
"Type": "SIM.Sitecore9Installer.Tasks.InstallSIFTask, SIM.Sitecore9Installer",
"TaskOptions": {
"InstallVersion": "2.0.0",
"InstallVersion": "2.1.0",
"Repository": "https://sitecore.myget.org/F/sc-powershell/api/v2",
"ExecutionOrder": "-100"
}
Expand Down

0 comments on commit cb446c1

Please sign in to comment.