#include #include "Licensing.au3" ; The URL of your PHP Backend Global Const $SERVER_URL = "http://localhost/License%20Mod%202.0/server" ; 1. Check for Updates First _License_CheckUpdate($SERVER_URL) ; Note: If an update is found, _License_CheckUpdate displays a MsgBox. In a real app, it would silently download and restart. ; 2. Initial License Check If Not _License_Verify($SERVER_URL) Then ; If silent verification fails, prompt for Activation Key Local $sKey = InputBox("Software Activation", "Please enter your Activation Key:", "", "", 300, 150) If @error Or $sKey = "" Then MsgBox(16, "Error", "Activation is required to run this software.") Exit EndIf ; Attempt Activation If Not _License_Activate($SERVER_URL, $sKey) Then Exit ; Error message is handled inside the UDF EndIf MsgBox(64, "Success", "Software activated successfully! Please restart the application.") Exit EndIf ; 3. If we reach here, the license is valid and bound to this PC MsgBox(64, "Welcome", "License Verified! Starting application...") ; --- MAIN APPLICATION GUI --- Local $hGUI = GUICreate("My Premium AutoIt Software", 400, 200) Local $btnSurrender = GUICtrlCreateButton("Surrender License", 120, 80, 150, 40) GUISetState(@SW_SHOW, $hGUI) While True Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $btnSurrender Local $iAnswer = MsgBox(36, "Confirm", "Are you sure you want to surrender your license? The software will close and you will need to activate it again to use it here.") If $iAnswer = 6 Then ; Yes If _License_Surrender($SERVER_URL) Then MsgBox(64, "Success", "License surrendered. You can now use your activation key on another computer.") Exit Else MsgBox(16, "Error", "Failed to surrender license. Check connection.") EndIf EndIf EndSwitch WEnd