-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restart with Avalonia #22
Comments
Hi, are you using Onova 2.4.4? |
yes |
It should work in 2.4.4 |
The path of the DLL is correct Der angegebenen Datei ist keine Anwendung zugeordnet = There is no application associated with the specified file |
@Sewer56 have you checked, does it break for you as well? |
If I try to do open the application with |
I guess it could be the same problem as this guy has: |
I was asking someone else who also had issues with .NET Core 3.0 app. |
Line 45 - 73 in Updater - > Program.cs var startInfo = new ProcessStartInfo
{
WorkingDirectory = updateeDirPath
};
// If updatee is an .exe file - start it directly
if (string.Equals(Path.GetExtension(updateeFilePath), ".exe", StringComparison.OrdinalIgnoreCase))
{
startInfo.FileName = updateeFilePath;
}
// If not - figure out what to do with it
else
{
// If there's an .exe file with same name - start it instead
// Security vulnerability?
if (File.Exists(Path.ChangeExtension(updateeFilePath, ".exe")))
{
startInfo.FileName = Path.ChangeExtension(updateeFilePath, ".exe");
}
// Otherwise - start the updatee using dotnet SDK
else
{
startInfo.FileName = "dotnet";
startInfo.Arguments = updateeFilePath;
}
}
using (var restartedUpdateeProcess = Process.Start(updateeFilePath))
WriteLog($"Restarted as pid:{restartedUpdateeProcess?.Id}."); You start the process there without using startInfo you created before. Change Process.Start(updateeFilePath) to Process.Start(startInfo) And it works :) |
Above is the correct solution. |
Excuse me while I knock myself out with a facepalm. That's what you get for not testing. |
Otherwise it works very well even on Linux. Just had to remove the "Onova works only on Windows warning", make it target .Net Standard 2.0 |
You can submit your changes as a pull request ;) |
Automatic restarting does not work with Avalonia Applications.
It is probably because I don't have a .exe file.
In order to start it again it would need to do
dotnet MyApp.dll
It would be nice to have an option to support this.
The text was updated successfully, but these errors were encountered: