| FrontBack |
| | Rieccomi qui, pronto a sfornare un altro programma. Non è altro che una procedura guidata alla creazione di un codice che se inserito in cima al tuo script lo rende una trial. Ci sono due codici: la procedura guidata e il codice trial. NB PER I RIPPER: Questo programma e il suo relativo sistema trial sono sotto LICENZA GNU/GPL!Il codice trial va inserito nella path dello script in cui si vuole aggiungere la trial. Codice principale:CODICE ;######################### ;# Trial Maker # ;# By FrontBack # ;# Copygirht 2010-2011 # ;#########################
#cs GNU/GPL License Trial Maker Copyright (C) 2010 Nicolò Di Domenico
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. #ce
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3>
_Step1()
Global $Code
Func _Step1() $Form1 = GUICreate("Trial Maker - Passo 1", 625, 445, 192, 124) $Label1 = GUICtrlCreateLabel("Benvenuto in Trial Maker!", 16, 8, 286, 37) GUICtrlSetFont(-1, 20, 400, 0, "Calibri") $Label2 = GUICtrlCreateLabel("Questa procedura guidata ti aiuterà a creare il codice da inserire in uno script per rendere il tuo software una trial!", 8, 64, 533, 17) $Label3 = GUICtrlCreateLabel("Per iniziare, compila tutti i campi qui di seguito.", 8, 88, 221, 17) $Input1 = GUICtrlCreateInput("", 104, 128, 217, 21) $Label4 = GUICtrlCreateLabel("Nome programma", 8, 130, 87, 17) $Label5 = GUICtrlCreateLabel("Autore", 60, 154, 35, 17) $Input2 = GUICtrlCreateInput("", 104, 152, 217, 21) $Button1 = GUICtrlCreateButton("Avanti >", 536, 408, 75, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("< Indietro", 456, 408, 75, 25, $WS_GROUP) GUICtrlSetState(-1, $GUI_DISABLE) $Button3 = GUICtrlCreateButton("Annulla", 376, 408, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW)
While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button3 Exit Case $Button1 If GUICtrlRead($Input1) = "" Then MsgBox(16,"Trial Maker","Devi inserire il nome del programma!") ElseIf GUICtrlRead($Input2) = "" Then MsgBox(16,"Trial Maker","Devi inserire l'autore del programma!") Else $ProgName = GUICtrlRead($Input1) $Author = GUICtrlRead($Input2) IniWrite(@ScriptDir&"\TrialOpt.ini","Options","ProgName",$ProgName) IniWrite(@ScriptDir&"\TrialOpt.ini","Options","Author",$Author) GUIDelete($Form1) _Step2() EndIf EndSwitch WEnd EndFunc
Func _Step2() $Form1 = GUICreate("Trial Maker - Passo 2", 625, 445, 192, 124) $Label1 = GUICtrlCreateLabel("Passo 2 - Impostazioni Trial", 16, 8, 301, 37) GUICtrlSetFont(-1, 20, 400, 0, "Calibri") $Label3 = GUICtrlCreateLabel("Ora, specifica quanto vorrai la trial funzioni prima di scadere.", 8, 64, 286, 17) $Input1 = GUICtrlCreateInput("", 104, 128, 113, 21) $Label4 = GUICtrlCreateLabel("Durata Trial (giorni)", 8, 130, 93, 17) $Button1 = GUICtrlCreateButton("Avanti >", 536, 408, 75, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("< Indietro", 456, 408, 75, 25, $WS_GROUP) $Button3 = GUICtrlCreateButton("Annulla", 376, 408, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW)
While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button3 Exit Case $Button1 If GUICtrlRead($Input1) = "" Then MsgBox(16,"Trial Maker","Devi inserire la durata base della Trial!") Else $FirstTime = GUICtrlRead($Input1) IniWrite(@ScriptDir&"\TrialOpt.ini","Options","FirstTime",$FirstTime) GUIDelete($Form1) _Step3() EndIf Case $Button2 GUIDelete($Form1) _Step1() EndSwitch WEnd EndFunc
Func _Step3() $Form1 = GUICreate("Trial Maker - Passo 3", 625, 445, 192, 124) $Label1 = GUICtrlCreateLabel("Passo 3 - Impostazioni Codici", 16, 8, 319, 37) GUICtrlSetFont(-1, 20, 400, 0, "Calibri") $Label3 = GUICtrlCreateLabel("Scegli i codici che prolungheranno e/o attiveranno la trial.", 8, 64, 276, 17) $Input1 = GUICtrlCreateInput("", 160, 128, 113, 21) $Label4 = GUICtrlCreateLabel("Durata Estensione (giorni agg.)", 8, 130, 149, 17) $Button1 = GUICtrlCreateButton("Avanti >", 536, 408, 75, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("< Indietro", 456, 408, 75, 25, $WS_GROUP) $Button3 = GUICtrlCreateButton("Annulla", 376, 408, 75, 25, $WS_GROUP) $Label2 = GUICtrlCreateLabel("Codice di prolungamento", 40, 152, 121, 17) $Input2 = GUICtrlCreateInput("", 160, 152, 201, 21) $Label5 = GUICtrlCreateLabel("Codice di attivazione", 57, 201, 102, 17) $Input3 = GUICtrlCreateInput("", 161, 201, 201, 21) GUISetState(@SW_SHOW)
While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button3 Exit Case $Button1 If GUICtrlRead($Input2) = "" Then MsgBox(16,"Trial Maker","Devi inserire un codice di prolungamento!") Else $ExtTime = GUICtrlRead($Input1) $ExtCode = GUICtrlRead($Input2) IniWrite(@ScriptDir&"\TrialOpt.ini","Options","ExtTime",$ExtTime) IniWrite(@ScriptDir&"\TrialOpt.ini","Options","ExtCode",$ExtCode) EndIf If GUICtrlRead($Input3) = "" Then MsgBox(16,"Trial Maker","Devi inserire un codice di attivazione!") Else $ActCode = GUICtrlRead($Input3) IniWrite(@ScriptDir&"\TrialOpt.ini","Options","ActCode",$ActCode) EndIf If GUICtrlRead($Input2) <> "" And GUICtrlRead($Input3) <> "" Then GUIDelete($Form1) _Step4() EndIf Case $Button2 GUIDelete($Form1) _Step2() EndSwitch WEnd EndFunc
Func _Step4() $Form1 = GUICreate("Trial Maker - Passo 4", 625, 445, 192, 124) $Label1 = GUICtrlCreateLabel("Passo 4 - Conservazione Sistema", 16, 8, 357, 37) GUICtrlSetFont(-1, 20, 400, 0, "Calibri") $Label3 = GUICtrlCreateLabel("Scegli dove conservare i dati necessari per il funzionamento del sistema.", 8, 64, 344, 17) $Button1 = GUICtrlCreateButton("Avanti >", 536, 408, 75, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("< Indietro", 456, 408, 75, 25, $WS_GROUP) $Button3 = GUICtrlCreateButton("Annulla", 376, 408, 75, 25, $WS_GROUP) $Radio1 = GUICtrlCreateRadio("Sul registro", 8, 128, 113, 17) GUICtrlSetState(-1, $GUI_CHECKED) $Radio2 = GUICtrlCreateRadio("Su un file", 8, 152, 113, 17) GUICtrlSetState(-1, $GUI_UNCHECKED) $Group1 = GUICtrlCreateGroup("Sistema su registro", 16, 184, 233, 129) $Input2 = GUICtrlCreateInput("", 104, 208, 121, 21) $Label6 = GUICtrlCreateLabel("Nome chiave", 32, 210, 67, 17) $Label7 = GUICtrlCreateLabel("NB: Evitare la pungeggiatura", 80, 232, 140, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Sistema su file", 256, 184, 281, 129) $Input1 = GUICtrlCreateInput("", 320, 206, 121, 21) $Label2 = GUICtrlCreateLabel("Nome file", 272, 208, 48, 17) $Label4 = GUICtrlCreateLabel("Posizione", 272, 240, 49, 17) $Combo1 = GUICtrlCreateCombo("", 320, 238, 145, 25) GUICtrlSetData(-1, "Cartella AppData|Cartella Script|Cartella Windows") $Label5 = GUICtrlCreateLabel("Attributi", 280, 272, 39, 17) $Checkbox1 = GUICtrlCreateCheckbox("Nascosto", 320, 272, 65, 17) $Checkbox2 = GUICtrlCreateCheckbox("Di sistema", 392, 272, 73, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlSetState($Input1,$GUI_DISABLE) GUICtrlSetState($Label2,$GUI_DISABLE) GUICtrlSetState($Label4,$GUI_DISABLE) GUICtrlSetState($Combo1,$GUI_DISABLE) GUICtrlSetState($Label5,$GUI_DISABLE) GUICtrlSetState($Checkbox1,$GUI_DISABLE) GUICtrlSetState($Checkbox2,$GUI_DISABLE) GUISetState(@SW_SHOW)
While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button3 Exit Case $Radio1 If GUICtrlRead($Radio2) = 4 Then GUICtrlSetState($Input1,$GUI_DISABLE) GUICtrlSetState($Label2,$GUI_DISABLE) GUICtrlSetState($Label4,$GUI_DISABLE) GUICtrlSetState($Combo1,$GUI_DISABLE) GUICtrlSetState($Label5,$GUI_DISABLE) GUICtrlSetState($Checkbox1,$GUI_DISABLE) GUICtrlSetState($Checkbox2,$GUI_DISABLE) Else GUICtrlSetState($Input1,$GUI_ENABLE) GUICtrlSetState($Label2,$GUI_ENABLE) GUICtrlSetState($Label4,$GUI_ENABLE) GUICtrlSetState($Combo1,$GUI_ENABLE) GUICtrlSetState($Label5,$GUI_ENABLE) GUICtrlSetState($Checkbox1,$GUI_ENABLE) GUICtrlSetState($Checkbox2,$GUI_ENABLE) EndIf If GUICtrlRead($Radio1) = 4 Then GUICtrlSetState($Input2,$GUI_DISABLE) GUICtrlSetState($Label6,$GUI_DISABLE) GUICtrlSetState($Label7,$GUI_DISABLE) Else GUICtrlSetState($Input2,$GUI_ENABLE) GUICtrlSetState($Label6,$GUI_ENABLE) GUICtrlSetState($Label7,$GUI_ENABLE) EndIf Case $Radio2 If GUICtrlRead($Radio2) = 4 Then GUICtrlSetState($Input1,$GUI_DISABLE) GUICtrlSetState($Label2,$GUI_DISABLE) GUICtrlSetState($Label4,$GUI_DISABLE) GUICtrlSetState($Combo1,$GUI_DISABLE) GUICtrlSetState($Label5,$GUI_DISABLE) GUICtrlSetState($Checkbox1,$GUI_DISABLE) GUICtrlSetState($Checkbox2,$GUI_DISABLE) Else GUICtrlSetState($Input1,$GUI_ENABLE) GUICtrlSetState($Label2,$GUI_ENABLE) GUICtrlSetState($Label4,$GUI_ENABLE) GUICtrlSetState($Combo1,$GUI_ENABLE) GUICtrlSetState($Label5,$GUI_ENABLE) GUICtrlSetState($Checkbox1,$GUI_ENABLE) GUICtrlSetState($Checkbox2,$GUI_ENABLE) EndIf If GUICtrlRead($Radio1) = 4 Then GUICtrlSetState($Input2,$GUI_DISABLE) GUICtrlSetState($Label6,$GUI_DISABLE) GUICtrlSetState($Label7,$GUI_DISABLE) Else GUICtrlSetState($Input2,$GUI_ENABLE) GUICtrlSetState($Label6,$GUI_ENABLE) GUICtrlSetState($Label7,$GUI_ENABLE) EndIf Case $Button1 If GUICtrlRead($Radio1) = 1 Then If GUICtrlRead($Input2) = "" Then MsgBox(16,"Trial Maker","Devi inserire il nome della chiave!") Else $KeyName = GUICtrlRead($Input2) IniWrite(@ScriptDir&"\TrialOpt.ini","Options","KeyName",$KeyName) EndIf EndIf If GUICtrlRead($Radio2) = 1 Then If GUICtrlRead($Input1) = "" Then MsgBox(16,"Trial Maker","Devi il nome del file!") Else $FileName = GUICtrlread($Input1) IniWrite(@ScriptDir&"\TrialOpt.ini","Options","FileName",$FileName) $Pos = GUICtrlRead($Combo1) If $Pos = "Cartella Script" Then $Pos = @ScriptDir IniWrite(@ScriptDir&"\TrialOpt.ini","Options","File",$Pos) ElseIf $Pos = "Cartella AppData" Then $Pos = @AppDataDir IniWrite(@ScriptDir&"\TrialOpt.ini","Options","File",$Pos) ElseIf $Pos = "Cartella Windows" Then $Pos = @WindowsDir IniWrite(@ScriptDir&"\TrialOpt.ini","Options","File",$Pos) EndIf If GUICtrlRead($Checkbox1) = 1 Or GUICtrlRead($Checkbox2) = 1 Then $Attrib = "+" If GUICtrlRead($Checkbox1) = 1 Then $Attrib &= "H" IniWrite(@ScriptDir&"\TrialOpt.ini","Options","Attributes",$Attrib) EndIf If GUICtrlRead($Checkbox2) = 1 Then $Attrib &= "S" IniWrite(@ScriptDir&"\TrialOpt.ini","Options","Attributes",$Attrib) EndIf EndIf EndIf GUIDelete($Form1) _Step5() Case $Button2 GUIDelete($Form1) _Step3() EndSwitch WEnd EndFunc
Func _Step5() $ProgName = IniRead(@ScriptDir&"\TrialOpt.ini","Options","ProgName","") $Author = IniRead(@ScriptDir&"\TrialOpt.ini","Options","Author","") $FirstTime = IniRead(@ScriptDir&"\TrialOpt.ini","Options","FirstTime","") $ExtTime = IniRead(@ScriptDir&"\TrialOpt.ini","Options","ExtTime","") $ExtCode = IniRead(@ScriptDir&"\TrialOpt.ini","Options","ExtCode","") $ActCode = IniRead(@ScriptDir&"\TrialOpt.ini","Options","ActCode","") $KeyName = IniRead(@ScriptDir&"\TrialOpt.ini","Options","KeyName",-1) $FileName = IniRead(@ScriptDir&"\TrialOpt.ini","Options","FileName",-1) $Pos = IniRead(@ScriptDir&"\TrialOpt.ini","Options","File",-1) $Attrib = IniRead(@ScriptDir&"\TrialOpt.ini","Options","Attributes",-1) $Form1 = GUICreate("Trial Maker - Passo 5", 625, 445, 192, 124) $Label1 = GUICtrlCreateLabel("Passo 5 - Generazione Codice", 16, 8, 322, 37) GUICtrlSetFont(-1, 20, 400, 0, "Calibri") $Label3 = GUICtrlCreateLabel("Attendi che il codice venga generato...", 8, 64, 187, 17) $Button1 = GUICtrlCreateButton("Avanti >", 536, 408, 75, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("< Indietro", 456, 408, 75, 25, $WS_GROUP) $Button3 = GUICtrlCreateButton("Annulla", 376, 408, 75, 25, $WS_GROUP) $Edit1 = GUICtrlCreateEdit("", 8, 136, 497, 249) $Label2 = GUICtrlCreateLabel("Copia il codice generato e copilalo in cima al tuo codice.", 8, 112, 269, 17) If $FileName <> -1 Then $FileName = Chr(34)&$FileName&Chr(34) EndIf If $Pos <> -1 Then $Pos = Chr(34)&$Pos&Chr(34) EndIf If $KeyName <> -1 Then $KeyName = Chr(34)&$KeyName&Chr(34) EndIf If $Attrib <> -1 Then $Attrib = Chr(34)&$Attrib&Chr(34) EndIf GUICtrlSetData($Edit1,"#include "&Chr(34)&"Trial.au3"&Chr(34)&@CRLF&@CRLF&"_TrialApply("&Chr(34)&$ProgName&Chr(34)&", "&$FileName&", "&$Pos&", "&$Attrib&", "&$FirstTime&", "&$ExtTime&", "&Chr(34)&$ExtCode&Chr(34)&", "&Chr(34)&$ActCode&Chr(34)&", "&$KeyName&")") $Button4 = GUICtrlCreateButton("Copia negli appunti", 512, 136, 99, 25, $WS_GROUP) GUISetState(@SW_SHOW)
While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button3 Exit Case $Button4 ClipPut(GUICtrlRead($Edit1)) Case $Button1 GUIDelete($Form1) _Step6() FileDelete(@ScriptDir&"\TrialOpt.ini") Case $Button2 GUIDelete($Form1) _Step4() EndSwitch WEnd EndFunc
Func _Step6() $Form1 = GUICreate("Trial Maker - Passo 5", 625, 445, 192, 124) $Label1 = GUICtrlCreateLabel("Passo 6 - Fine", 16, 8, 152, 37) GUICtrlSetFont(-1, 20, 400, 0, "Calibri") $Button1 = GUICtrlCreateButton("Avanti >", 536, 408, 75, 25, $WS_GROUP) $Button2 = GUICtrlCreateButton("< Indietro", 456, 408, 75, 25, $WS_GROUP) GUICtrlSetState(-1, $GUI_DISABLE) $Button3 = GUICtrlCreateButton("Fine", 376, 408, 75, 25, $WS_GROUP) $Label2 = GUICtrlCreateLabel("La procedura di creazione del codice della trial è completato! Clicca "&Chr(34)&"Avanti >"&Chr(34)&" per creare un nuovo codice.", 16, 72, 511, 17) GUISetState(@SW_SHOW)
While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button2 Exit Case $Button1 GUIDelete($Form1) _Step1() EndSwitch WEnd EndFunc Codice Trial: CODICE #cs GNU/GPL License Trial System Copyright (C) 2010 Nicolò Di Domenico
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. #ce
#include <Date.au3> #include <String.au3>
Func _TrialApply($ProgName, $FileName, $Pos, $Attrib, $FirstTime, $ExtTime, $ExtCode, $ActCode, $KeyName) If $FileName = -1 Then $FileName = "" If $Pos = -1 Then $Pos = "" If $KeyName = -1 Then $KeyName = "" If $Attrib = -1 Then $Attrib = "" If $FileName <> "" And $Pos <> "" Then If Not FileExists($Pos & "\"&$FileName) Then IniWrite($Pos & "\"&$FileName, "TrialStatus", "InstallPeriod", _StringEncrypt(1, _NowCalc(), @ComputerName)) IniWrite($Pos & "\"&$FileName, "TrialStatus", "TrialTime", _StringEncrypt(1, $FirstTime, @ComputerName)) If $Attrib <> "" Then FileSetAttrib($Pos & "\"&$FileName, $Attrib) SetError(0) If _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "TrialTime", ""), @ComputerName) <> "Licensed" Then $startdate = _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "InstallPeriod", ""), @ComputerName) $TrialTime = _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "TrialTime", ""), @ComputerName) $MissingDays = _DateDiff("D", $startdate, _NowCalc()) If $MissingDays > $TrialTime Then Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(52, $ProgName, "Il periodo di prova è scaduto. Vuoi attivare una licenza?") Select Case $iMsgBoxAnswer = 6 ;Yes $License = InputBox($ProgName, "Inserisci il codice licenza.") If @error = 1 Then Exit Else If Not $License = "" Then If $License = $ExtCode Then If _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "TrialTime", ""), @ComputerName) > 30 Then MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") Else If _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "TrialTime", ""), @ComputerName) <= 30 Then $TrialTime += 60 IniWrite($Pos & "\"&$FileName, "TrialStatus", "TrialTime", _StringEncrypt(1, $TrialTime, @ComputerName)) MsgBox(64, $ProgName, "Il periodo di prova è stato prolungato di "&$ExtTime&" giorni." & @CRLF & "Quest'azione non è ripetibile.") $License = "" Else MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") EndIf EndIf Else If $License = $ActCode Then IniWrite($Pos & "\"&$FileName, "TrialStatus", "TrialTime", _StringEncrypt(1, "Licensed", @ComputerName)) MsgBox(64, $ProgName, "Il prodotto è sotto licenza regolare.") $License = "" Else MsgBox(16, $ProgName, "La licenza inserita non è valida.") EndIf EndIf Else MsgBox(16, $ProgName, "Inserisci una licenza!") EndIf EndIf Case $iMsgBoxAnswer = 7 ;No Exit EndSelect Else Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(68, $ProgName, "Alla scadenza del periodo di prova mancano " & $TrialTime - $MissingDays & " giorni." & @CRLF & "" & @CRLF & "Vuoi attivare una licenza?") Select Case $iMsgBoxAnswer = 6 ;Yes $License = InputBox($ProgName, "Inserisci il codice licenza.") If @error = 1 Then Exit Else If Not $License = "" Then If $License = $ExtCode Then If _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "TrialTime", ""), @ComputerName) > 30 Then MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") Else If _StringEncrypt(0, IniRead($Pos & "\"&$ProgName, "TrialStatus", "TrialTime", ""), @ComputerName) <= 30 Then $TrialTime += 60 IniWrite($Pos & "\"&$FileName, "TrialStatus", "TrialTime", _StringEncrypt(1, $TrialTime, @ComputerName)) MsgBox(64, $ProgName, "Il periodo di prova è stato prolungato di "&$ExtTime&" giorni." & @CRLF & "Quest'azione non è ripetibile.") $License = "" Else MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") EndIf EndIf Else If $License = $ActCode Then IniWrite(@ScriptDir & "\info.nb3", "TrialStatus", "TrialTime", _StringEncrypt(1, "Licensed", @ComputerName)) MsgBox(64, $ProgName, "Il prodotto è sotto licenza regolare.") $License = "" Else MsgBox(16, $ProgName, "La licenza inserita non è valida.") EndIf EndIf Else MsgBox(16, $ProgName, "Inserisci una licenza!") EndIf EndIf EndSelect EndIf EndIf Else If _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "TrialTime", ""), @ComputerName) <> "Licensed" Then $startdate = _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "InstallPeriod", ""), @ComputerName) $TrialTime = _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "TrialTime", ""), @ComputerName) $MissingDays = _DateDiff("D", $startdate, _NowCalc()) If $MissingDays > $TrialTime Then Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(52, $ProgName, "Il periodo di prova è scaduto. Vuoi attivare una licenza?") Select Case $iMsgBoxAnswer = 6 ;Yes $License = InputBox($ProgName, "Inserisci il codice licenza.") If @error = 1 Then Exit Else If Not $License = "" Then If $License = $ExtCode Then If _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "TrialTime", ""), @ComputerName) > 30 Then MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") Else If _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "TrialTime", ""), @ComputerName) <= 30 Then $TrialTime += 60 IniWrite($Pos & "\"&$FileName, "TrialStatus", "TrialTime", _StringEncrypt(1, $TrialTime, @ComputerName)) MsgBox(64, $ProgName, "Il periodo di prova è stato prolungato di "&$ExtTime&" giorni." & @CRLF & "Quest'azione non è ripetibile.") $License = "" Else MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") EndIf EndIf Else If $License = $ActCode Then IniWrite($Pos & "\"&$FileName, "TrialStatus", "TrialTime", _StringEncrypt(1, "Licensed", @ComputerName)) MsgBox(64, $ProgName, "Il prodotto è sotto licenza regolare.") $License = "" Else MsgBox(16, $ProgName, "La licenza inserita non è valida.") EndIf EndIf Else MsgBox(16, $ProgName, "Inserisci una licenza!") EndIf EndIf Case $iMsgBoxAnswer = 7 ;No Exit EndSelect Else Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(68, $ProgName, "Alla scadenza del periodo di prova mancano " & $TrialTime - $MissingDays & " giorni." & @CRLF & "" & @CRLF & "Vuoi attivare una licenza?") Select Case $iMsgBoxAnswer = 6 ;Yes $License = InputBox($ProgName, "Inserisci il codice licenza.") If @error = 1 Then Exit Else If Not $License = "" Then If $License = $ExtCode Then If _StringEncrypt(0, IniRead($Pos & "\"&$FileName, "TrialStatus", "TrialTime", ""), @ComputerName) > 30 Then MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") Else If _StringEncrypt(0, IniRead($Pos & "\"&$ProgName, "TrialStatus", "TrialTime", ""), @ComputerName) <= 30 Then $TrialTime += 60 IniWrite($Pos & "\"&$FileName, "TrialStatus", "TrialTime", _StringEncrypt(1, $TrialTime, @ComputerName)) MsgBox(64, $ProgName, "Il periodo di prova è stato prolungato di "&$ExtTime&" giorni." & @CRLF & "Quest'azione non è ripetibile.") $License = "" Else MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") EndIf EndIf Else If $License = $ActCode Then IniWrite(@ScriptDir & "\info.nb3", "TrialStatus", "TrialTime", _StringEncrypt(1, "Licensed", @ComputerName)) MsgBox(64, $ProgName, "Il prodotto è sotto licenza regolare.") $License = "" Else MsgBox(16, $ProgName, "La licenza inserita non è valida.") EndIf EndIf Else MsgBox(16, $ProgName, "Inserisci una licenza!") EndIf EndIf EndSelect EndIf EndIf EndIf ElseIf $KeyName <> "" Then If RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"InstallPeriod") = "" And RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime") = "" Then RegWrite("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"InstallPeriod","REG_SZ", _StringEncrypt(1, _NowCalc(), @ComputerName)) RegWrite("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime","REG_SZ", _StringEncrypt(1, $FirstTime, @ComputerName)) SetError(0) If _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) <> "Licensed" Then $startdate = _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"InstallPeriod"), @ComputerName) $TrialTime = _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) $MissingDays = _DateDiff("D", $startdate, _NowCalc()) If $MissingDays > $TrialTime Then Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(52, $ProgName, "Il periodo di prova è scaduto. Vuoi attivare una licenza?") Select Case $iMsgBoxAnswer = 6 ;Yes $License = InputBox($ProgName, "Inserisci il codice licenza.") If @error = 1 Then Exit Else If Not $License = "" Then If $License = $ExtCode Then If _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) > 30 Then MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") Else If _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) <= 30 Then $TrialTime += 60 RegWrite("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime","REG_SZ", _StringEncrypt(1, $FirstTime, @ComputerName)) MsgBox(64, $ProgName, "Il periodo di prova è stato prolungato di "&$ExtTime&" giorni." & @CRLF & "Quest'azione non è ripetibile.") $License = "" Else MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") EndIf EndIf Else If $License = $ActCode Then RegWrite("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime","REG_SZ", _StringEncrypt(1, "Licensed", @ComputerName)) MsgBox(64, $ProgName, "Il prodotto è sotto licenza regolare.") $License = "" Else MsgBox(16, $ProgName, "La licenza inserita non è valida.") EndIf EndIf Else MsgBox(16, $ProgName, "Inserisci una licenza!") EndIf EndIf Case $iMsgBoxAnswer = 7 ;No Exit EndSelect Else Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(68, $ProgName, "Alla scadenza del periodo di prova mancano " & $TrialTime - $MissingDays & " giorni." & @CRLF & "" & @CRLF & "Vuoi attivare una licenza?") Select Case $iMsgBoxAnswer = 6 ;Yes $License = InputBox($ProgName, "Inserisci il codice licenza.") If @error = 1 Then Exit Else If Not $License = "" Then If $License = $ExtCode Then If _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) > 30 Then MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") Else If _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) <= 30 Then $TrialTime += 60 RegWrite("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime","REG_SZ", _StringEncrypt(1, $TrialTime, @ComputerName)) MsgBox(64, $ProgName, "Il periodo di prova è stato prolungato di "&$ExtTime&" giorni." & @CRLF & "Quest'azione non è ripetibile.") $License = "" Else MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") EndIf EndIf Else If $License = $ActCode Then RegWrite("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime","REG_SZ", _StringEncrypt(1, "Licensed", @ComputerName)) MsgBox(64, $ProgName, "Il prodotto è sotto licenza regolare.") $License = "" Else MsgBox(16, $ProgName, "La licenza inserita non è valida.") EndIf EndIf Else MsgBox(16, $ProgName, "Inserisci una licenza!") EndIf EndIf EndSelect EndIf EndIf Else If _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) <> "Licensed" Then $startdate = _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"InstallPeriod"), @ComputerName) $TrialTime = _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) $MissingDays = _DateDiff("D", $startdate, _NowCalc()) If $MissingDays > $TrialTime Then Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(52, $ProgName, "Il periodo di prova è scaduto. Vuoi attivare una licenza?") Select Case $iMsgBoxAnswer = 6 ;Yes $License = InputBox($ProgName, "Inserisci il codice licenza.") If @error = 1 Then Exit Else If Not $License = "" Then If $License = $ExtCode Then If _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) > 30 Then MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") Else If _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) <= 30 Then $TrialTime += 60 RegWrite("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime","REG_SZ", _StringEncrypt(1, $FirstTime, @ComputerName)) MsgBox(64, $ProgName, "Il periodo di prova è stato prolungato di "&$ExtTime&" giorni." & @CRLF & "Quest'azione non è ripetibile.") $License = "" Else MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") EndIf EndIf Else If $License = $ActCode Then RegWrite("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime","REG_SZ", _StringEncrypt(1, "Licensed", @ComputerName)) MsgBox(64, $ProgName, "Il prodotto è sotto licenza regolare.") $License = "" Else MsgBox(16, $ProgName, "La licenza inserita non è valida.") EndIf EndIf Else MsgBox(16, $ProgName, "Inserisci una licenza!") EndIf EndIf Case $iMsgBoxAnswer = 7 ;No Exit EndSelect Else Dim $iMsgBoxAnswer $iMsgBoxAnswer = MsgBox(68, $ProgName, "Alla scadenza del periodo di prova mancano " & $TrialTime - $MissingDays & " giorni." & @CRLF & "" & @CRLF & "Vuoi attivare una licenza?") Select Case $iMsgBoxAnswer = 6 ;Yes $License = InputBox($ProgName, "Inserisci il codice licenza.") If @error = 1 Then Exit Else If Not $License = "" Then If $License = $ExtCode Then If _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) > 30 Then MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") Else If _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime"), @ComputerName) <= 30 Then $TrialTime += 60 RegWrite("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime","REG_SZ", _StringEncrypt(1, $TrialTime, @ComputerName)) MsgBox(64, $ProgName, "Il periodo di prova è stato prolungato di "&$ExtTime&" giorni." & @CRLF & "Quest'azione non è ripetibile.") $License = "" Else MsgBox(16, $ProgName, "Hai già usato il prolungamento del periodo di prova!") EndIf EndIf Else If $License = $ActCode Then RegWrite("HKCU\Software\Microsoft\Windows\Current Version"&$KeyName,"TrialTime","REG_SZ", _StringEncrypt(1, "Licensed", @ComputerName)) MsgBox(64, $ProgName, "Il prodotto è sotto licenza regolare.") $License = "" Else MsgBox(16, $ProgName, "La licenza inserita non è valida.") EndIf EndIf Else MsgBox(16, $ProgName, "Inserisci una licenza!") EndIf EndIf EndSelect EndIf EndIf EndIf EndIf EndFunc Io lascio il sistema così com'è, ma se vedo qualcuno che ne approfitta mi costringerete ad offuscarlo!
| | |
| |
|