none
Add-in development for Outlook 2010 using Visual Studio 2010 - How to disable the add-in after 30 days? RRS feed

  • Question

  • Hello,

    1. I have created an Outlook add-in for Outlook 2010 using Visual Studio 2010. I am using windows installer deployment method. Have included a setup project, installed it on host system and number of other systems and add-in works perfect.

    2. I need to disable this add-in after 30 days of installation.

    3. I know that when I am calling my InspectorRibbon_Load method I can do a check for current date and compare it with the installed date. My question is - where and how do I get the date installed ? While installing is there some value/some place where I can store the date installed and then perform a check against that later on ?

    I hope my question is clear and apologies if it is very basic.

    Just another thought - I could do this easily for 2007 - there was an InclusionListCustomActions project that MS provided. In that, I simply added the date of installation to the registry value in the OnAfterInstall() method and then did a check on that when my ribbon loaded. But I am stuck in 2010 as I find no such provision

    If my approach is wrong, or if there are any other thoughts/suggestions then please do let me know.

    Thanks very much,

    Much appreciated,

    Priyanka

    Thursday, September 15, 2011 3:57 PM

Answers

  • There are a number of ways to approach this. I've used several myself in various projects.
     
    One approach is to create an Installer project that overrides some of the actions in the MSI installer and write out the date to the registry or file system from that code. I've done that in VS2005/2008/2010 installers.
     
    Another approach that doesn't rely on customizing the installer is to write out a FirstRun registry key as part of your installation. On addin startup you then check that registry value and if it is a first run you write the date to the registry or file system.
     
    An alternative would check the registry or file system for that date value and if it wasn't there it would be considered as a first run.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "PriyankaM" <=?utf-8?B?UHJpeWFua2FN?=> wrote in message news:b0eb8f27-1eee-40e6-afb4-8eb158b6683a...

    Hello,

    1. I have created an Outlook add-in for Outlook 2010 using Visual Studio 2010. I am using windows installer deployment method. Have included a setup project, installed it on host system and number of other systems and add-in works perfect.

    2. I need to disable this add-in after 30 days of installation.

    3. I know that when I am calling my InspectorRibbon_Load method I can do a check for current date and compare it with the installed date. My question is - where and how do I get the date installed ? While installing is there some value/some place where I can store the date installed and then perform a check against that later on ?

    I hope my question is clear and apologies if it is very basic.

    Just another thought - I could do this easily for 2007 - there was an InclusionListCustomActions project that MS provided. In that, I simply added the date of installation to the registry value in the OnAfterInstall() method and then did a check on that when my ribbon loaded. But I am stuck in 2010 as I find no such provision

    If my approach is wrong, or if there are any other thoughts/suggestions then please do let me know.

    Thanks very much,

    Much appreciated,

    Priyanka


    Ken Slovak MVP - Outlook
    • Marked as answer by PriyankaM Sunday, September 18, 2011 6:39 AM
    Thursday, September 15, 2011 5:59 PM

All replies

  • There are a number of ways to approach this. I've used several myself in various projects.
     
    One approach is to create an Installer project that overrides some of the actions in the MSI installer and write out the date to the registry or file system from that code. I've done that in VS2005/2008/2010 installers.
     
    Another approach that doesn't rely on customizing the installer is to write out a FirstRun registry key as part of your installation. On addin startup you then check that registry value and if it is a first run you write the date to the registry or file system.
     
    An alternative would check the registry or file system for that date value and if it wasn't there it would be considered as a first run.

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "PriyankaM" <=?utf-8?B?UHJpeWFua2FN?=> wrote in message news:b0eb8f27-1eee-40e6-afb4-8eb158b6683a...

    Hello,

    1. I have created an Outlook add-in for Outlook 2010 using Visual Studio 2010. I am using windows installer deployment method. Have included a setup project, installed it on host system and number of other systems and add-in works perfect.

    2. I need to disable this add-in after 30 days of installation.

    3. I know that when I am calling my InspectorRibbon_Load method I can do a check for current date and compare it with the installed date. My question is - where and how do I get the date installed ? While installing is there some value/some place where I can store the date installed and then perform a check against that later on ?

    I hope my question is clear and apologies if it is very basic.

    Just another thought - I could do this easily for 2007 - there was an InclusionListCustomActions project that MS provided. In that, I simply added the date of installation to the registry value in the OnAfterInstall() method and then did a check on that when my ribbon loaded. But I am stuck in 2010 as I find no such provision

    If my approach is wrong, or if there are any other thoughts/suggestions then please do let me know.

    Thanks very much,

    Much appreciated,

    Priyanka


    Ken Slovak MVP - Outlook
    • Marked as answer by PriyankaM Sunday, September 18, 2011 6:39 AM
    Thursday, September 15, 2011 5:59 PM
  • That was very simple. I should have thought it myself. Thanks Ken
    Sunday, September 18, 2011 6:39 AM