PE Dynamic Registration Tutorial
1 - Start with an Event Startup Script
Sample WIS Event Startup Script:
Alert LibsAlert
Title "Missing Library"
Icon sysIconError
Text "The ^1 was not found! Please install."
Button "OK"
EndAlert
Action eventStartup
VerifyLibs LibsAlert
Goto +2 'executed if all libs present
ExitApp 'executed if any lib is missing
pe.VerifyLib
Goto +3 'If Library is valid the following branch will execute.
au.Alert "Your PE Library is invalid" 'This will execute if not valid
ExitApp
pe.Dyn16RegInit "key c i * +", HotSyncID
pe.TestRegEx
goto @StartForm
goto @ExitApp
@StartForm:
db.If.TrueEx "Stash({NAVI})=0"
goto +2
goto +4
GotoForm 1000
NoAction
goto +3
db.GotoForm "0+Stash({NAVI})"
NoAction
goto @Exit
@ExitApp:
pe.StartForm 2000, 1000
@Exit:
EndAction
2- Create an Alert
Alert UnRegDays
Title "15 Day Trial!"
Icon sysIconWarning
Text "^1 days left! Register at www.webmasteris.com
Button "OK"
EndAlert
3- Create Actions
'Action for PE
Action ButtonRegister
pe.Dyn16RegDialog
EndAction
Action ButtonTrial
pe.DayLimit 15, UnRegDays, Stop, Always
db.If.TrueEx "Stash({NAVI})=0"
goto +2
goto +4
GotoForm 1000
NoAction
goto +3
db.GotoForm "0+Stash({NAVI})"
NoAction
EndAction
----------------------
PE Shareware Registration Tutorial
1 - Start with an Event Startup Script
Sample WIS Event Startup Script:
Alert LibsAlert
Title "Missing Library"
Icon sysIconError
Text "The ^1 was not found! Please install."
Button "OK"
EndAlert
Action eventStartup
db.StackSize 50
VerifyLibs LibsAlert
Goto +2 'executed if all libs present
ExitApp 'executed if any lib is missing
pe.VerifyLib
Goto +3 'If Library is valid the following branch will execute.
au.Alert "Your PE Library is invalid" 'This will execute if not valid
ExitApp
pe.RegInit "XXXX", #####, #, IDVer
pe.StartForm 2100, 1000
au.Sort CRID, Type, "Quiet", "FieldN", "9"
NoAction
EndAction
2- Create an Alert
Alert UnRegDays
Title "15 Day Trial!"
Icon sysIconWarning
Text "^1 days left! Register at www.webmasteris.com
Button "OK"
EndAlert
3- Create Actions
'Action for PE
Action ButtonRegister
pe.RegDialog
EndAction
Action ButtonTrial
pe.DayLimit 15, UnRegDays, Stop, Always
GotoForm 1000
au.Sort CRID, TYPE, "Quiet", "FieldN", "0", "Field2", "9"
NoAction
EndAction
----------------------
PE.VerifyLib Version 1.15 and up with PRO branching
action
This action will perform a self-check to try to determine if there has been a
patch applied to the code1 segment to circumvent PE's capabilities. It is a PRO
branching action, so you can script around it.
Here is an example, in SP7 branching syntax, of using it to verify and decrypt a
password protected application:
Action eventStartup
pe.VerifyLib
goto @AskPassword
goto @VeryBad
@AskPassword:
pe.AskPswdEx "123", PIN, Unchecked
goto @Good
goto @VeryBad
@Good:
pe.DecryptEx "ProVideo-DATA"
goto @Exit
goto @Exit
@VeryBad:
ExitApp 'For both error situations (bad password or password doesn't match)
@Exit:
EndAction