[ActiveLock-Development] CVS: alugen/app ALUGEN.vbp,1.3,1.4 frmMain.frm,1.3,1.4 frmMain.frx,1.3,1.4
Brought to you by:
ialkan
From: Thanh H. T. <th...@us...> - 2003-11-03 06:48:43
|
Update of /cvsroot/activelock/alugen/app In directory sc8-pr-cvs1:/tmp/cvs-serv31013 Modified Files: ALUGEN.vbp frmMain.frm frmMain.frx Log Message: 2.0.4 IALUGenerator interface changed. See module change logs for more details. Index: ALUGEN.vbp =================================================================== RCS file: /cvsroot/activelock/alugen/app/ALUGEN.vbp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ALUGEN.vbp 13 Oct 2003 07:23:51 -0000 1.3 +++ ALUGEN.vbp 3 Nov 2003 06:48:40 -0000 1.4 @@ -1,7 +1,7 @@ Type=Exe Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#stdole2.tlb#OLE Automation -Reference=*\G{9ED8E727-A621-485F-B922-A7C4908A3BF2}#1.0#0#..\lib\alugen.dll#ActiveLock Universal Generator Library -Reference=*\G{C3B56087-6690-42ED-8914-633AA166AB41}#1.0#0#..\..\activelock\bin\activelock2.dll#ActiveLock2 +Reference=*\G{C3B56087-6690-42ED-8914-633AA166AB41}#1.0#0#..\..\activelock\src\activelock2.dll#ActiveLock2 +Reference=*\G{F638FCF2-8DFD-47F0-B77A-2799D2310A82}#1.0#0#..\lib\alugen.dll#ActiveLock Universal GENerator Library 2.0 Object={5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0; MSFLXGRD.OCX Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0; TABCTL32.OCX Form=frmMain.frm @@ -18,7 +18,7 @@ CompatibleMode="1" MajorVer=2 MinorVer=0 -RevisionVer=3 +RevisionVer=4 AutoIncrementVer=0 ServerSupportFiles=0 VersionCompanyName="The ActiveLock Software Group" Index: frmMain.frm =================================================================== RCS file: /cvsroot/activelock/alugen/app/frmMain.frm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- frmMain.frm 13 Oct 2003 07:23:51 -0000 1.3 +++ frmMain.frm 3 Nov 2003 06:48:40 -0000 1.4 @@ -1,7 +1,7 @@ VERSION 5.00 Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX" Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX" -Begin VB.Form frmMain +Begin VB.Form frmMain Appearance = 0 'Flat BorderStyle = 3 'Fixed Dialog Caption = "ActiveLock Universal GENerator" @@ -16,7 +16,7 @@ ScaleHeight = 5685 ScaleWidth = 9735 StartUpPosition = 3 'Windows Default - Begin TabDlg.SSTab SSTab1 + Begin TabDlg.SSTab SSTab1 Height = 5655 Left = 0 TabIndex = 0 @@ -42,11 +42,11 @@ TabCaption(1) = "&License Key Generator" TabPicture(1) = "frmMain.frx":0CE6 Tab(1).ControlEnabled= 0 'False - Tab(1).Control(0)= "Label8" + Tab(1).Control(0)= "cmbProds" Tab(1).Control(1)= "frmKeyGen" - Tab(1).Control(2)= "cmbProds" + Tab(1).Control(2)= "Label8" Tab(1).ControlCount= 3 - Begin VB.CommandButton cmdRemove + Begin VB.CommandButton cmdRemove Caption = "&Remove" Enabled = 0 'False Height = 315 @@ -55,62 +55,52 @@ Top = 3000 Width = 1000 End - Begin VB.ComboBox cmbProds + Begin VB.ComboBox cmbProds Height = 315 - Left = -73680 + Left = -73560 Style = 2 'Dropdown List TabIndex = 15 Top = 480 Width = 3615 End - Begin VB.Frame frmKeyGen + Begin VB.Frame frmKeyGen BorderStyle = 0 'None Height = 4215 Left = -74880 TabIndex = 13 Top = 960 - Width = 9375 - Begin VB.ComboBox cmbLicClass + Width = 9495 + Begin VB.ComboBox cmbLicType Height = 315 ItemData = "frmMain.frx":0D02 - Left = 1200 - List = "frmMain.frx":0D12 - Style = 2 'Dropdown List - TabIndex = 21 - Top = 585 - Width = 3615 - End - Begin VB.ComboBox cmbLicType - Height = 315 - ItemData = "frmMain.frx":0D95 - Left = 1200 - List = "frmMain.frx":0DA2 + Left = 1320 + List = "frmMain.frx":0D0F Style = 2 'Dropdown List TabIndex = 17 Top = 0 Width = 3615 End - Begin VB.TextBox txtDays + Begin VB.TextBox txtDays Alignment = 1 'Right Justify BackColor = &H8000000F& Height = 315 - Left = 1200 + Left = 1320 Locked = -1 'True TabIndex = 19 Text = "30" Top = 285 Width = 1215 End - Begin VB.TextBox txtReqCodeIn + Begin VB.TextBox txtReqCodeIn Height = 315 - Left = 1200 - TabIndex = 23 - Top = 960 + Left = 1320 + TabIndex = 21 + Top = 600 Width = 7095 End - Begin VB.TextBox txtLibKey + Begin VB.TextBox txtLibKey BackColor = &H80000011& - BeginProperty Font + BeginProperty Font Name = "Courier New" Size = 8.25 Charset = 0 @@ -119,27 +109,27 @@ Italic = 0 'False Strikethrough = 0 'False EndProperty - Height = 2475 - Left = 1200 + Height = 3195 + Left = 1320 Locked = -1 'True MultiLine = -1 'True ScrollBars = 2 'Vertical - TabIndex = 25 - Text = "frmMain.frx":0DC8 - Top = 1320 + TabIndex = 23 + Text = "frmMain.frx":0D35 + Top = 960 Width = 7095 End - Begin VB.CommandButton cmdKeyGen + Begin VB.CommandButton cmdKeyGen Caption = "Genera&te" Enabled = 0 'False Height = 315 - Left = 8400 - TabIndex = 26 + Left = 8520 + TabIndex = 24 ToolTipText = "Generate liberation key for the above request code (which should not be blank)." - Top = 1320 + Top = 960 Width = 975 End - Begin VB.Label lblExpiry + Begin VB.Label lblExpiry Caption = "&Expires After:" Height = 255 Left = 0 @@ -147,15 +137,7 @@ Top = 285 Width = 1335 End - Begin VB.Label Label5 - Caption = "License &Class:" - Height = 255 - Left = 0 - TabIndex = 20 - Top = 585 - Width = 1335 - End - Begin VB.Label Label6 + Begin VB.Label Label6 Caption = "License &Type:" Height = 255 Left = 0 @@ -163,38 +145,38 @@ Top = 0 Width = 1335 End - Begin VB.Label Label7 - Caption = "Request C&ode:" + Begin VB.Label Label7 + Caption = "Installation C&ode:" Height = 255 Left = 0 - TabIndex = 22 - Top = 960 + TabIndex = 20 + Top = 600 Width = 1335 End - Begin VB.Label Label12 + Begin VB.Label Label12 Caption = "Liberation &Key:" Height = 255 Left = 0 - TabIndex = 24 - Top = 1320 + TabIndex = 22 + Top = 960 Width = 1335 End - Begin VB.Label lblDays + Begin VB.Label lblDays Caption = "days" Height = 255 - Left = 2520 - TabIndex = 27 + Left = 2640 + TabIndex = 25 Top = 315 Width = 1335 End End - Begin VB.Frame fraProdNew + Begin VB.Frame fraProdNew Height = 2055 Left = 120 TabIndex = 12 Top = 360 Width = 9495 - Begin VB.CommandButton cmdCodeGen + Begin VB.CommandButton cmdCodeGen Caption = "&Generate" Enabled = 0 'False Height = 315 @@ -203,7 +185,7 @@ Top = 1320 Width = 1000 End - Begin VB.TextBox txtCode2 + Begin VB.TextBox txtCode2 BackColor = &H8000000F& Height = 315 Left = 5040 @@ -212,7 +194,7 @@ Top = 1320 Width = 3345 End - Begin VB.TextBox txtCode1 + Begin VB.TextBox txtCode1 BackColor = &H8000000F& Height = 315 Left = 1320 @@ -222,21 +204,21 @@ Top = 1320 Width = 3705 End - Begin VB.TextBox txtName + Begin VB.TextBox txtName Height = 315 Left = 1320 TabIndex = 2 Top = 360 Width = 3705 End - Begin VB.TextBox txtVer + Begin VB.TextBox txtVer Height = 315 Left = 1320 TabIndex = 4 Top = 720 Width = 1545 End - Begin VB.CommandButton cmdAdd + Begin VB.CommandButton cmdAdd Caption = "&Add To Product List" Enabled = 0 'False Height = 315 @@ -245,23 +227,23 @@ Top = 1680 Width = 1845 End - Begin VB.Label Label10 + Begin VB.Label Label10 Caption = "GCode" Height = 255 Left = 5040 - TabIndex = 30 + TabIndex = 28 Top = 1080 Width = 1695 End - Begin VB.Label Label9 + Begin VB.Label Label9 Caption = "VCode" Height = 255 Left = 1320 - TabIndex = 29 + TabIndex = 27 Top = 1080 Width = 1695 End - Begin VB.Label Label4 + Begin VB.Label Label4 Caption = "&Code:" Height = 375 Left = 120 @@ -269,7 +251,7 @@ Top = 1320 Width = 1095 End - Begin VB.Label Label2 + Begin VB.Label Label2 Caption = "&Name:" Height = 375 Left = 120 @@ -277,7 +259,7 @@ Top = 360 Width = 975 End - Begin VB.Label Label3 + Begin VB.Label Label3 Caption = "&Version:" Height = 375 Left = 120 @@ -286,7 +268,7 @@ Width = 1095 End End - Begin MSFlexGridLib.MSFlexGrid gridProds + Begin MSFlexGridLib.MSFlexGrid gridProds Height = 2775 Left = 120 TabIndex = 10 @@ -308,17 +290,17 @@ ScrollBars = 2 SelectionMode = 1 Appearance = 0 - FormatString = $"frmMain.frx":0E0B + FormatString = $"frmMain.frx":0D78 End - Begin VB.Label Label1 + Begin VB.Label Label1 Caption = "&Product List:" Height = 255 Left = 120 - TabIndex = 28 + TabIndex = 26 Top = 2520 Width = 1215 End - Begin VB.Label Label8 + Begin VB.Label Label8 Caption = "&Product:" Height = 255 Left = -74880 @@ -395,6 +377,8 @@ ' - Don't process button click when not in the right tab. ' e.g. when in Key Generator tab and accessor key for cmdRemove is pressed, ' just ignore the event. +' 11.02.03 - th2tran - Removed License Class from ALUGEN. This setting was totally unnecessary. +' - Reworked KeyGen logic a bit, due to IALUGenerator_GenKey() change. ' </pre> ' /////////////////////////////////////////////////////////////////////// @@ -419,47 +403,24 @@ Debug.Print "gridProds_CellDataChanged" End Sub -Private Sub cmbLicClass_Click() - If cmbLicClass = "Class 1 - Lock To MAC" Then - ActiveLock.LockType = lockMAC - ElseIf cmbLicClass = "Class 2 - Lock To Windows Serial" Then - ActiveLock.LockType = lockWindows - ElseIf cmbLicClass = "Class 3 - Lock To Computer Name" Then - ActiveLock.LockType = lockComp - ElseIf cmbLicClass = "Class 4 - Lock To Hard Drive Serial" Then - ActiveLock.LockType = lockHD - End If -End Sub - Private Sub cmbLicType_Click() - With ActiveLock - If cmbLicType = "Periodic" Then - .LicenseType = allicPeriodic - ElseIf cmbLicType = "Permanent" Then - .LicenseType = allicPermanent - ElseIf cmbLicType = "Time Locked" Then - .LicenseType = allicTimeLocked - Else - .LicenseType = allicNone - End If - ' enable the days edit box - If cmbLicType = "Periodic" Or cmbLicType = "Time Locked" Then - txtDays.Locked = False - txtDays.BackColor = &H80000005 - Else - txtDays.Locked = True - txtDays.BackColor = &H80000011 - End If - If cmbLicType = "Time Locked" Then - lblExpiry = "&Expires on Date:" - txtDays = Format$(Now() + 30, "YYYY/MM/DD") - lblDays = "YYYY/MM/DD" - Else - lblExpiry = "&Expires after:" - txtDays = "30" - lblDays = "Day(s)" - End If - End With + ' enable the days edit box + If cmbLicType = "Periodic" Or cmbLicType = "Time Locked" Then + txtDays.Locked = False + txtDays.BackColor = &H80000005 + Else + txtDays.Locked = True + txtDays.BackColor = &H80000011 + End If + If cmbLicType = "Time Locked" Then + lblExpiry = "&Expires on Date:" + txtDays = Format$(Now() + 30, "YYYY/MM/DD") + lblDays = "YYYY/MM/DD" + Else + lblExpiry = "&Expires after:" + txtDays = "30" + lblDays = "Day(s)" + End If End Sub Private Sub cmbProds_Click() @@ -476,7 +437,7 @@ Private Sub cmdCodeGen_Click() If SSTab1.Tab <> 0 Then Exit Sub ' our tab not active - do nothing - + Screen.MousePointer = vbHourglass fDisableNotifications = True txtCode1 = "" @@ -499,7 +460,7 @@ Debug.Print "Public blob: " & strBlob txtCode1 = strBlob End If - + modALUGEN.rsa_private_key_blob Key, vbNullString, blobLen If blobLen > 0 Then strBlob = String(blobLen, 0) @@ -509,7 +470,7 @@ End If ' done with the key - throw it away modALUGEN.rsa_freekey Key - + ' Test generated key for correctness by recreating it from the blobs ' Note: ' ==== @@ -544,28 +505,51 @@ .SoftwareVersion = strVer End With + Dim varLicType As ActiveLock2.ALLicType + + If cmbLicType = "Periodic" Then + varLicType = allicPeriodic + ElseIf cmbLicType = "Permanent" Then + varLicType = allicPermanent + ElseIf cmbLicType = "Time Locked" Then + varLicType = allicTimeLocked + Else + varLicType = allicNone + End If + Dim strExpire$ strExpire = GetExpirationDate() + Dim Lic As ActiveLock2.ProductLicense +' Set Lic = ActiveLock2.CreateProductLicense(strName, "Code", strVer, alfSingle, varLicType, "Licensee", strExpire, "LicKey", "RegDate", "Hash1") + ' Create a product license object without the product key or license key + Dim strRegDate As String + strRegDate = Format(Now(), "yyyy/mm/dd") + Set Lic = ActiveLock2.CreateProductLicense(strName, strVer, "", alfSingle, varLicType, "", strExpire, , strRegDate) Dim strLibKey As String - strLibKey = GeneratorInstance.GenKey(ActiveLock, txtReqCodeIn, strExpire) + ' Pass it to IALUGenerator to generate the key + strLibKey = GeneratorInstance.GenKey(Lic, txtReqCodeIn) txtLibKey = Make64ByteChunks(strLibKey) + Screen.MousePointer = vbNormal + Exit Sub ErrHandler: + MsgBox "Error: " + Err.Description Screen.MousePointer = vbNormal End Sub + '' ' Breaks a long string into chunks of 64-byte lines. ' Private Function Make64ByteChunks(strData As String) As String - Dim I As Long + Dim i As Long Dim Count As Long Count = Len(strData) Dim sResult As String sResult = Left$(strData, 64) - I = 65 - While I <= Count - sResult = sResult & vbCrLf & Mid$(strData, I, 64) - I = I + 64 + i = 65 + While i <= Count + sResult = sResult & vbCrLf & Mid$(strData, i, 64) + i = i + 64 Wend Make64ByteChunks = sResult End Function @@ -584,7 +568,7 @@ Dim SelStart%, SelEnd% Dim fEnableAdd As Boolean fEnableAdd = False - + With gridProds If .Row < .RowSel Then SelStart = .Row @@ -593,17 +577,17 @@ SelStart = .RowSel SelEnd = .Row End If - Dim I% - For I = SelEnd To SelStart Step -1 - strName = .TextMatrix(I, 0) + Dim i% + For i = SelEnd To SelStart Step -1 + strName = .TextMatrix(i, 0) If txtName = strName Then fEnableAdd = True End If - RemoveRow I + RemoveRow i Next .RowSel = .Row ' negate current selections End With - + ' Enable Add button if we're removing the variable currently being edited. If fEnableAdd Then cmdAdd.Enabled = True @@ -778,10 +762,10 @@ ' Private Function CheckDuplicate(Name As String, Ver As String) As Boolean CheckDuplicate = False - Dim I% - For I = 0 To gridProds.Rows - 1 - If gridProds.TextMatrix(I, 0) = Name Then - If gridProds.TextMatrix(I, 1) = Ver Then + Dim i% + For i = 0 To gridProds.Rows - 1 + If gridProds.TextMatrix(i, 0) = Name Then + If gridProds.TextMatrix(i, 1) = Ver Then CheckDuplicate = True Exit Function End If @@ -795,7 +779,6 @@ Private Sub InitUI() ' Init Default license class cmbLicType = "Time Locked" - cmbLicClass = "Class 1 - Lock To MAC" With gridProds .Clear .Rows = 1 @@ -810,10 +793,10 @@ Dim arrProdInfos() As ProductInfo arrProdInfos = GeneratorInstance.RetrieveProducts() If IsArrayEmpty(arrProdInfos) Then Exit Sub - - Dim I% - For I = LBound(arrProdInfos) To UBound(arrProdInfos) - PopulateUI arrProdInfos(I) + + Dim i% + For i = LBound(arrProdInfos) To UBound(arrProdInfos) + PopulateUI arrProdInfos(i) Next gridProds_Click End Sub Index: frmMain.frx =================================================================== RCS file: /cvsroot/activelock/alugen/app/frmMain.frx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvscsecAK and /tmp/cvsMfuyXk differ |