Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions src/Neo.CLI/CLI/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
using System.Net;
using System.Numerics;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -383,7 +382,7 @@ public async void Start(CommandLineOptions options)
}
catch (DllNotFoundException ex) when (ex.Message.Contains("libleveldb"))
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
if (OperatingSystem.IsWindows())
{
if (File.Exists("libleveldb.dll"))
{
Expand All @@ -392,25 +391,32 @@ public async void Start(CommandLineOptions options)
}
else
{
DisplayError("DLL not found, please get libleveldb.dll.");
DisplayError("DLL not found, please get libleveldb.dll.",
"Download from https://github.com/neo-ngd/leveldb/releases");
}
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
else if (OperatingSystem.IsLinux())
{
DisplayError("Shared library libleveldb.so not found, please get libleveldb.so.",
"Use command \"sudo apt-get install libleveldb-dev\" in terminal or download from https://github.com/neo-ngd/leveldb/releases");
}
else if (OperatingSystem.IsMacOS() || OperatingSystem.IsMacCatalyst())
{
DisplayError("Shared library libleveldb.dylib not found, please get libleveldb.dylib.",
"From https://github.com/neo-project/neo/releases");
"Use command \"brew install leveldb\" in terminal or download from https://github.com/neo-ngd/leveldb/releases");
}
else
{
DisplayError("Neo CLI is broken, please reinstall it.",
"From https://github.com/neo-project/neo/releases");
"Download from https://github.com/neo-project/neo/releases");
}

return;
}
catch (DllNotFoundException)
{
DisplayError("Neo CLI is broken, please reinstall it.",
"From https://github.com/neo-project/neo/releases");
"Download from https://github.com/neo-project/neo/releases");
return;
}

NeoSystem.AddService(this);
Expand Down