Titano: time-lapse ecosystem (client, server, uploader) — in progress #1
@@ -75,7 +75,8 @@ public static unsafe class ServiceInstaller
|
||||
private static string CommandLine()
|
||||
{
|
||||
var process = Environment.ProcessPath ?? throw new InvalidOperationException("The executable path is unknown.");
|
||||
var assembly = typeof(ServiceInstaller).Assembly.Location;
|
||||
// Assembly.Location is empty in a single-file app; under dotnet the entry assembly sits in the base directory.
|
||||
var assembly = Path.Combine(AppContext.BaseDirectory, typeof(ServiceInstaller).Assembly.GetName().Name + ".dll");
|
||||
return Path.GetFileNameWithoutExtension(process).Equals("dotnet", StringComparison.OrdinalIgnoreCase)
|
||||
? $"\"{process}\" \"{assembly}\" --service"
|
||||
: $"\"{process}\" --service";
|
||||
|
||||
Reference in new issue
Block a user