none
Set Up(.msi) problems. RRS feed

  • Question

  • Hello,
            I develop  a set up (.msi file) using c#.net 2008 and .net framework is 3.5.
    1)If the msi file is installed, No probelms happend, i will be installed.
    2)after the installation, If i click on the same msi file, then it will show the
           Repair and remove window.Here we have two options Repair the set up and remove the set up.
    Up to this i have no problems.

    3)I rebuild a new msi file.
        The new msi file is  clicked for installation ,but  if the previous msi file is already installed.Then I got a mesage like,
    "Another  version of the product is already installed" .To Configure, goto Add/remove  in control panel. Instead of this,
    I want to show the Window like Remove and repair window.

    Thanks
    Dileep.
    Tuesday, June 2, 2009 8:45 AM

Answers

  • You need to use RemovePreviousVersions.

    http://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/
    Phil Wilson
    • Marked as answer by Linda Liu Thursday, June 11, 2009 9:44 AM
    Tuesday, June 2, 2009 9:37 PM
    Moderator
  • Hi,

    In order to understand the behavior of MSI based installs, you need to understand the following terms with respect to a MSI file:

    1. ProductCode - This is a GUID which relates to a particular version of the product that you are installing. This should be changed for every new version. In fact, when you change the version of a product using Visual Studio, it automatically prompts you to change the ProductCode.

    2. UpgradeCode - This is a GUID which should remain same for all versions of your product if you want to relate all of them to a single product. This is important for upgradations. When you install a higher version (say 2.0.0) of your application over already installed lower version (say 1.0.0), the higher version will uninstall (upgrade) the lower version of your product if same UpgradeCode is set for both versions and RemovePreviousVersions has been set to true in Visual Studio.

    3. PackageCode - This is a GUID which defines a unique MSI package. Whenever we build a setup type project in Visual Studio , it creates a new MSI file with a nwe PackageCode. We cannot change the packageCode manually using Visual Studio. This is the one that plays a major role in Repair/Remove operations.

    You are not getting Repair/Remove window because the MSI that is already installed has a different PackageCode than the MSI that you have rebuilt. Because of this, when you install the rebuilt MSI, it does not ask you to Repair/Remove as the installer treats it as a different package even when the versions, ProductCode and UpgradeCode are same.

    I hope it clears your doubt,
    Sumit

    [Please do not forget to mark as answer for a correct reply.]


     
    • Proposed as answer by sumitlathwal Wednesday, June 3, 2009 3:57 AM
    • Marked as answer by Linda Liu Thursday, June 11, 2009 9:44 AM
    Wednesday, June 3, 2009 3:56 AM

All replies

  • You need to use RemovePreviousVersions.

    http://www.simple-talk.com/dotnet/visual-studio/updates-to-setup-projects/
    Phil Wilson
    • Marked as answer by Linda Liu Thursday, June 11, 2009 9:44 AM
    Tuesday, June 2, 2009 9:37 PM
    Moderator
  • Hi,

    In order to understand the behavior of MSI based installs, you need to understand the following terms with respect to a MSI file:

    1. ProductCode - This is a GUID which relates to a particular version of the product that you are installing. This should be changed for every new version. In fact, when you change the version of a product using Visual Studio, it automatically prompts you to change the ProductCode.

    2. UpgradeCode - This is a GUID which should remain same for all versions of your product if you want to relate all of them to a single product. This is important for upgradations. When you install a higher version (say 2.0.0) of your application over already installed lower version (say 1.0.0), the higher version will uninstall (upgrade) the lower version of your product if same UpgradeCode is set for both versions and RemovePreviousVersions has been set to true in Visual Studio.

    3. PackageCode - This is a GUID which defines a unique MSI package. Whenever we build a setup type project in Visual Studio , it creates a new MSI file with a nwe PackageCode. We cannot change the packageCode manually using Visual Studio. This is the one that plays a major role in Repair/Remove operations.

    You are not getting Repair/Remove window because the MSI that is already installed has a different PackageCode than the MSI that you have rebuilt. Because of this, when you install the rebuilt MSI, it does not ask you to Repair/Remove as the installer treats it as a different package even when the versions, ProductCode and UpgradeCode are same.

    I hope it clears your doubt,
    Sumit

    [Please do not forget to mark as answer for a correct reply.]


     
    • Proposed as answer by sumitlathwal Wednesday, June 3, 2009 3:57 AM
    • Marked as answer by Linda Liu Thursday, June 11, 2009 9:44 AM
    Wednesday, June 3, 2009 3:56 AM