×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How can I access User Interface CustomerInformation of a custom Installer Setup through code?

How can I access User Interface CustomerInformation of a custom Installer Setup through code?

How can I access User Interface CustomerInformation of a custom Installer Setup through code?

(OP)
I have created a setup project for my application inside the solution that includes myapplication project.
This setup has a specificity. I want to install a trial version of the product and a licenced.
So I did the following:
In the User Inteface of the setup project I added a dialog with two radio buttons under Install Start Welcome.
The radio buttons are FreeTrial and Licenced.
I have created an Installer Class named MyInstaller inside my project in which I override the Install method.

CODE --> Vb.Net

Imports System.ComponentModel
Imports System.Configuration.Install

Public Class MyInstaller
    Public Class TypeOfSetup
        Public mFreeTrialFlg As Boolean
        Public mLicencedFlg As Boolean
        Public Property FreeTrialFlg() As Boolean
            Get
                Return mFreeTrialFlg
            End Get
            Set(ByVal value As Boolean)
                mFreeTrialFlg = value
            End Set
        End Property
        Public Property LicencedFlg() As Boolean
            Get
                Return mLicencedFlg
            End Get
            Set(ByVal value As Boolean)
                mLicencedFlg = value
            End Set
        End Property
        Public Sub New()
            mLicencedFlg = False
            mFreeTrialFlg = False
        End Sub
    End Class
    Public Sub New()
        MyBase.New()
        InitializeComponent()
    End Sub
    Public Overrides Sub Install(stateSaver As IDictionary)
        MyBase.Install(stateSaver)

        My.Settings.FreeTrialStr = Context.Parameters("FREETRIAL")
        My.Settings.LicencedStr = Context.Parameters("LICENCED")
    End Sub
End Class 
I store to the application settings some variables about the expiration of trial and the kind of version that is being installed in the machine.
And my main form source code looks like that. That's a simple example of one day trial version that runs successfully with the addition of a simple assembly.

CODE --> Vb.net

Public Class Form1
    Public TrialTime As DateTime
    Public Version As New MyInstaller.TypeOfSetup
    Public MyInst As New MyInstaller
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        
        If My.Settings.FreeTrialStr <> " " Then
            Version.FreeTrialFlg = True
            Version.LicencedFlg = False
        ElseIf My.Settings.LicencedStr <> " " Then
            Version.LicencedFlg = True
            Version.FreeTrialFlg = False
        End If

        If Version.FreeTrialFlg Then
            Trial()
        Else

        End If
    End Sub
    Public Sub Trial()
        My.Settings.Checked = False
        If Not My.Settings.Checked Then
            My.Settings.TrialTime = DateTime.Now  'TrialTime
            My.Settings.Checked = True
            My.Settings.ActivatedTrial = True
            My.Settings.LastDateUsed = DateTime.Now
            My.Settings.Expired = False
            MessageBox.Show("First Run...")
        Else
            If (My.Settings.TrialTime.Add(New TimeSpan(1, 0, 0, 0)) > DateTime.Now) And (My.Settings.LastDateUsed > DateTime.Now = False) And
                My.Settings.Expired = False Then
                My.Settings.ActivatedTrial = True
                MessageBox.Show("Trial Active...")
            Else
                If (DateTime.Now <= My.Settings.LastDateUsed Or My.Settings.TrialTime <= DateTime.Now Or My.Settings.Expired) Then
                    MessageBox.Show("Trial Expired...")
                    My.Settings.ActivatedTrial = False
                    My.Settings.Expired = True
                    Me.Close()
                End If
            End If
        End If
    End Sub
End Class 
As you will see in jpg I attached, I have added a Customer Information Dialog too in the User Interface of the installer setup project with the red underline.
How can I access the Customer Information through source code in order to be visible only when the user chooses for the radio buttons the licenced version of the product so that to develop that part too?
I was thinking to do something like that https://www.youtube.com/watch?v=_5VOABeCv3U&t=... in order to avoid anauthorized users but I don't know if all users would have the same licence key as in the youtube video. However, it's the first time I create a custom setup project and I have no idea how to do it, I would appreciate any guidance and suggestions please? Any help will be much appreciated. Thank you so much in advanced.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close