Setup project with autoupdate feature vs2010 - c#

I have created a setup project in visual studio. It works fine, now when i make some changes, create new setup file and then try to execute it. It gives me this error.
I don't want user to bother with this step. I want it to update the application or uninstall it first and then install new version.
How could i do this.
Kindly guide.

Windows Installer automatically uninstalls the old version if you increase your package ProductVersion and change the ProductCode. This can be done in the project Properties pane.
If you don't do this, you need to uninstall your old package manually using the Control Panel applet.

Related

Winform Installer Register each version

I build my own Winform and packaging as msi installer with VisualStudio Installer project.
Installer works really well but there's a problem.
Currently I upload patch hourly because there's lots of bug to fix. so users who uses my winapp needs to run installer when updated.
When user runs my installer, on control panel, my program listed on there with each version like following image.
I wish to remove old version and keep newest version on the list.
How can I solve this problem?
This is my installer's property. and I manually config 'Version' property for control version.
Added : I keep RemovePreviousVersions as false because I wish to keep installer settings of "User Desktop Shortcut" and "User Programs Menu Shortcut"

Setup Project not capturing updates

This is my first dabble into Setup Projects.
I have Solution in VS2013.
Within the solution is a C# Winform project, and a Setup Project.
On first build, I can use the setup.exe to install my application on my laptop; no issues.
However, when I make changes to my Winforms, these are not reflected by any subsequent re-install.
Quite simply, the build does not pass winform changes to the setup package.
To explain:
I make changes to a form, for example I add a label or button.
In my setup project I increase the version number.
VS automatically generates a new Product Code.
Build all.
Copy the setup.exe + msi from the setup project's debug folder.
Paste to desktop.
Execute setup.exe
Install completes successfully.
Control Panel > Programs, confirms the new version number.
Yet running the app, none of my form changes are there !?
Hope someone might be able to explain what's going on, what I am missing !?
Many Thanks
A Visual Studio Installer project will automatically pick up the right version of the application if you add the Primary Output of your application. So that's that.
It could be that Visual Studio does package the new version of the executable, but it does not get installed, because you forgot to increase the executable's version number, too (not just the installer's version number!). AFAIK, Windows Installer replaces files only if the version number differs.
What happens when you uninstall the old version before installing the new version? Do you then see your changes? If that's the case, try increasing the version number before the next update.
Change all version numbers of your hosted application in AssemblyInfo.cs together with Version number and Product code in your installer (Setup project).

Updating application using InstallShield in VS2012

I am trying to update an application using the Install Shield project in visual studio 2012.
I have read tons of articles/stackoverflow questions about it, and every single one gives the same steps for updating an existing application:
Increment product version
Change Product Code
Build Setup
So I do exactly that. First I build my application, then I build the setup. I find the setup, and I run it. It installs the application as expected.
Then I make a minor change to my application (changing the background color for example), then I:
I build the application
Increment Product version from 1.00.0000 to 1.00.0001
Change the Product Code - I Click the {...} to automatically generate a new one
Make sure the Update Code is the same
Build the setup
Go to the same directory I found the setup in before, and run the setup. It indicates that it installs, but then when I run the program, it is the original program - and in my Control Panel > Programs, there is now 2 instances of the application. And in the install directory of the application, it is still the original files.
I have clicked the resequence RemoveExistingProducts, and still the same thing.
edit: I am just using the basic version of InstallShield that came with VS2012
Anyone have any ideas what I am doing wrong? I have absolutely no idea what I am doing wrong...
As stated within the Upgrade Paths section of InstallShield within VS2012:
If you have released earlier versions of your product and you want to ensure that end users are able to upgrade to the current version without manually installing the earlier version and then also installing the current version, use the Upgrade Paths view to indicate upgrade information.
So in order to upgrade any previous installations, you need to add your application's Upgrade Code to the 'Upgrade Paths'. You can do this from the Solution Explorer:
[InstallShield Setup Project] -> Organize Your Setup -> Upgrade Paths
From that tab, you will right-click on the 'Upgrade Paths' option on the left side of the center pane, and select 'New Upgrade Path...'. You will then be presented with an option to select an installer (.exe or .msi) for your project which will populate the Upgrade Code field. Make sure you set the Min and Max Version fields to specify which versions of your application that you'd like your new installer to upgrade. If you'd like the new installer to upgrade any installed version of your application, then simply set the 'Include Max Version' and 'Include Min Version' fields to no.
You should now be set to build your solution, and when running the new installer, you'll find that you will no longer run into the problems you've specified.

Visual Studio 2010 - C# Updater

a couple of weeks ago I made a small application which comes with the Installer, done with V.S.2010 tool. Now I need to upgrade the application, but I'd to deploy it as an update of the previous one.
How should I do? Is there some online doc that I can follow?
Unless you used OneClick technology for your Installer, Visual Studio does not support Install "Updates".
You will need to resend the entire Setup first, ask the user to remove the old one first (you can force this in the Setup project)
If you install the new updatedApp without forcing removing and without installing, it will overwrite all files that the new updateApp has.

.Net Installer repair option

I am working on a project, where I need to give a repair/remove option to my installer [which will be shown at installation time] if the program previously installed. And I need to do it with VS 2008. Please help me on that.
EDIT: Actually for some security reason I removing registry entry for previous installation. So that I can uninstall it from my application only, which is password protected. So thats why I need to customize that repair/remove option. So that it will appear by seeing some specific registry value. How can I do that ?
Thanks.
Just add a Setup project to your current solution. A setup project uses the Windows Installer technology which gives you the repair and remove option for free. Use this type of project when you have a "simple" installation. If you want more control (custom dialogs) you should install Wix. It plugs into VS and you can define an installation file in XML which is then compiled to a Windows Installer package.
I believe WIX is more suitable for your requirements where you have more control over your installer.
If you only want your application to be uninstalled only from your application, you can probably add a custom action (or Condition) in your installer which validates if the installer action (Repair/Remove) was launched from your application and not from ARP.
One way would to be pass a Custom Property from your application to the msiexec which is tested in your custom action (or Condition) and doesn't let the installer process proceed if executed without setting this property.

Categories