Sign in to follow this  
Followers 0
iceberg

Execute Once and only Once!

14 posts in this topic

Hi,

Just wondering if it is possible to write a program using AU3 which can only be launched/executed once...meaning that once it has been launched, even if the user brings the program to another PC, it should NOT launch again.

thanks.


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites



why not just delete the file then after it runs?

Share this post


Link to post
Share on other sites

If you want to know how to delete your program have a look here.

Share this post


Link to post
Share on other sites

once...meaning that once it has been launched, even if the user brings the program to another PC, it should NOT launch again.

help file: _Singleton()

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

hi,

thanks for the replies. i can't delete the file cos its gonna be distributed via a cd media.

pls asisst. thanks.


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

pls asisst. thanks.

O.K. AGAIN: beta help file: _Singleton()

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

hi kurt,

thanks again for the reply. what i actually meant was a way to "protect" the file. meaning the program will have some kind of a protection method which will prevent the user from running the program twice.

eg...user runs the program on monday at 7pm. shuts down the pc and turns it on wed at 3pm. when he launches the program, it should prompt him that the program has "extinct". meaning he can't use the program ever again. he won't be able to open the program even if he runs it on a diff pc.

how?


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

eg...user runs the program on monday at 7pm. shuts down the pc and turns it on wed at 3pm. when he launches the program, it should prompt him that the program has "extinct". meaning he can't use the program ever again. he won't be able to open the program even if he runs it on a diff pc.

how?

Ah, O.K. There have been several discussions about this. Search the forum for something like "+run +once" or "+code +protect".

Basically this is what you can do:

  • Create a registry entry when the tool is run the first time. Then check that entry every time the tool starts
  • Instead of the registry write a kind of log file
Problem: It is easy to reverse engineer those methods and to delete the entries in the file or registry.
  • Create a uniqe ID for the computer that runs the tool and send that information to your server on the internet. The server can then check if the tool was already started earlier. If the tool has expired it will return an appropriate message to your tool, which then exits. You can use the TCP functions to acomplish this.
EDIT: Reading your first post again, only the later method will work, especially if you distribute the tool via a CD!

Cheers

Kurt

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

thanks alot for the info Kurt!


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

Ah, O.K. There have been several discussions about this. Search the forum for something like "+run +once" or "+code +protect".

Basically this is what you can do:

  • Create a registry entry when the tool is run the first time. Then check that entry every time the tool starts
  • Instead of the registry write a kind of log file
Problem: It is easy to reverse engineer those methods and to delete the entries in the file or registry.
  • Create a uniqe ID for the computer that runs the tool and send that information to your server on the internet. The server can then check if the tool was already started earlier. If the tool has expired it will return an appropriate message to your tool, which then exits. You can use the TCP functions to acomplish this.
EDIT: Reading your first post again, only the later method will work, especially if you distribute the tool via a CD!

Cheers

Kurt

Then you got a problem with most people who are running a good firewall. If you use the last method you got the next problems:

  • Firewall
  • Simple disable your internet connection
  • Some people wich still doesn't have permanent internet connection

Share this post


Link to post
Share on other sites

Then you got a problem with most people who are running a good firewall. If you use the last method you got the next problems:

  • Firewall
  • Simple disable your internet connection
  • Some people wich still doesn't have permanent internet connection

well, you could use TCP/80 which is open on most of the firewalls for home use.

Otherwise you are right. People without internet connection won't be able to use the tool. It's a tradeoff between protecting the tool and having a lot of happy "customers".

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

hhmm...thanks for highlighting potential problems....


mouse not found....scroll any mouse to continue.

Share this post


Link to post
Share on other sites

@iceberg,

Take a look at Larry's function here which can write to the tail of exe itself so it can run a second time with the knowledge of the change. No good if used on read only media.

@Kurt,

Nice to see you back :D

Share this post


Link to post
Share on other sites

@Kurt,

Nice to see you back :D

Thanks ...

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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