How to properly update an existing application? - c#

The application I'm working on is almost finished but we've come to a crossroads. At multiple times in the future, we'll have to update the application. We could easily just replace the application with the new version as well as the SQLite database, but at the same time we don't want to do that. Essentially, our application has three parts:
1. Application
2. Reports DLL (used by the Application)
3. SQLite database.
Our updates to the application are going to be less frequent than that of the Reports DLL and SQLite database. We may need to add a report, meaning we need to add records to the database and replace the DLL. However, I'm not finding an install package in Visual Studio 2008 that allows you to add logic to it (not sure one even exists). I could probably create my own but if there's something 90% built by Microsoft, I'd rather use that. So my simple questions are:
Can you add screens/logic to setup projects in Visual Studio 2008?
1a. If you can, does anyone have a good tutorial or link that I may be able to use? Thanks.
The reason we don't want to replace the DB is because there may be information in there that they are working on.

Yes you can normally add new dialogs to visual studio setups projects. Here's a tutorial from codeproject on how to do this.
As an advice you can migrate your setup packages to WIX, it's free, open source and a lot more flexible.

You can also handle the updates to the reports and database when the application starts.
So after an upgrade via the installer, the first time the application is run, it will update the database, add any new records etc.
Its often easier to add upgrade logic in the application rather than in the installer, and as it only needs to perform the upgrade once, it will not have a negative effect on your applications general startup time.

Related

Best way to creating setup of C# application

Hi i am recently working on a c# window form application. I have done the all stuff and noe it's time to deploy the application, But i am unable to activate the visual studio installshield feature. Can any one here able to tell me any alternet way to create me a setup file of my application. Like Innosetup compiler or other.
Visual Studio Setup Project is easy to work with and is available for both VS2013 and VS2015 in the form of Visual Studio Extension (separately from the default VS installer). Download figures suggest that a whole lot of people are using this extension.
I prefer to use InnoSetup, which is free for any use including commercial.
You can have a UI to make creation simple, but if you want really complex functionality you can write code to create those functions. There is a thriving community of developers that use and contribute to the product, so finding examples is usually easy, but you do have to write your code in Delphi / Pascal.
On the other hand, all the Microsoft options are overly complicated and difficult to get working sensibly so I am pleased to avoid them. Corporate installers are good but incredibly expensive... so really there is no comparison. Ease of use, and free - what more could you ask for?
I should point out that I have absolutely no connection with the product other than that I have used it for many years for many products and have absolutely no complaints.
That depends on your needs.
Mostly you can just create an msi installer with an installer project type on VS.
The problem is that a lot of software distributors require an exe file type. For that you can use the free (limited ) edition of install shield : http://learn.flexerasoftware.com/content/IS-EVAL-InstallShield-Limited-Edition-Visual-Studio
It has everything that a standard installer needs and I use it to distribute my software.
I tried other free msi to exe programs but none of them worked well (this was a while a go and maybe things changed since then)

How to develop and deploy both test and production version of the application at the same time

