How to uninstall the RTM runtime when you install SP1
Peter Mullen is today's guest writer. I don't anticipate this workaround will be required when SP2 is released but we won't know for sure as that work isn't defined at this point.
Those who have deployed the runtime RTM version know that you have to remove it before installing the SP1 runtime. This post describes how to chain that action as part of your normal runtime install.
Technique
Use a chained install to call Msiexec and pass in the product code to uninstall the Access Runtime before you install the new runtime.
Prerequisite knowledge
More information on what a chained install is can be found here:
http://msdn2.microsoft.com/en-us/library/bb687991.aspx
More information on how to use Msiexec to uninstall Office files can be found here:
http://support.microsoft.com/kb/296067/en-us
Details
If you use the setup wizard to deploy an application, you can package up the SP1 version of the runtime. This actually creates a chained install to not only install your application, but the runtime as well. This not only packages up the new SP1 runtime into your install, it also modifies the Setup.ini file. This file tells the install package what to install, and in what order.
You can further modify this file to use Msiexec to uninstall the runtime version.
After you make a setup file, you can find the.ini file in the Files\setup folder of your package directory.
![clip_image002[4]](http://blogs.msdn.com/blogfiles/access/WindowsLiveWriter/HowtouninstalltheRTMruntimewhenyouinstal_6A75/clip_image002%5B4%5D_thumb.jpg)

Once you are here, you can simply edit the setup file. If you have included the runtime in your package, you will already have a chained install. Rename this to [ChainedInstall_2]. Then add on Chained install one that I define here. This is how your chained install should look.
[ChainedInstall_1]
TaskName=Uninstall Access RTM Runtime
TaskType=Exe
Path=msiexec.exe
IgnoreReturnValue=1
cmdline=/passive /x {90120000-001C-0409-0000-0000000FF1CE}
[ChainedInstall_2]
TaskName=Access SP1 Runtime Setup
TaskType=exe
Path=\Files\AccessRuntime.exe
IgnoreReturnValue=0
cmdline=/passive
Details of the Chained install 1
- TaskName is for logging purposes.
- TaskType defines the type of task you are using. You are calling Msiexec.exe in this example.
- Path defines the relative path to the file you want to run.
- Since msiexec.exe is in users default path directory by default, you simply need the file name.
- Ignore return value defines what to do in case of an error.
- In this case I have set it to 1. This means that the install will continue even if there is an error in this part of the chain. It needs to be set to 1 in case the user has already removed the RTM of the runtime, and there is nothing to uninstall.
- The cmdline passes in arguments to Msiexec.exe.
- Passive is a switch that shows the user what is happening, but does not give the user an option.
- You can remove this switch if you want to make sure your user clicks on “yes” to uninstall the previous version of the runtime.
- You can change this switch to quiet if you would like the uninstall of the RTM runtime to be minimized.
- x tells Msiexec that you are uninstalling a product
- The large number is the product code for the runtime.
- It is important to note that the product code for the RTM and the SP1 of the runtime are the same. So if you customer has updated to SP1 already, this will uninstall and reinstall the same thing.
You can test to make sure you have the correct version by looking at the file properties in your add / remove programs dialog. If the version does not match the version is not 12.0.6237.1003, you do not have the SP1 runtime.

Possible known issues
If your user finds and deletes the msi file for the Runtime, this automated process won’t work. This will cause your update to fail. If you think this might be an issue, you can take out the passive switch and the user will be aware that there is an error in uninstalling the SP1 runtime.