Skip to content

Commit

Permalink
MP1-5219: Add SQL Service Dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjswan committed May 28, 2024
1 parent 2f824ae commit cce1e11
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Tools/MediaPortal.DeployTool/MediaPortal.DeployTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NO_TV_SERVER</DefineConstants>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<WarningLevel>1</WarningLevel>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
Expand Down
29 changes: 23 additions & 6 deletions TvEngine3/TVLibrary/SetupTv/SetupDatabaseForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,17 @@ public void CheckServiceName()
// first try the quick method and assume the user is right or using defaults
string ConfiguredServiceName = tbServiceDependency.Text;
string DBSearchPattern = @"MySQL";

// MS SQL
if (rbSQLServer.Checked)
{
DBSearchPattern = @"SQLBrowser";
}
else if ( !(OSInfo.OSInfo.Win10OrLater() && Utils.Is64bitOS) )
{
DBSearchPattern = @"MySQL5";
}

Color clAllOkay = Color.GreenYellow;

if (ServiceHelper.IsInstalled(ConfiguredServiceName))
Expand All @@ -801,19 +812,25 @@ public void CheckServiceName()
}
else
{
// MSSQL
if (rbSQLServer.Checked)
DBSearchPattern = @"SQLBrowser";

if (ServiceHelper.GetDBServiceName(ref DBSearchPattern))
{
tbServiceDependency.Text = DBSearchPattern;
tbServiceDependency.BackColor = clAllOkay;
}
else
{
Log.Info("SetupDatabaseForm: DB service name not recognized - using defaults");
tbServiceDependency.BackColor = Color.Red;
// Maria DB
DBSearchPattern = @"MariaDB";
if (ServiceHelper.GetDBServiceName(ref DBSearchPattern))
{
tbServiceDependency.Text = DBSearchPattern;
tbServiceDependency.BackColor = clAllOkay;
}
else
{
Log.Info("SetupDatabaseForm: DB service name not recognized - using defaults [{0}]", DBSearchPattern);
tbServiceDependency.BackColor = Color.Red;
}
}
}

Expand Down

0 comments on commit cce1e11

Please sign in to comment.