Click here to Skip to main content
15,887,368 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I developed wpf application and create exe and installed. now i want to update that installed application in running time.

In wpf window page i kept one button when i click that button it should update latest changes in installed location.

i refereed and done below link:
"https://www.codeproject.com/Articles/134787/C-NET-Autoupdate-Application-Launcher"


What I have tried:

i create virtual directory in IIS and new exe kept in that virtual folder.
and in wpf application download that new file in iis. and checking current version and updated version number,till this application working fine.

now am try to installing(updating) downloaded new exe file.

exePath=c:\folder\setup.exe
System.Diagnostics.Process proc = System.Diagnostics.Process.Start(exePath)

when i try above code its showing error [another version of this product already installed.installation of this version cannot continue.To configure remove the existing version of this product,use Add/Remove Program on the Control Panel]

Please help me out this problem ASAP.
Thanks in Advance.
Posted
Updated 18-Feb-20 8:28am

If you have a problem with code from an article then you should use the article forum for your questions. That way the author of the article can help you.
 
Share this answer
 
Quote:
How to do auto update in already installed and running WPF application

Basically for update, 'installed' is mandatory, 'running' is forbidden.
Because Windows loads parts of your app as they are needed, the app file stay open and thus can't be updated as long as it remain opened.

The trick is to have a second app which is an updater.
The update procedure is something like:
App: start
App: ...
App: click Update button
App: check for updates
App: download update.
App: update Updater app
App launch Updater
Updater: close app
Updater: update app
Updater: relaunch app
Updater: close updater
App: ...
 
Share this answer
 
v3
Drop the custom update launcher mumbo jumbo and just use ClickOnce. The author wrote about this back in 2010 when ClickOnce was pretty fresh, but many issues have been fixed and it's pretty smooth now.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900