Say I want to run an exe from the web, well obviously I rather download it to a temp folder.. run it from there, and delete it (or let the OS do so). Is there any convention how to do that, while being sure not to bomb into permissions issues, overriding exist file etc.?
Thanks.
EDIT I ment from a desktop application. BTW, I do have a lot of guess, but I'm just wondering what's accepted.
I know i can use Path.GetTempFile
, but then it already made the file for me, which makes me thinking that it may also add it to some db, and keep track on it - so i can't delete it and replace it by my own file.
I know i can also use Path.TempDirectory
(or something similar) and Path.RandomFileName
, but the latter add a random extension to the file name, while i need exe, obviously this can be solven very easily as well, but it seems weird to me to rewrite what seems that MS already tried to wrote for us.