Prevent Windows registry key from removing when upgrading application to newer version - visual-studio-2010

I have a registry key (in HKEY_LOCAL_MACHINE hive) which must be keeped from older version of the application to the newer, but removed when user completely uninstalls my application. I'm using Visual Studio 2010 setup and deployment project.
I know about increasing build version of the installation package, build version of assemblies and upgrading 'ProductCode'(but keeping 'UpgradeCode' the same). 'RemovePreviousVersion' is set to true. The problem is that when user installs the new version, registry key from previous version is removed (with important data in it) and recreated again. It seems that MSI uninstalls my application before installing the new version. I was tried to set 'RemovePreviousVersion' to false but in this case new version installed independently and both versions of the application appear on the same machine.
It seems to be very common scenario but I couldn't find how to keep registry keys between different versions. If you know how to make this modifying MSI package using Orca it is not a problem (as Visual Studio is very restricted in creating installation packages).
Thanks in advance.

A late scheduling of RemoveExistingProducts action will fix your problem.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa371197(v=vs.85).aspx

Related

MSI to show uninstalling of old project

I have an Installer project for my application in Visual studio 2010. I was successfully able to make it uninstall the older version of the application before installing the new one by
1. Setting RemovePreviousVersion to false
2. Setting DetectNewInstaller to true
3. Incrementing the project version
4. Creating new product code
Now when I double click my application for installation, I want the the setup wizard to also show that the currently installed application is getting uninstalled before showing the progress bar for fresh installation. How can I do this?
That might be a typo, but you need RemovePreviousVersions=True for the previous version to be uninstalled, as the actual name implies!
Otherwise, this is just the way VS (and most other tools) behave because Windows Installer's upgrades are like that, embedded in the new install. That progress bar behavior includes the uninstall of the old product, not just the fresh install, and the uninstall occurs after the new product has been installed. It's all one transaction.
With another tool you could build your own dialog that says there's an upgrade going on based on the detection of the older product, but generally speaking that's quite rare. Customers typically know what they have installed, and they are well aware that they are about to install an upgrade, that seems to be the assumption behind the default behavior.

Oracle.DataAccess.dll not in Visual Studio 2008 ".NET" reference list

