StartMode, Installation and LicenseKey

Add-in Express™ Support Service
That's what is more important than anything else

StartMode, Installation and LicenseKey
StartMode, Installation and LicenseKey 
Scott Bieker

Posts: 4
Joined: 2005-03-22
I use XHEO|Licensing to create serial keys for my applications. I have added a license manager to my new Excel Add-in and currently have the "check for license" in the mybase.addininitialize event.

it looks like this...

If Me.StartMode = AddinExpress.MSO.ADXStartMode.smNormal Then
Dim lic As New LicenseComponent
End If

I was wondering if there is a "better way." This allows the user to be prompted for a serial number when the STARTMODE becomes "NORMAL." However, they get a chance to use the application with "FIRSTSTART" without being prompted for a license key. If I also add the licensecomponent when startmode = firststart, then the user is prompted in the middle of the install with my .msi file.

Maybe there is a different event to place this check on? I really just want to check for the license key when the user opens up Excel, not on install or uninstall.

Maybe another "startmode" could be created == "INSTALLED"

Thanks for your help.

Posted 23 Mar, 2005 18:08:04 Top
Sergey Grischenko

Add-in Express team

Posts: 7202
Joined: 2004-07-05
Hi Scott.

You can check a licence for you add-in in the custom actions of the msi file. (See Visual Studio help about custom actions).
As it is well known, ADX inherits the Installer class. This class allows you to perform your code during the installation process. If you wish to check a licence when an add-in starts in Excel you have to limit the add-in functionality if a licence is not valid. Then the command bar of the addin should have a button so that the user has a possibility to enter a licence key.
What do you think about this scenario?
Posted 24 Mar, 2005 07:12:33 Top