Hello, I have a solution with mulitple projects.
The main project wich is a game, a project with an installer class and a registration license key form named RegistrationLicense and the setup project.
In the setup project, inside user interface I have add a custom dialog with two option buttons one for trial and one for license it's being located after License Agreement.
During setup running in case the user chooses the licensed option I load the registration form in which there is the Product ID, I generate the product key with a button and I registrate through registate button the license and everything works fine. Inside the installer class ovveridden Install I use the SetEnvironmentVariable to store the selection of the user during installation.
Now, in the main program which is a game and belongs to another project in the same solution, I tried to retrieve the AppLicensed value with
in order to be sure that I have the appropriate value of the user selection in the radio button of the custom install, because if the selection is FreeTrial I want to run the FreeTrial function in the game program that is being installed. Unfortunately the values of AppLicensed and AppFreeTrial and I don't know how to achieve it, any suggestion please?
I thought about adding a reference in game project from the RegistrationLicense project, but I would have to create an instance of that, so it doesn't serves me at all because I will not get the actual values of user selection during installation. I thought about storing these values of installer project to a database but I have to install the database first, so I feel a little bit stuck to find a good solution. Any help will be much appreciated. Thank you so much in advanced.
The main project wich is a game, a project with an installer class and a registration license key form named RegistrationLicense and the setup project.
In the setup project, inside user interface I have add a custom dialog with two option buttons one for trial and one for license it's being located after License Agreement.
During setup running in case the user chooses the licensed option I load the registration form in which there is the Product ID, I generate the product key with a button and I registrate through registate button the license and everything works fine. Inside the installer class ovveridden Install I use the SetEnvironmentVariable to store the selection of the user during installation.
Code:
Environment.SetEnvironmentVariable("AppFreeTrial", mSetupType.FreeTrialFlg)
Environment.SetEnvironmentVariable("AppLicensed", mSetupType.LicensedFlg)
Now, in the main program which is a game and belongs to another project in the same solution, I tried to retrieve the AppLicensed value with
Code:
MsgBox(Environment.GetEnvironmentVariable("AppLicensed"))
MsgBox(Environment.GetEnvironmentVariable("AppFreeTrial"))
I thought about adding a reference in game project from the RegistrationLicense project, but I would have to create an instance of that, so it doesn't serves me at all because I will not get the actual values of user selection during installation. I thought about storing these values of installer project to a database but I have to install the database first, so I feel a little bit stuck to find a good solution. Any help will be much appreciated. Thank you so much in advanced.