none
Visual Studio Setup Project - Upgrade to new version at setup RRS feed

  • Question

  • Hi,
    I have created a setup project with Visual Studio 2008.
    At the beginning I built the setup without incrementing the setup version number and changing the product code.
    But when the user installs a new version of the setup, he or she has to uninstall the old version manually before to continue.
    So I changed the setup:
    Now, the setup version and the setup product code are changed on every build.
    So, if the user installs a new version, the old binaries are overwritten by the setup without showing any information.
    How can I force the setup to show some window during the installation, where you can choose if the old version should be upgraded or not?

    Regards,
    Stefan
    Wednesday, November 18, 2009 11:17 AM

All replies

  • Hi stocki50ccm,

    We can set the RemovePreviousVersions property of the Setup Project to true to have the msi package automatically uninstall the old version when a new version is installed. You can get more about this property from:
    http://msdn.microsoft.com/en-us/library/y63fxdw6(VS.80).aspx

    Let me know if this does not help.
    Aland Li


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    Friday, November 20, 2009 9:04 AM
    Moderator
  • Hi Aland,

    The automatic uninstall of the old version already works.
    But I need a dialog with the options Upgrade or Remove so that the user can choose if the old version should be upgraded or uninstalled.
    Is this possible with Visual Studio?

    regards,
    Stefan
    Friday, November 20, 2009 10:30 AM
  • I created a setup project in VS 2008 for a .NET application.
    We use continues integration.
    So every build the folloowing items are updated:
    - version of the setup project
    - product code of the setup project
    - version of the DLL which are installed

    When I start the setup there is no way to choose bedween upgrade to new version,
    remove the old version or exit setup.
    So I need a Dialog with the options Upgrade, Remove or Exit. Is this possible with Visual Studio?

    regards,
    Stefan
    Monday, November 23, 2009 2:00 PM
  • There is no dialog that does that in Visual Studio setups, no.
    Phil Wilson
    Monday, November 23, 2009 6:40 PM
    Moderator
  • Hi Phil,

    Thanks for your answer.
    Is there any other way to do that?
    Tuesday, November 24, 2009 7:45 AM
  • Hi stocki50ccm,

    You can add a custom action in the Setup Project, build the project to generate a msi package. Then you can use Orca to open the msi file and move the custom action before the installation start to copy files. You can follow the document below:
    http://www.codeproject.com/KB/install/msicustomaction.aspx
    Please pay attention to the step 5.

    Regards,
    Aland Li
    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    Wednesday, November 25, 2009 3:50 AM
    Moderator
  • Hi Aland,

    Thanks for your answer.
    My problem is, that I don't want to edit the msi package, because the setup
    is built on a build server two times a day.

    Regards,
    Stefan
    Monday, November 30, 2009 2:55 PM
  • Hi stocki50ccm,

    As far as I know, the Setup Project does not directly support running a custom action before the files are being copied. So if you cannot modify the msi package using the orca tool, you need to find other tools to create a msi package.

    Regards,
    Aland Li
    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    Tuesday, December 1, 2009 6:22 AM
    Moderator
  • Hi Aland,

    Thanks for your answer.

    Is it possible to put a message on the first screen of the setup that tells the user if an old version already installed, it will be automatically removed and then the new version will be installed??

    Regards,
    Stefan
    Friday, December 11, 2009 8:19 AM