uet upgrade stores the new executable in a different location
In my situation, I downloaded uet.exe
from the website and put it into the directory C:\bin
, because that is already in my PATH environment variable. Then I ran uet upgrade
and it installed to C:\ProgramData\UET\Current\uet.exe
and added C:\ProgramData\UET\Current
to the PATH. Since that directory was appended to the PATH, my old C:\bin\uet.exe
was still the first match on the commandline.
Since you're shipping a standalone executable, I suggest to replace uet.exe
in the same location where it launched. If access is denied, try to run a subprocess with elevated privileges. If that fails, print an error.
I noticed that it does a similar thing to scoop where it downloads into a folder with a version, and C:\ProgramData\UET\Current
is just a symlink to that. I like that approach in general but it requires some kind of initial setup. Even with detailed installation instructions, people will likely screw up just as I did.
Another way would be to have the initial executable act as some kind of launcher and always relay to C:\ProgramData\UET\Current
if that's not the directory the current executable lives in. But 64MB for a launcher is quite hefty.