I would need some advice how to set up my development process so that I can easily develop and deploy both the test and the production version of my application.
Current state of my project:
Visual Studio 2010, C#, .NET 4.0, WinForms application, SQL Server 2008
Mercurial source control
Click-Once deployment to a shared folder in our company's intracet
Only one solution in Visual Studio (typical workprocess: make some changes -> publish, repeat)
What I would like to have:
Two separate environments - one for production application and one for a test application, which is the same a production application but with added features, which may or may not be added to the main application.
I would like to publish both applications with Click-Once (for example App and AppTest)
I would like to have an option to simply 'move' changes from Test application to Main application, or simply discard them.
My plan is to clone my existing repository into a new one (from App to App-Test for example) so I will end up with two seperate codebases. Then the new features would be implemented and published in the App-Test application. When the users are happy with the testing version, I would somehow move changes from App-Test repository to App repository (probably with the Mercurial's merge command) and then publish production application...
Is this a the right way to achive this? Any other suggestions or links to some resources? Could this be done within the same repository somehow?
This may be one repository, but with 2 (or more) brunches. For example, we use git for source control and 3 brunches - develope, test, release. Features (or tasks) started their life in develope brunch. Then they moved (merge) in test, and after testing moved in release.
But you may get problem with database changes (are you use some ORM?), because you'll need to have 2 different database. If you don't use some ORM, merge database may be difficult. But I think that, for example, entity framework (code first) saved your time.
Good luck!
Two separate environments - one for production application and one for
a test application, which is the same a production application but
with added features, which may or may not be added to the main
application.
Single branch with MQ on top of it, there "production" app is all changesets, "test" is "production" + applied patches of MQ (one patch per developed feature)
I would like to publish both applications with Click-Once (for example
App and AppTest)
I know nothing about Click-Once, out of ideas
I would like to have an option to simply 'move' changes from Test
application to Main application, or simply discard them.
Finish MQ-patches to convert into permanent changeset, just delete obsolete patches

Make changes to c# program without loosing older code

I'm a hobbyist programmer and I've created an application for my office. Every so often I need to improve the code, add features or fix issues that come up under certain circumstances - I've found bugs or ineffective coding even after 3-4 months of heavy usage of the application. The thing is that whenever I modify the code, visual studio saves the changes. This means that if I want to use the program I'll have to be really fast in coding and debugging or it won't build - and I won't be able to use it...
Is there any way to keep the old version of the program without having to save the complete project folder elsewhere? Like creating a new version but keeping the option to go back to the old - working - one...
What you are looking for is called source control.
There are many systems out there, two popular ones are subversion and Git.
Used properly, you will have a full history of each file you have in your project.
There are two other answers here regarding source control at the time I write this, but there is another angle on this as well.
You're executing your production copy from the development directory. Don't do this.
When you have developed the program to a stable version, make a copy of it somewhere else and use that copy. In this way you're free to keep developing on the software without destroying your ability to keep using the existing stable version.
As for source control, you should definitely use that as well if you're not already doing it. It would, among other things, allow you to go back and hotfix the stable version with minor bugfixes while still doing major rewrites of the software, as well as the features others here have mentioned, full history of your project, "unlimited" undo, etc.
I'm not sure what you mean that Visual Studio saves the code when you modify it. It does by default save when you build, but I don't think it saves while you're typing.
Anyway, what you're looking for is called a source control system.
You can try Team Foundation Service from Microsoft.
It works fine and you can share youre project whit colleagues.
http://tfs.visualstudio.com/
EDIT:
This is a free of charge option you can use, until you want to share youre project with more than 4 persons!! than you have to pay for TFS
You need source control.
If your project is open source you can use codeplex, it's an open-source Website where engineers and computer scientists share projects and ideas. Its features include wiki pages, source control based on Mercurial, Team Foundation Server or Subversion (also powered by TFS), Git,discussion forums, issue tracking, project tagging, RSS support, statistics, and releases
If you don't want to share your code you can use Team Foundation Server

how to manage Project in c# , ASP.NET MVC when i have a new copies and have something feature in it?

i have a project where i do something i have same copy from another who have do something in it later i have a thing to do currently.
so that's three copy and i am unsure that i am not confused with it. sometime i call wrong copy for finding the thing i want from them.
without using any software outside our office window any trick to manage all project or how i can manage them and make them one copy.
the same problem with some other problem come with when the same script used in two software , website who are used same script with have a small difference in both.
so i want to know how exactly all other manage them. i want to have a answer with .net plateform.
There are several source control solutions that have plugins to integrate directly with Visual Studio. I would recommend looking into Subversion. Currently at my office we use Vault, but it has some short comings, especially when it comes to renaming or moving a file and then editing it prior to a check in.
http://ankhsvn.open.collab.net/
http://www.sourcegear.com/vault/
I recently started a small pet project. It's written in C# with ASP.NET MVC3. As it's grown, my needs for source control also has grown. Here's what I've done:
Day one, I placed my project in a Dropbox folder. That way, I could reach my project files from all my computers (and even my iPhone).
A few weeks later, when I first had to make some serious changes and neede a fallback, I created a Mercurial repository in my Dropbox folder and commited all my code. I've got a blogpost on that here: http://csharptutorial.blogspot.com/2011/06/using-dropbox-with-mercurial.html. Mercurial is a great versioning system, because it doesn't require a server installation and your repository is copied in full to all locations where it's checked out.
Now, I'm looking at moving my project over to BitBucket (http://bitbucket.org/) where you also share and discuss code with others.
A good alternative to Mercurial is Git, using github.com in stead of bitbucket.org. Both have a learning curve, but they both represent modern version control tools and is well worth having a look at.
Source control and discipline.
You need to get an approach and method for managing your source. A source control system is essential for this. I use SVN and Ankh, as does Clayton.
However, you need an approach for using this. I always have branches. You can have development branches and merge these changes into a release branch when your code has passed all the tests. This way takes a discipline and time, but you need to do this to build quality into your system.

Any good solution to deploy ASP.NET web application updates to multiple servers?

I have a client that has an ASP.NET web application they sell to people that either in turn host it with our company or elsewhere. The end result is that source code and database setup can be spread across multiple servers, so when we push updates, we have to push manually by copying over source code and then updating the databases as needed. Are there any good alternatives out there for doing this to multiple servers?
If you're using Visual Studio 2010, then you could consider the new Web Deployment Package technology. See ASP.NET Web Application Project Deployment Overview
, which explains how you can also deploy IIS settings and even necessary databases as part of the deployment.
Have a look at the video on this page. It gives a decent introduction to MSDeploy.
An MSI would probably work best. Odds are, your customers will want to be in control of when/if the update happens, and an MSI is probably the simplest mechanism for giving out such an update.
John and Trip have great answers. I just wanted to add one little thing, unless this is an open source project:
Don't deploy source code.
Your client's app should be compiled and obfuscated.

Categories

Resources