Sign in to follow this  
Followers 0
Justforfun

Single Computer Installation

1 post in this topic

#1 ·  Posted (edited)

Hello,

I hope this is posted in the right area. If not can someone move it to where it belongs thank you.

Everyone I don't know if there is anything like this on the forums I didn't look much, I did find some time trials I have a solution for I found further down on this post. First part I wrote a small script for single computer installation for programs that you make to prevent sharing. What it does the first time you run the program is checks for the file Register.txt if it exists it will ask you to enter the register key, if entered correctly it then writes it to the registry then it will read the registry to verify it is there and move the Register.txt file to the temp file.

On the next run it will verify the registry key is present then continue running the program. Now what this does if they try to share your program, say they sent it to a friend it would check his/her computer registry for the key and it will not be there because the Register.txt was removed after the first run of the program so it will exit the program and will not work on the new computer.

The Register.txt is where you would put the key so they know what to enter 000-000-000-0000

#include <String.au3>
If FileExists(@ScriptDir & "\Register.txt") Then      ; checks if file exists

$Keyentery =InputBox("Unlock", "Please Enter Your Key")  ; input box for the key
$Keyverify = "000-000-000-0000"             ; place the special key you want them to enter here

If $Keyentery = $Keyverify Then ; verify key entered against key
     $Unlock = $Keyentery
Else
    MsgBox( 1, "Error", "Your Key is Incorret", 0, 0)
    Exit
EndIf  ; exits if keys do not match

$Skeyvalue = $Unlock ; sets key if correct

If RegRead("HKCU\Software\Microsoft\Windows\Current Version", "Value") = "" Then  ; this checks if the key has been written yet
    RegWrite("HKCU\Software\Microsoft\Windows\Current Version", "Value", "REG_SZ", _StringEncrypt(1, $Skeyvalue, @ComputerName)) ; This part writes the key to the registry and encrypts it

    SetError(0)
EndIf
EndIf

$Test = _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version", "Value"), @ComputerName) ; This reads the encrypted key in the registry

If $Test = "000-000-000-000" Then
    Call("Delete")
Else
    MsgBox(1, "Error", "You have not Entered Your Key or You did Not Purchase This Bot.", 0, 0)
    Exit
EndIf

Func Delete()
FileMove(@ScriptDir & "\Key.txt", @TempDir, 1) ; This moves the file Register.txt to the temp folder
EndFunc

; Security Key Stops Here

Now I found this code awhile back I give Credit to the writer it is not mine, I did make a few modifications.

#include <Date.au3>
#include <String.au3>
; Put the name of your  script here
$sScript_Name = "script name" ; 

; This part writes the date to the registry the first time the script is run
If RegRead("HKCU\Software\Microsoft\Windows\Current Version", $sScript_Name) = "" Then
    RegWrite("HKCU\Software\Microsoft\Windows\Current Version", $sScript_Name, "REG_SZ", _StringEncrypt(1, _NowCalc(), @ComputerName))
    SetError(0)
EndIf

; This part reads the encrypted date from the registry
$sStartDate = _StringEncrypt(0, RegRead("HKCU\Software\Microsoft\Windows\Current Version", $sScript_Name), @ComputerName)

; And this part decides if 30 days have passed!
$diff = _DateDiff("D", $sStartDate, _NowCalc())
If $diff > 30 Then
    ToolTip(" Your 30 Day Pass Has Expired ", 500, 500, " Time to renew your pass")
        Sleep(4000)
    ToolTip("")
    Exit
Else
    ToolTip("Your have " & 30 - $diff & " days left.", 500, 500, "")
    Sleep(4000)
    ToolTip("")
EndIf

The only problem I found with this use of a trial script is that they can set there computer clock back wards and the program will still work after the trial is up so I added this in my script before this part is executed.

;~ Time Sync Security Dialog 
Sleep(1000)
Run(@ScriptDir & "\Neutron.exe", "", @SW_HIDE) ; runs Neutron time sync
ProcessWait("Neutron.exe") ; waits for Neutron to run so if they tamper with it or the .ini file, it will not run Neutron there for the script will never run
$s = WinGetPos("Neutron")
$ProcessID1 = WinGetProcess("Neutron", "")
If $ProcessID1 = -1 Then
    MsgBox(4096, "ERROR", "Failed to set timesync security") ; this error is for if they delete or tamper with Neutron making it not run
    Exit
EndIf
ToolTip("Connecting .. Verifying Trial Time Sync", $s[0], $s[1] + $s[3], "Security Process Time Sync")
ProcessWaitClose("Neutron.exe")  ; this will close Neutron and continue to the trial part of your script
ToolTip("")
;~ End of Time Sync Security

Now I give all Credits to Robin Keir at http://keir.net/neutron.html for this lovely free program Neutron Time Sync. I use this script to force set there time to the correct time before running the trial part of the script so if they set there clock back it will fix it first.

Hope someone finds this helpful all these scripts put together order 1. Register Key 2. Time Sync 3. Trial will make you program a single computer installation with a time trial to what you want it set at. Enjoy.

Feed back will be appreciated thank you

Edited by Justforfun

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0