manojba Posted January 31, 2009 Report Share Posted January 31, 2009 I want to make an evaluation version in labview that lasts for 15 days, how can I do an executable or installer in labview that works perfectly during this time and afterall it stops and then it should not work anymore? hope to get reply asap thanks in advance... Quote Link to comment
PaulG. Posted January 31, 2009 Report Share Posted January 31, 2009 Simplest approach I know of: Quote Link to comment
LAVA 1.0 Content Posted January 31, 2009 Report Share Posted January 31, 2009 QUOTE (PaulG. @ Jan 30 2009, 09:59 AM) Simplest approach I know of: http://lavag.org/old_files/monthly_01_2009/post-3786-1233331014.png' target="_blank"> Same idea as Paul G, but write the time of the first run into the registry (assuming you are running on Windows). Every time the application starts, check the registry location. If the entry is not there you assume that it is the first run and you write the time/date to the registry. If the entry is already there then check to see how much time has passed, and if it is more than 15 days, exit the application. To make the registry entry harder to find manually, do not use an obvious name for the key and encode the value (time/date) using some simple algorithm. Quote Link to comment
manojba Posted April 7, 2009 Author Report Share Posted April 7, 2009 QUOTE (LV_FPGA_SE @ Jan 30 2009, 09:44 PM) Same idea as Paul G, but write the time of the first run into the registry (assuming you are running on Windows). Every time the application starts, check the registry location. If the entry is not there you assume that it is the first run and you write the time/date to the registry. If the entry is already there then check to see how much time has passed, and if it is more than 15 days, exit the application.To make the registry entry harder to find manually, do not use an obvious name for the key and encode the value (time/date) using some simple algorithm. I know I am catching up this post after long time actually i was stuck up with some other work, I tried what you said like writing date to registry and then reading it from there but its not working because i can write to registry only in three data type ie DWORD,BINARY and STRING once i write my date and time in any of these fromat I am not able to convert it back to Labview time stamp with same date and time its gives some other junk values so how do i do it... Quote Link to comment
hooovahh Posted April 7, 2009 Report Share Posted April 7, 2009 You can convert the time stamp to a string then write to the registry. Then convert from string back to time stamp when you read from the registry. EDIT: The name of those primitives is Flatten To String, and Unflatten From String Quote Link to comment
manojba Posted April 8, 2009 Author Report Share Posted April 8, 2009 QUOTE (hooovahh @ Apr 6 2009, 08:46 PM) You can convert the time stamp to a string then write to the registry. Then convert from string back to time stamp when you read from the registry. EDIT: The name of those primitives is Flatten To String, and Unflatten From String Thanks hooovahh but there are two problems doing this once you see my code you will come to know which I have attached here the first problem is it gives an generic error for first time it runs(this happens bcoz there is no value in register the first time it is read then the value is written and second time it runs smoothly so how to avoid this error first time) and second is how do I add exactly fifteen days to value read from register bcoz its in binary string or time stamp value... Quote Link to comment
hooovahh Posted April 8, 2009 Report Share Posted April 8, 2009 On the unbundle of the error cluster check to see what the error code number is. If the error code is equal to the known error code for having no registry key to read, then clear the error and write to the registry the date plus 15 days. As for how to calculate what today's date plus 15 days is, take the time stamp and add 1,296,000 to that number (wire the primitive add to the time stamp and add a double with the value of 1,296,000 to it) if you were wondering there are 1,296,000 seconds in 15 days. Quote Link to comment
manojba Posted April 9, 2009 Author Report Share Posted April 9, 2009 QUOTE (hooovahh @ Apr 8 2009, 01:28 AM) On the unbundle of the error cluster check to see what the error code number is. If the error code is equal to the known error code for having no registry key to read, then clear the error and write to the registry the date plus 15 days.As for how to calculate what today's date plus 15 days is, take the time stamp and add 1,296,000 to that number (wire the primitive add to the time stamp and add a double with the value of 1,296,000 to it) if you were wondering there are 1,296,000 seconds in 15 days. Thanks hooovahh now its working I used an error cluster at the end to handle it, it was Generic error 42 not a known error but the most important question is do you think this method really works(initially suggested by PaulG) to create an evaluatiion build by writing system time to registry what if somebody changes the system time I tried it this method completely fails what now... :thumbdown: Quote Link to comment
Neville D Posted April 9, 2009 Report Share Posted April 9, 2009 QUOTE (manojba @ Apr 7 2009, 11:18 PM) ..what if somebody changes the system time I tried it this method completely fails what now... :thumbdown: Ultimately you have to evaluate whether the user will actually go to those lengths just to use your evaluation software longterm. Imagine having a production test system and having to manipulate the system date every two weeks just to use some software messing up other applications like databases, spreadsheets etc..! What is it you are writing that is going to enthuse your users to cheat on paying you? N. Quote Link to comment
hooovahh Posted April 10, 2009 Report Share Posted April 10, 2009 I sometimes wonder how larger software companies accomplish this. If a piece of software has a 30 day trial and you turn back the clock, some times it will work, but most of the time (not that I've done this alot) it will know you changed the clock. Does it check the Windows time against the time that the bios says it is? How does it know you changed the time? If you are concerned that users are going to change the system time, you could just make it more complicated. Like every time the program runs write the current time to the registry (but not in an obvious format you could encrypt it with a system string) and if the new time is before the time in the registry then someone changed the system clock, and the software should exit. Quote Link to comment
crelf Posted April 10, 2009 Report Share Posted April 10, 2009 QUOTE (hooovahh @ Apr 9 2009, 09:31 AM) I sometimes wonder how larger software companies accomplish this. If a product needs to know the real time, you can write a call to a http://en.wikipedia.org/wiki/Time_server' rel='nofollow' target="_blank">network time server through NTP (if your system has access to the internet). Quote Link to comment
manojba Posted April 14, 2009 Author Report Share Posted April 14, 2009 Thanks everyone for your usefull suggestions I have found out my own method of tackling this problem and its working fine... Quote Link to comment
Mark Yedinak Posted April 14, 2009 Report Share Posted April 14, 2009 QUOTE (manojba @ Apr 12 2009, 11:51 PM) Thanks everyone for your usefull suggestions I have found out my own method of tackling this problem and its working fine... Would you mind giving us some details about how you handled it? After all, the intent of LAVA is to share good ideas. If you found a good way of doing this I am sure others would appreciate hearing about your solution. Quote Link to comment
manojba Posted April 17, 2009 Author Report Share Posted April 17, 2009 QUOTE (Mark Yedinak @ Apr 13 2009, 08:57 PM) Would you mind giving us some details about how you handled it? After all, the intent of LAVA is to share good ideas. If you found a good way of doing this I am sure others would appreciate hearing about your solution. In My application I am writing current date + 30 days to registry the first time application runs and then on i just read it from registry every time application runs and check weather current date is more than what is written in registry if it is more than 30 days the application stops all this is fine but when user sets back his system date say 20 days back the application again runs for 20 days so to over come this what i have done is, the day 30 days are over I again write to system registry some time which is so backward like 16/4/1985 user will never think of setting his system time to such a date I know this method maybe funny for some but it works for me... Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.