Assassin
Posts: 19
Joined: Sun Jan 29, 2012 11:06 pm

So im wanting to create my own licensing form.

I want to use the trial.dll and its features but not use the advanced installer licensing form.
Ive got my own custom form and ive made it write to registry and stuff like that all works fine.

But the issue ive got is there a way to get hold of the request license code from the registration tab
is there anyway i can call this from the .dll function?

Image

Image

So im wanting to on form load have that number displayed on the email within my application form
Im wanting to totally avoid the advanced installer license window and this is the only thing stopping me.
Daniel
Posts: 8281
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: So im wanting to create my own licensing form.

Hello,

In order to achieve this you can use the "CompId" property. Also, if you want to get the related property value from your own code you can take a look on our "Retrieve Licensing Elements" article.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Assassin
Posts: 19
Joined: Sun Jan 29, 2012 11:06 pm

Re: So im wanting to create my own licensing form.

Daniel.Radu wrote:Hello,
In order to achieve this you can use the "CompId" property. Also, if you want to get the related property value from your own code you can take a look on our "Retrieve Licensing Elements" article.
All the best,
Daniel

Code: Select all

<DllImport("Trial.dll", EntryPoint:="GetPropertyValue", CharSet:=CharSet.Unicode)> _
Private Shared Function GetPropertyValue(ByVal aPropName As String, ByVal aResult As StringBuilder, ByRef _
  aResultLen As UInt32) As UInteger
End Function
...
Dim val As StringBuilder = New StringBuilder
Dim len As UInt32 = CType(val.Capacity, UInt32)
If GetPropertyValue("TrialName", val, len) = 234 Then
  val = New StringBuilder(CType(len, Int32))
  GetPropertyValue("TrialName", val, len)

textbox.text = CompID
'So i just want the compID to be loaded into this textbox'
End If
So ive tried changing a few new properties but I wouldn't work - So im working in vb.net
- So ill give you the clean version im unsure which properties I actually need to change.

Thanks if you can help me :mrgreen:
Daniel
Posts: 8281
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: So im wanting to create my own licensing form.

Hello,

In order to achieve what you want you should use the related GetPropertyValue function to get the CompId (and not CompID) property value. For example, in the above code you should replace the "TrialName" parameter with "CompId". Then, you can assign the "val" variable (which will contain the "CompId" property value) to the related textbox.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Assassin
Posts: 19
Joined: Sun Jan 29, 2012 11:06 pm

Re: So im wanting to create my own licensing form.

Code: Select all

<DllImport("Trial.dll", EntryPoint:="GetPropertyValue", CharSet:=CharSet.Unicode)> _
    Private Shared Function GetPropertyValue(ByVal aPropName As String, ByVal aResult As StringBuilder, ByRef _
  aResultLen As UInt32) As UInteger
    End Function

 Dim val As StringBuilder = New StringBuilder
        Dim len As UInt32 = CType(val.Capacity, UInt32)
        If GetPropertyValue("CompId", val, len) = 234 Then
            val = New StringBuilder(CType(len, Int32))
            GetPropertyValue("CompId", val, len)
            TxtCompID.Text = val.ToString

   End If

There is the working code if anyone else has this problem
Thanks For Your Help :mrgreen:
Daniel
Posts: 8281
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: So im wanting to create my own licensing form.

You're welcome. I'm glad you got this working.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”