G
G-Oker
Guest
Hello,
I'm trying to right a simple console program that checks a EXE for its current version, and queries this with the excepted version, and if incorrect, runs an update exe..
Ive got the installed EXE's version, and the expected version, and I can run a comparison on those, what I am now trying to do is run an EXE from a URL, not download.
so
if (_CLIENTexe < _EXPECTEDexe)
{
// run file from URL
}
Now, I can download the file
string _ToDownload = "https://url.com/to/filename.exe";
string _filename = "newversion.exe";
Console.WriteLine(_filename + " download started.." + Environment.NewLine);
using (WebClient wc = new WebClient())
{
wc.DownloadFileAsync(new Uri(_ToDownload),"/downloadfolder" + "/" + _filename);
}
but what I am trying to do is get the file to run.
I am not sure of the correct way of doing this. Should/can I load the exe to memory and run it, or should i download the file, and then run that download (and delete the file when completed ) ?
If anyone could advise, and show me what i need to do, that would be great.
Many Thanks
Continue reading...
I'm trying to right a simple console program that checks a EXE for its current version, and queries this with the excepted version, and if incorrect, runs an update exe..
Ive got the installed EXE's version, and the expected version, and I can run a comparison on those, what I am now trying to do is run an EXE from a URL, not download.
so
if (_CLIENTexe < _EXPECTEDexe)
{
// run file from URL
}
Now, I can download the file
string _ToDownload = "https://url.com/to/filename.exe";
string _filename = "newversion.exe";
Console.WriteLine(_filename + " download started.." + Environment.NewLine);
using (WebClient wc = new WebClient())
{
wc.DownloadFileAsync(new Uri(_ToDownload),"/downloadfolder" + "/" + _filename);
}
but what I am trying to do is get the file to run.
I am not sure of the correct way of doing this. Should/can I load the exe to memory and run it, or should i download the file, and then run that download (and delete the file when completed ) ?
If anyone could advise, and show me what i need to do, that would be great.
Many Thanks
Continue reading...