We are using preprocessor directives like trail and licensed, so we have two installers for trail and licensed. When the user want to upgrade from trail to licensed they have to uninstall trail and install Licensed and vice versa. Now we want to have only one installer that means we want to get rid of the process of reinstalling the application for trail to licensed and have only one installer which serves Trail and Licensed users.so my question is based on some license file that is DAT file, how we should change preprocessed code with C# code what are the alternatives to change code after user upgrades or degrades License. If there is any change in License then we need to come to Main method and reload session and all exception handlers, engines again with respective mode on. Please suggest how to code for this kind of challenge.
class Program
{
static void Main(string[] args)
{
#if Trail
SomeStaticClass.PropertyId = "10023";
//trail based code
#elif LICENSED
SomeStaticClass.PropertyId = "10024";
//licensed code
#endif
//register some events based on trail and Licensed
//create session based on trail and Licensed
//license check is happening after all the sessions and environments are created
}
}
public static class SomeStaticClass
{
public static string PropertyId { get; set; }
}