This project has moved and is read-only. For the latest updates, please go here.

download update file location..

Feb 21, 2013 at 5:06 AM
hi, i am still beginner and want to use this library.
i have add autoupdater.start on my main form.
and its don't have problem checking version and downloading.

but the problem is after the downloading progress complete.it don't make any changes.
it don't replace the old file and i don't know where the location of the file after download.

can u help me pls?


thx
Feb 21, 2013 at 5:10 AM
Edited Feb 21, 2013 at 8:42 AM
You have to setup your installer to overwrite file if it exists. It places downloaded file in temp folder. see downloadUpdatedialog.cs.
Feb 21, 2013 at 5:40 AM
do u mean it will run downloaded file after download?
so i must make installer like msi? every time i update client file?

in my case just only need to replace the main.exe on installed application.
is there source code on vb.net language?

thx
Feb 21, 2013 at 6:00 AM
Edited Feb 21, 2013 at 8:43 AM
change below code in downloadupdatedailog.cs according to your requirments.
private void OnDownloadComplete(object sender, AsyncCompletedEventArgs e) 
{
//Add code to copy file.
} 
Feb 21, 2013 at 6:10 AM
thank you,it's really help me
Mar 14, 2013 at 10:45 PM
Here is what I did to get to put the file on the desktop

I just changed the _tempPath
private void DownloadUpdateDialogLoad(object sender, EventArgs e)
        {
            var webClient = new WebClient();

            var uri = new Uri(_downloadUrl);
            string filename = Path.GetFileName(uri.LocalPath);

            //_tempPath = Path.GetTempPath() + "\\" + filename;
            _tempPath = Environment.GetEnvironmentVariable("USERPROFILE") + "\\Desktop\\" + filename;

            webClient.DownloadProgressChanged += OnDownloadProgressChanged;

            webClient.DownloadFileCompleted += OnDownloadComplete;

            webClient.DownloadFileAsync(uri, _tempPath);
        }
Mar 15, 2013 at 5:36 PM
In which file does it specify the location to launch the program after update? My above method didn't seem to work correctly
Mar 29, 2013 at 6:38 AM
It's in OnDownloadComplete event. I did Process.Start() to launch the downloaded file.
Apr 23, 2013 at 9:46 AM
ondrovic wrote:
Here is what I did to get to put the file on the desktop

I just changed the _tempPath
private void DownloadUpdateDialogLoad(object sender, EventArgs e)
        {
            _tempPath = Environment.GetEnvironmentVariable("USERPROFILE") + "\\Desktop\\" + filename;
Hi,
to avoid some problem with other OS than English for the desktop folder, it is not better to do it this way?
 _tempPath =  Environment.GetFolderPath ( Environment.SpecialFolder.Desktop ) + Path.DirectorySeparatorChar + filename;