home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 February
/
PCWK0297.iso
/
lotus
/
english
/
winagent
/
install.dsk
/
LIC.LSS
< prev
next >
Wrap
Text File
|
1995-01-25
|
13KB
|
678 lines
OPTION DECLARE
USE "TOOLKIT"
DECLARE PUBLIC FUNCTION ProductRegLIC (prodno%, network$, direction$) AS STRING
DECLARE PUBLIC FUNCTION DefaultUserRegLIC (prodno%, network$, direction$) AS STRING
DECLARE PUBLIC FUNCTION InitLIC (prodno%, network$, direction$, basedir$) AS STRING
DECLARE PUBLIC FUNCTION PathChangeLIC (prodno%, network$, direction$, destdirsym$, mainprodsonly%) AS STRING
DECLARE PUBLIC FUNCTION InitCopyListLIC (prodno%, network$, direction$) AS STRING
DECLARE PUBLIC FUNCTION PreCopyConfigLIC (prodno%, network$, direction$, lic%) AS STRING
DECLARE PUBLIC FUNCTION AddTheBillBoardsLIC (prodno%, network$, direction$, nbytes&) AS STRING
DECLARE PUBLIC FUNCTION PostCopyConfigLIC (prodno%, network$, direction$, programgroup$) AS STRING
DECLARE PUBLIC FUNCTION AddIconsLIC (prodno%, network$, direction$, programgroup$) AS STRING
DECLARE PUBLIC FUNCTION UILIC (prodno%, network$, direction$) AS STRING
DECLARE PUBLIC FUNCTION PostSuccessRegLIC (prodno%, network$, direction$) AS STRING
SUB Initialize
Reg_RegisterProductNames "LIC", LdString(SID_LIC)
END SUB
PUBLIC FUNCTION ProductRegLIC (prodno%, network$, direction$) AS STRING
ProductRegLIC = gNEXT
Reg_SetSupportedInstallTypes prodno%, 1, 1, 1
Reg_SetProdSizes prodno%, 7000, 7000
Reg_SetUIInOrOut prodno%, 1
Reg_SetShareFlags prodno%, 0, 0, 0, 0
Reg_SetAllowUserToPickInSuite prodno%, 0
Reg_SetSrvSupport prodno%, 0
Reg_SetLicenseSupport prodno%, 0
Reg_SetATMSupport prodno%,0
END FUNCTION
PUBLIC FUNCTION DefaultUserRegLIC (prodno%, network$, direction$) AS STRING
DefaultUserRegLIC = gNEXT
END FUNCTION
PUBLIC FUNCTION InitLIC (prodno%, network$, direction$, basedir$) AS STRING
DIM sym$, symname$, n%, i%, licsupport%
InitLIC = direction$
If direction$ = gBACK Then
EXIT FUNCTION
End If
If network$ = gSERVER Then
Reg_SetUIInOrOut prodno%, 1
End If
If network$ <> gSERVER Then
Reg_SetUIInOrOut prodno%, FALSE
Else
n% = Reg_GetNumberOfProducts()
licsupport% = FALSE
FOR i% = 1 TO n%
IF Reg_GetProdSupportForLicense(i%) <> FALSE AND i% <> prodno% Then
licsupport% = TRUE
EXIT FOR
END IF
NEXT
If licsupport% = FALSE Then
Reg_SetUIInOrOut prodno%, FALSE
End If
End iF
sym$ = Reg_GetDirSymbolList(prodno%)
symname$ = sym$ + gNAME
SetListItem sym$, 1, SYM_LICDIR$
SetListItem symname$, 1, SYM_LICDIR$ + gNAME$
SetSymbolValue SYM_LICDIR$, basedir$ + LdString(SID_LIC_LICDIR)
SetSymbolValue SYM_LICDIR$ + gNAME$, LdString(SID_LIC_LICDIRNAME)
END FUNCTION
PUBLIC FUNCTION PathChangeLIC (prodno%, network$, direction$, destdirsym$, mainprodsonly%) AS STRING
PathChangeLIC = gNEXT$
END FUNCTION
PUBLIC FUNCTION InitCopyListLIC (prodno%, network$, direction$) AS STRING
DIM sym$, chpt$, n%, i%, licsupport%
ON Error STFQUIT GOTO COPYLISTERROR
InitCopyListLIC = direction$
If direction$ = gBACK Then
EXIT FUNCTION
End If
sym$ = Reg_GetProductAcronym(prodno%) + gTOP$
chpt$ = Lot_GetChapterFromKeyWord(sym$)
If network$ = gSERVER Then
If GetSymbolValue(SYM_SINGLESMARTSUITE$) = gSMARTSUITE$ THEN
n% = Reg_GetNumberOfProducts()
licsupport% = FALSE
FOR i% = 1 TO n%
If Reg_GetProdSupportForLicense(i%) <> FALSE AND _
i% <> prodno% AND _
i% <> 1 AND _
Reg_GetUIInOrOut(i%) <> FALSE Then
licsupport% = TRUE
EXIT FOR
End If
NEXT
If licsupport% = FALSE Then
Reg_SetUIInOrOut prodno%, FALSE
Else
Lot_InitializeCopyList chpt$, F_COMPLETE
End If
Else
Lot_InitializeCopyList chpt$, F_COMPLETE
End If
End If
EXIT FUNCTION
COPYLISTERROR:
ErrorMsg 0, "Developers: You need to have licenser section with LICTOP in INF file"
ERROR STFQUIT
END FUNCTION
PUBLIC FUNCTION PreCopyConfigLIC (prodno%, network$, direction$, lic%) AS STRING
PreCopyConfigLIC = gNEXT
END FUNCTION
PUBLIC FUNCTION AddTheBillBoardsLIC (prodno%, network$, direction$, nbytes&) AS STRING
AddTheBillBoardsLIC = direction$
If direction$ = gBACK Then
EXIT FUNCTION
End If
END FUNCTION
PUBLIC FUNCTION PostCopyConfigLIC (prodno%, network$, direction$, programgroup$) AS STRING
DIM i%, n%,countdir$
PostCopyConfigLIC = gNEXT
n% = Reg_GetNumberOfProducts()
FOR i% = 1 to n%
countdir$ = Reg_GetCountDirectory (i%)
IF Reg_GetProdSupportForLicense (i%) <> FALSE AND _
Reg_IsLicenseSelected (i%) <> FALSE AND _
countdir$ <> "" THEN
CreateDir countdir$, cmoNone
END IF
NEXT
END FUNCTION
PUBLIC FUNCTION AddIconsLIC (prodno%, network$, direction$, programgroup$) AS STRING
DIM i%, n%,licdir$
AddIconsLIC = direction$
If direction$ = gBACK Then
EXIT FUNCTION
End If
If network$ = gSERVER AND Reg_IsLicenseSelected(1) <> FALSE Then
licdir$ = Lot_WhereIsFeature(prodno%, "LICTOP", "licenser.exe")
ASSERT licdir$ <> "", ""
CreateProgmanItem programgroup$, LdString(SID_LIC_VIEWSTRING), licdir$ + "licenser.exe", "", cmoOverwrite
End If
END FUNCTION
PUBLIC FUNCTION UILIC (prodno%, network$, direction$) AS STRING
DIM notused%, dirSym$, licensedselected%, basedir$
UILIC = direction$
If direction$ = gNEXT$ Then
dirSym$ = Reg_GetDirSymbolList(1)
If GetListLength(dirSym$) <= 0 Then
ErrorMsg SID_ERR_SRV_MUST_HAVE_MAINDIR, ""
ERROR STFQUIT
End If
dirSym$ = GetListItem(dirSym$, 1)
basedir$ = GetSymbolValue(SYM_BASEDIR$)
basedir$ = LEFT$(GetSymbolValue(dirSym$), 1) + _
RIGHT$(basedir$, LEN(basedir$)-1)
SetSymbolValue SYM_LICDIR$, basedir$ + LdString(SID_LIC_LICDIR)
Lot_RefreshDestination(SYM_LICDIR$)
End If
notused% = RegisterCallback("LIC", "LICENSERCB")
UILIC$ = PopupModalDlg (DB_LICENSER,DB_LICENSER)
END FUNCTION
PUBLIC FUNCTION PostSuccessRegLIC (prodno%, network$, direction$) AS STRING
PostSuccessRegLIC = gNEXT
END FUNCTION
PUBLIC SUB LICENSERCB (hDlg%, CtrlId%, Classes$, Inst%)
STATIC drvIndex%(1 to 2), dirChanged%, licensedprod%
STATIC licensedselected%
DIM i%, n%, dirToChange$, countdir$
DIM toggleto%, notused%
DIM firstslash%, lastslash%, fullpath$
DIM countbasedir$, counttaildir$
DIM chpt$, dr$, dirSym$
IF INSTR(Classes$, "IDC_COMBO") THEN
i% = VAL(MID$(Classes$, 10, LEN(Classes$) - 9))
drvIndex%(i%) = Inst%
dirChanged% = TRUE
EXIT SUB
END IF
SELECT CASE Classes$
CASE "__DLGINIT"
dirChanged% = FALSE
AddListItem SYM_NORMALFONT$, STR$(IDC_TEXT4)
AddListItem SYM_UPDATELIST$, SYM_NORMALFONT$
n% = Reg_GetNumberOfProducts()
licensedprod% = 0
FOR i% = 1 to n%
IF Reg_GetProdSupportForLicense (i%) <> FALSE THEN
licensedprod% = i%
EXIT FOR
END IF
NEXT
licensedselected% = Reg_IsLicenseSelected(licensedprod%)
IF licensedselected% = FALSE THEN
SetListItem "IDC_B", 1, "F"
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_TEXT1), FALSE)
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_TEXT2), FALSE)
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_EDIT1), FALSE)
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_EDIT2), FALSE)
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_COMBO1), FALSE)
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_COMBO2), FALSE)
ELSE
SetListItem "IDC_B", 1, "T"
END IF
AddListItem SYM_UPDATELIST$, "IDC_B1"
countdir$ = Lot_TrimEndSlash (Reg_GetCountDirectory (licensedprod%))
IF GetSymbolValue(SYM_SINGLESMARTSUITE$) = gSMARTSUITE$ THEN
countdir$ = LdString(SID_LICCOUNTDIR)
END IF
i% = INSTR(countdir$, "\") : n% = i%
WHILE i% <> 0
n% = i% : i% = INSTR(i%+1, countdir$, "\")
WEND
countdir$ = countdir$ + "\"
dirSym$ = Reg_GetDirSymbolList(licensedprod%)
dirSym$ = GetListItem(dirSym$, 1)
dr$ = LEFT(GetSymbolValue(dirSym$), 1)
countdir$ = dr$ + RIGHT(countdir$,LEN(countdir$)-1)
countbasedir$ = LEFT$(countdir$, n%)
counttaildir$ = RIGHT$(countdir$, LEN(countdir$)-n%)
SetListItem "IDC_TEXT", 3, + counttaildir$
AddListItem SYM_UPDATELIST$, "IDC_TEXT3"
dirToChange$ = GetSymbolValue(SYM_LICDIR$)
Lot_GetDriveFreeSpaceList "IDC_COMBO1"
drvIndex%(1) = SelectDriveCombo ("IDC_COMBO1", dirToChange$)
SetListItem "IDC_EDIT", 1, Lot_ExtractDirectory(dirToChange$)
AddListItem SYM_UPDATELIST$, "IDC_EDIT1"
dirToChange$ = countbasedir$
Lot_GetDriveFreeSpaceList "IDC_COMBO2"
drvIndex%(2) = SelectDriveCombo ("IDC_COMBO2", dirToChange$)
SetListItem "IDC_EDIT", 2, Lot_ExtractDirectory(dirToChange$)
AddListItem SYM_UPDATELIST$, "IDC_EDIT2"
CASE "IDC_B"
IF licensedselected% = FALSE THEN
toggleto% = TRUE
licensedselected% = 1
ELSE
toggleto% = FALSE
licensedselected% = 0
END IF
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_TEXT1), toggleto%)
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_TEXT2), toggleto%)
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_EDIT1), toggleto%)
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_EDIT2), toggleto%)
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_COMBO1), toggleto%)
notused% = EnableWindow(GetDlgItem(hDlg%,IDC_COMBO2), toggleto%)
case "IDC_EDIT"
dirChanged% = TRUE
case "IDC_OK"
IF GetSymbolValue(SYM_SINGLESMARTSUITE$) = gSMARTSUITE$ THEN
n% = Reg_GetNumberOfProducts()
FOR i% = 1 to n%
IF Reg_GetProdSupportForLicense (i%) <> FALSE AND _
Reg_GetUIInOrOut(i%) <> FALSE THEN
Reg_SetLicenseSelected i%, licensedselected%
END IF
NEXT
ELSE
Reg_SetLicenseSelected licensedprod%, licensedselected%
END IF
IF Reg_IsLicenseSelected(licensedprod%) <> FALSE Then
chpt$ = Lot_GetChapterFromKeyword("LIC" + gTOP$)
notused% = Lot_SetChapterFilesInCopyListInOrOut(chpt$, 1)
ELSE
chpt$ = Lot_GetChapterFromKeyword("LIC" + gTOP$)
notused% = Lot_SetChapterFilesInCopyListInOrOut(chpt$, 0)
END IF
IF Reg_IsLicenseSelected(licensedprod%) <> FALSE Then
IF dirChanged% = TRUE Then
dirToChange$ = LEFT$(GetListItem("IDC_COMBO1",drvIndex%(1)), 2) + _
GetListItem("IDC_EDIT", 1)
IF ValidatePath(dirToChange$) = FALSE THEN
SetListItem "__LASTSTATUS", 1, "Q"
EXIT SUB
ELSE
SetSymbolValue SYM_LICDIR$, dirToChange$
Lot_RefreshDestination(SYM_LICDIR$)
END IF
END IF
dirToChange$ = LEFT$(GetListItem("IDC_COMBO2",drvIndex%(2)), 2) + _
GetListItem("IDC_EDIT", 2)
licensedprod% = 0
FOR i% = 1 to Reg_GetNumberofProducts()
IF Reg_GetProdSupportForLicense(i%) <> FALSE THEN
licensedprod% = i%
countdir$ = Lot_TrimEndSlash(Reg_GetCountDirectory(licensedprod%))
firstslash% = INSTR(countdir$, "\") : lastslash% = firstslash%
WHILE firstslash% <> 0
lastslash% = firstslash% : firstslash% = INSTR(firstslash%+1, countdir$, "\")
WEND
countdir$ = countdir$ + "\"
counttaildir$ = RIGHT$(countdir$, LEN(countdir$) - lastslash%)
fullpath$ = MakePath(dirToChange$, counttaildir$)
IF ValidatePath(fullpath$) = FALSE THEN
SetListItem "__LASTSTATUS", 1, "Q"
EXIT SUB
ELSE
Reg_SetCountDirectory licensedprod%, fullpath$
END IF
END IF
NEXT
END IF
END SELECT
END SUB