Installer problem when deploying application
-
I am using the Visual Studio 2003 Setup Wizard in the Setup and Deployment Project. I create a Setup for windows applciation. The generated output is a .msi file which I want to be able to distribute. When I try to install a new version of my application over an existing one I get the following warning. "Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel." In the Deployment Project DetectNewerInstalledVersion = True RemovePreviousVersions = True One strange thing is that if I Right Click on the Deployment Project and choose Install I do not have any problems - all installations are OK. It is only when I double click on the generated .msi file that the problem occurs. I do not know if there is any use of it but I have Windows Installer 3.1 (the latest vesion I think) Does anyone have any suggestions? Thanks,
-
I am using the Visual Studio 2003 Setup Wizard in the Setup and Deployment Project. I create a Setup for windows applciation. The generated output is a .msi file which I want to be able to distribute. When I try to install a new version of my application over an existing one I get the following warning. "Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel." In the Deployment Project DetectNewerInstalledVersion = True RemovePreviousVersions = True One strange thing is that if I Right Click on the Deployment Project and choose Install I do not have any problems - all installations are OK. It is only when I double click on the generated .msi file that the problem occurs. I do not know if there is any use of it but I have Windows Installer 3.1 (the latest vesion I think) Does anyone have any suggestions? Thanks,
-
I am using the Visual Studio 2003 Setup Wizard in the Setup and Deployment Project. I create a Setup for windows applciation. The generated output is a .msi file which I want to be able to distribute. When I try to install a new version of my application over an existing one I get the following warning. "Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel." In the Deployment Project DetectNewerInstalledVersion = True RemovePreviousVersions = True One strange thing is that if I Right Click on the Deployment Project and choose Install I do not have any problems - all installations are OK. It is only when I double click on the generated .msi file that the problem occurs. I do not know if there is any use of it but I have Windows Installer 3.1 (the latest vesion I think) Does anyone have any suggestions? Thanks,
You can force a reinstall over an existing installation by doing the following: Make sure that all newer files have a higher version number than the existing files. Run the msi with the following command line parameters: msiexec /i [Fully qualified path to your new msi] REINSTALL=ALL REINSTALLMODE=vomus You can modify the bootstrapper exe to run the install with the above command line. There are a couple of limitations to this method: This forces your new msi to run in reinstall mode, and overwrites all existing files where the version has changed. If older files exist that are no longer needed, this method does not account for removing them, and in fact you will still need to add the unneeded files to your new msi because they need to be present so that they are entered in the uninstall log. Otherwise if your user does a complete uninstall, old files not installed by your new msi will be left on the target machine. Ditto for all other resources like registry entries, etc. If your new install needs to get user input from dialogs, you may run into problems. An alternative to forcing a reinstall is to modify the bootstrapper to first run the existing msi in Unistall mode, then launch your new setup. You can get the parameters needed to run an uninstall from the registry. Finally, Windows Installer does support "true" product upgrades, which are not the same as simply trying to force a reinstall over an existing product. But if your original setup was not correctly authored with an UpgradeCode, among other things, then this will not work. Describing how to author msi's to support future upgrades, and how to author the associated upgrade msi's is beyond the scope of anything I could answer on this forum. Robert
-
The setup.exe file is the file that will check for the previous versions ,click it and it will work as well.
-
You can force a reinstall over an existing installation by doing the following: Make sure that all newer files have a higher version number than the existing files. Run the msi with the following command line parameters: msiexec /i [Fully qualified path to your new msi] REINSTALL=ALL REINSTALLMODE=vomus You can modify the bootstrapper exe to run the install with the above command line. There are a couple of limitations to this method: This forces your new msi to run in reinstall mode, and overwrites all existing files where the version has changed. If older files exist that are no longer needed, this method does not account for removing them, and in fact you will still need to add the unneeded files to your new msi because they need to be present so that they are entered in the uninstall log. Otherwise if your user does a complete uninstall, old files not installed by your new msi will be left on the target machine. Ditto for all other resources like registry entries, etc. If your new install needs to get user input from dialogs, you may run into problems. An alternative to forcing a reinstall is to modify the bootstrapper to first run the existing msi in Unistall mode, then launch your new setup. You can get the parameters needed to run an uninstall from the registry. Finally, Windows Installer does support "true" product upgrades, which are not the same as simply trying to force a reinstall over an existing product. But if your original setup was not correctly authored with an UpgradeCode, among other things, then this will not work. Describing how to author msi's to support future upgrades, and how to author the associated upgrade msi's is beyond the scope of anything I could answer on this forum. Robert
Robert, There seems to be a lot of good informaiton there but is beyond my understanding. Could you point me to a tutorial/info on the installer process as used by Visual Studio. (e.g. what is the bootstrapper, how do you author installer scripts, how to access the registry setting, what other installation options do I have?) Does this all have to be done from within Visual Studio. Thanks, Liam
-
Robert, There seems to be a lot of good informaiton there but is beyond my understanding. Could you point me to a tutorial/info on the installer process as used by Visual Studio. (e.g. what is the bootstrapper, how do you author installer scripts, how to access the registry setting, what other installation options do I have?) Does this all have to be done from within Visual Studio. Thanks, Liam
-
Robert, There seems to be a lot of good informaiton there but is beyond my understanding. Could you point me to a tutorial/info on the installer process as used by Visual Studio. (e.g. what is the bootstrapper, how do you author installer scripts, how to access the registry setting, what other installation options do I have?) Does this all have to be done from within Visual Studio. Thanks, Liam
OK, the typical installation process involves first running a program called Setup.exe, AKA the bootstrapper. The bootstrapper is a program written in C++ so that it has minimalk external dependencies and should run on any system that has Windows installed. What the bootstrapper does is to check to see if the .NET Framework is installed. If not, it installs the framework so that the target machine is now ready to run your MSI setup package. Once the bootstrapper has prepared the target machine it launches your MSI. The source code for the bootstrapper is available, so you can modify it to run additional actions before your MSI is launched. In this case that would be probably uninstalling the existing application if it exists. To unistall the existing application and then install your new application, you would perform the following steps: 1) Search the registry to verify the app is already installed. MSI packages are identified by a GUID known as the ProductCode. You have to determine the ProductCode for your app. If the app is installed, there will be an entry in: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ Example. ProductCode is {FB6E8318-B7EA-4392-A7DD-D33295D158B7}. If the product is installed, you will find a registry entry at: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FB6E8318-B7EA-4392-A7DD-D33295D158B7} 2) If the app is installed, uninstall it by running the command line: MsiExec.exe /qb- /X[Your ProductCode] Example: MsiExec.exe /qb- /X{FB6E8318-B7EA-4392-A7DD-D33295D158B7} MsiExec will return a success code = 0 when the uninstall is complete. 3) Launch your new install after msiexec has returned a success code for the uninstall. Now, you have a couple of options on how to proceed: 1) If you are comfortable programming in C++ you can modify the bootstrapper directly to perform the above sequence. 2) If you are not adept at C++ programming, you can get by with minimal modifications to the bootstrapper. Simply change it to run a custom exe file instead of the setup msi at the end of the bootstrapper sequence. Since the NET framework will be installed by the bootstrapper, you can create a custom exe as a NET application that checks the registry, launches the uninstall, and finally runs your new setup. To get started, you need to download the bootstrapper sample project and figure out how to proceed from there. Information about the bootstrapping process, as well as the setup.exe source