locked
Custom actions for a product upgrade RRS feed

  • Question

  • User-35181217 posted

    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)

    Saturday, June 6, 2009 4:04 AM

Answers

  • User809300247 posted

     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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 11, 2009 2:06 AM

All replies

  • User809300247 posted

     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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 11, 2009 2:06 AM
  • User-35181217 posted

    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!

    Tuesday, June 23, 2009 10:59 AM