Giter VIP home page Giter VIP logo

Comments (13)

HendrikMennen avatar HendrikMennen commented on May 20, 2024 1

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 :)

from onova.

HendrikMennen avatar HendrikMennen commented on May 20, 2024 1

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
and change a little bit to make restarting work there too 💯 . Very nice and simple updater.

from onova.

Tyrrrz avatar Tyrrrz commented on May 20, 2024

Hi, are you using Onova 2.4.4?

from onova.

HendrikMennen avatar HendrikMennen commented on May 20, 2024

yes

from onova.

Tyrrrz avatar Tyrrrz commented on May 20, 2024

It should work in 2.4.4
Can you post your latest log file from %localappdata%/Onova/{Your app name}/Log.txt?

from onova.

HendrikMennen avatar HendrikMennen commented on May 20, 2024
18-Aug-2019 02:54:11.764> Onova Updater v2.4.4.0 started with args: [C:\Users\HendrikMennen\source\repos\VHDP\VHDPlus\bin\Debug\netcoreapp2.1\VHDPlus.dll, C:\Users\HendrikMennen\AppData\Local\Onova\VHDPlus\0.3, True].
18-Aug-2019 02:54:11.770> Waiting for all running updatee instances to exit...
18-Aug-2019 02:54:11.977> Copying package contents from storage to updatee's directory...
18-Aug-2019 02:54:14.373> Restarting updatee...
18-Aug-2019 02:54:14.438> System.ComponentModel.Win32Exception (0x80004005): Der angegebenen Datei ist keine Anwendung zugeordnet
   bei System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
   bei System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   bei Onova.Updater.Program.Update(String updateeFilePath, String packageContentDirPath, Boolean restartUpdatee)
   bei Onova.Updater.Program.Main(String[] args)

The path of the DLL is correct

Der angegebenen Datei ist keine Anwendung zugeordnet = There is no application associated with the specified file

from onova.

Tyrrrz avatar Tyrrrz commented on May 20, 2024

@Sewer56 have you checked, does it break for you as well?

from onova.

HendrikMennen avatar HendrikMennen commented on May 20, 2024

If I try to do open the application with dotnet C:\Users\HendrikMennen\source\repos\VHDP\VHDPlus\bin\Debug\netcoreapp2.1\VHDPlus.dll it works fine
Was that your question?

from onova.

HendrikMennen avatar HendrikMennen commented on May 20, 2024

I guess it could be the same problem as this guy has:
dotnet/core#1857

from onova.

Tyrrrz avatar Tyrrrz commented on May 20, 2024

I was asking someone else who also had issues with .NET Core 3.0 app.
That issue doesn't seem related. I'll look into it next week.

from onova.

Sewer56 avatar Sewer56 commented on May 20, 2024

Above is the correct solution.
I was about to check this myself, moving back from my fork temporarily but seems I was beat to it.

from onova.

Tyrrrz avatar Tyrrrz commented on May 20, 2024

Excuse me while I knock myself out with a facepalm. That's what you get for not testing.

from onova.

Tyrrrz avatar Tyrrrz commented on May 20, 2024

You can submit your changes as a pull request ;)

from onova.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.