Skip to content
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

Updater doesnt work (Path may contain an empty string or just a space.) #101

Open
TiToMoskito opened this issue Apr 18, 2022 · 5 comments
Open

Comments

@TiToMoskito
Copy link

I am getting an error when my application is attempting to update.

This is the full stacktrace:

System.ArgumentException: Der Pfad darf keine leere Zeichenfolge sein oder nur aus Leerzeichen bestehen.
bei System.IO.Directory.CreateDirectory(String path)
bei nUpdate.UpdateInstaller.Updater.CopyDirectoryRecursively(String sourceDirName, String destDirName)

@dbforge
Copy link
Owner

dbforge commented Apr 22, 2022

Hi,

this is not quite easy to trace down as there is not enough information. What does the structure of your package look like? Especially the files you added.

@gerricom
Copy link

I'm starting to use your updater for our little pet project and I'm running into this error message as well. The files to replace are pretty straight forward as you can see in the screenshot.

The application is currently running in C:\Users\MyUser\Desktop\BClient.
2023-08-17  110400

How can I help to trace this problem?

@gerricom
Copy link

My appointment for this morning got cancelled, so I got some spare time to look into this. I recognized that one can see all arguments of nUpdateInstaller in the UAC, so my best guess was to check if those are right. I found out that startupPath was empty and that led me into UpdateManager.cs. Here I found out, that the executablePath is determined by the EntryAssembly.

That path is available while debugging the app but not in a release build. I guess this is because I use a single binary build. Fortunately the UpdateManager accepts a applicationExecutablePath. Here I handed in AppContext.BaseDirectory and appended the name of my executable.

Now nUpdateInstaller is capable of finding the correct paths and every works like a charm!

@dbforge
Copy link
Owner

dbforge commented Aug 17, 2023

@gerricom Ah, alright! Thanks for investigating further. I will note this because it should be documented in the README. Or would you mind opening a pull request for documenting what you found out? Also the empty path should be handled in the beginning as soon as the initialization is done and not throw a cryptic exception later.

I added the option exactly for this case that the path cannot be determined automatically by any circumstances, but I was not aware of this specific case.

@gerricom
Copy link

Or would you mind opening a pull request for documenting what you found out

I added a paragraph to the README and send you a PR.

Also the empty path should be handled in the beginning as soon as the initialization is done and not throw a cryptic exception later.

I'll look into this next week - I guess a MessageBox will do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants