Custom actions for a product upgrade

Last post 06-23-2009 10:59 AM by staplefordbill. 2 replies.

Sort Posts:

  • Custom actions for a product upgrade

    06-06-2009, 4:04 AM
    • Member
      212 point Member
    • staplefordbill
    • Member since 07-15-2003, 10:57 PM
    • United Kingdom
    • Posts 51

    I've already raised this but in the wrong forum so I'll try again:

     

    I'm using a Deployment Project in Visual Studio 2008.  I have a custom action on the Install event to create a database and configure mail settings when the web application is installed.  If however I install a newer version of the application, the custom action for the new version fires and I don't want it to.  How can I stop this other than running msiexec and passing in a parameter such as "upgrade=true" to the msi file?

    I set the condition "not Installed" on the Install action, but it makes no difference.  An old post explains why:

    Understand that "Installed" means mainly "is my ProductCode
    guid already installed", so if you change that guid (as you *must* for
    RemovePreviousVersions to work) "Not Installed" is a meaningless test.

    (http://www.dotnetmonster.com/Uwe/Forum.aspx/vs-setup/1210/Not-Installed-launch-condition-backfired-with-Visual-Studio-Installer)

    Bill.
  • Re: Custom actions for a product upgrade

    06-11-2009, 2:06 AM
    Answer
    • Participant
      844 point Participant
    • Nowall
    • Member since 12-19-2007, 9:53 AM
    • Posts 108

     When executing .exe, the custom action will be invoked. You can try to set a flag in target machine, and check this flag to determine whether to install database.

    Please make the reply as answer if it helps!
  • Re: Custom actions for a product upgrade

    06-23-2009, 10:59 AM
    • Member
      212 point Member
    • staplefordbill
    • Member since 07-15-2003, 10:57 PM
    • United Kingdom
    • Posts 51

    Yes, that worked.  In the Install custom event, I check for a WebsiteInstalled flag.  If it's set then I know a previous version of the app is installed and continue with the the upgrade logic.  If it's not set then I set it and continue with the full installation logic.

     Thanks!

    Bill.
Page 1 of 1 (3 items)