-1

Let say i have publish an Windows form application which has 2 labels and 2 text field(Name, Email) ,a SAVE button and a button name UPDATE (file selector).Again let say i have two method in my program.

public void Func1(){
....
}
public void Func2(){
....
}

I have published my form application by Windows installer

Now let say i need to update/ add some features in my application(i want to add another field name Phone Number with it corresponding level, text-field, database update etc.. ) and i want to update my Func2 , add another function (lets say public void Func3()) . I want my update button to fetch this update from a file.My question is how can i make this update file and make this whole process work.A simple example with short project will be fine for me.

Community
  • 1
  • 1
  • 1
    what have you tried..? have you tried a google search on AutoUpdates for a winforms application or something..? – MethodMan Sep 15 '16 at 18:50
  • 1
    dont want to auto update.. just want to update manually by file –  Sep 15 '16 at 19:00
  • [Automatically Update Windows Forms Application](http://stackoverflow.com/questions/32338673/automatically-update-winform-application-c-sharp) – Reza Aghaei Sep 15 '16 at 19:09

1 Answers1

2

Well, you'd end up replacing DLLs and EXEs most likely. You probably don't want to update the program whlie it's running so you'd do it with another utility.

1) You could use ClickOnce (https://msdn.microsoft.com/en-us/library/142dbbz4(v=vs.90).aspx)

2) You could also do it yourself by having your program launch an external updater program (with arguments if needed) that you create and when the updater launches, you would then have it close your main application and then have it replace the files you need it to replace. After that, it could have close itself and launch your program again, if you wish.

When you say do database updates, if you're using Entity Framework with Automatic migrations enabled then that could do it for you when you change update the database model. Or you could ship your updater with SQL scripts to run.

KSib
  • 893
  • 1
  • 7
  • 24
  • 1
    Thank you for your Answer, I wish i have more reputation so that i could give up vote... :( ...[How to create a ClickOnce application | lynda.com tutorial](https://www.youtube.com/watch?v=t4BTLdIMYEY) –  Sep 17 '16 at 00:37