I've got two Windows XP machines with both Visual Studio 2008 and Oracle Client 10.0.2.0.1 installed. One is a development machine and the other one a dedicated build machine. The machines were probably not set up the same way.
On my development machine, I've included Oracle.DataAccess.dll (version 10.2.0.1.100, not the asp.net v 2.x one) in a C# project. Note that the System.Data.OracleClient dll is insufficient (I don't properly remember why, I think it had something to do with bulk insertion/selection).
I was able to select that DLL from the Project->Add Reference dialog in the .NET tab.
Now on the build machine, I cannot build the project as it cannot find the .dll. The .dll is located in the same folder as on the development machine, (<installdir>\10.2.0\client_1\bin\Oracle.DataAccess.dll) in the same version.
The .dll is however not displayed in the .NET tab.
I tried (re)installing ODAC with ODP.Net for VS 2008 but it didn't change anything. When looking at the registry, I realized that my Development machine had a registry folder
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\AssemblyFolders\ODP.Net]
which points to the bin directory of my oracle installation. This entry does not exist on the build machine. Unfortunately, manually adding the key did not make Visual Studio find it (I've tried rebooting).
My main question is:
What do I have to do so the Build Machine automatically finds the Oracle.DataAccess.dll? (Note: manually adding the .dll each time the solution is changed would work, but that is not an option).
You can maybe help me out already by answering one of the following subquestions:
Which installer sets that registry entry?
Do I maybe have to reinstall the whole Oracle Client in a different configuration? (e.g. ADMIN)
Do I need more than just the Oracle Client, ODAC and .NET installed?
I managed to resolve the issue by completely uninstalling the Oracle Client on the build machine, then doing a fresh installation using the Administrator configuration rather than the Developer configuration.
Note that installing the Administrator configuration on top of the existing oracle installation did not work.

Visual Studio Deploy Solution Version Number

Are there any hacks around the normal (and infuriating) Visual Studio Deploy Solution numbering system?
I have many assemblies I'm deploying with a Major.Minor.Build.Revision scheme for assembly versions. When I set the version for the setup.exe/Installer.exe, I can only do Major.Minor.Build. I'm not allow that fourth section for revision. This causes an issue because I key build numbers off date. So if my build is 906 for 09/06/11, I can only install (not uninstall and install, just install) once a day as it will see a previous version with the same version number and say a previous version is blocking install.
Besides using InstallShield (can't use this due to client requirements), are there any hacks to get the normal deploy solution to accept four part versions?
Windows Installer ignores the fourth Product Version field. So as long as you are using MSI packages, there's not much you can do. The old build needs to be manually uninstalled before installing a new build.

VS 2010 Major Publish Version Change - New Application or Overwrite Previous Version

Using Visual Studio 2010 Professional Windows Form App. Currently a ClickOnce application has only been incrementing the Revision value (1.0.0.15). Settings are to Automatically increment revision with each publish. Client app updates automatically before application opens.
If I manually increment the Major value (2.0.0.0), is this going to install another version of the application or just overwrite/update the existing version on a client's machine? I recall using the express version and this happened.
If you are using the minimum version in the Updates dialog, or your application is online only, ClickOnce only keeps one version on the client machine.
If you are not pushing the update as required (minimum version is filled in), and your application is online/offline, ClickOnce keeps two versions on the client machine. This means that the user can go to Add/RemovePrograms and back out the most recent version if needed.
ClickOnce installs whatever version number is in the deployment manifest (.application file) in the root folder of the deployment folders. If you change your version to 2.0 and deploy it, it will install 2.0. If you then decide you don't like it and want to go back, you can pull an earlier version of the .application file out of one of the Application Files folders and copy it to the root folder, and the next time the user runs the application, it will install that version. This doesn't work if you are pushing updates as required (min version).
If you want to run multiple versions of the same application on the same machine, you have to change the assembly name, the product name, the publishing folder location, and the installation URL.
Incrementing any part of the version number will not install another version of the application. It will simply update the existing installation.

How Do I ensure that my MSI project is built into a package that is compatible with a specific msiexec version?

I have a windows installer (MSI) project. I want to ensure that when i build it , it will be compatible with msiexec version 4.5.
Normally, compatibility is a problem with a lower verions. Windows Installer 4.5 is the latest version of windows installer and I would expect it to be backward compatible. So, most likely things that you are using will be supported.
What you should worry about is compatibility with older versions of Windows Installer. Most IDEs for creating installers would let you know if you are using something that is available only after some version of Windows Installer onwards.
If your IDE does not provide this feature then you should be aware of what all you are using in your MSI and make sure thats its available in the Windows Installer version you intend to you target with your installer.
That depends on the tool you use to build the MSI, you should be able to specify the required installer version there.
For example, WIX, which I frequently use has a "InstallerVersion" attribute at its "Package" XML Element. There I can specify which Windows Installer Version is required.
(Currently I do not require Installer 4.5 as it isn't deployed everywhere yet and I don't want to require customers to install the new installer on XP.)
Update:
Re-reading your question I get the impression that you use a Visual Studio Installer project. I believe you can't configure the Windows Installer Version there, but it defaults to Windows Installer 3.whatever (I'm not sure about the specific minor version). Setups created with that are compatible with Windows XP in any way.
I don't believe you WANT to require a newer version of Windows Installer when you use a Visual Studio setup project, as the setup project is very limited in what it can do. So to require a newer version of the installer you probably have a specific feature in mind (for example elevation on Vista). To use that feature you'd need a better tool to build installers anyways (like WIX, or Installshield or Wise or ...)

Resources