LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Having an executable expire

I was curious what the best way would be to have an executable expire after a certain amount of time, but I don't want the system to be fooled by having someone turn back the clock on their computer. There will also not be internet where this exe is running, so it can't pull current time that way. 

 

I was thinking just save the current time into some sort of locked file and load it at run time. If the next time read is prior to the date/time that was previously saved then throw some error to the user. 

0 Kudos
Message 1 of 12
(3,455 Views)

It's unclear if you want the program to run "until October 3, 2018" or "for the next 2 hours".  The first would be tricky if you worry about the User changing the PC's clock -- if you allow the program to start and stop, how would you detect a reset of the time (without a lot of effort)?  If it's for a maximum continuous time, that's easier, as it would be difficult (impossible?) for the User to change the clock while your code is running -- you could just use an Elapsed Time function.

 

How much effort is this worth?

 

Bob Schor

0 Kudos
Message 2 of 12
(3,432 Views)

There is the Third-Party Licensing and Activation Toolkit

 

Quote: 

  • Provide "try before you buy experience" by implementing time-expiring evaluations
0 Kudos
Message 3 of 12
(3,431 Views)

I want the program to run "until October 3, 2018". This needs to be a function of the program, as requested by the client. 

0 Kudos
Message 4 of 12
(3,394 Views)

I was playing around with the Third Party Licensing and Activation Toolkit, but it looked like I could only select classes and VIs to expire and not an exe. It also looked like it required internet access in order to activate/extend the software. 

0 Kudos
Message 5 of 12
(3,389 Views)

The simplest solution is to get the data and time when starting the program and exit if after the date.

 

Is this perfect, no certainly not.  But you can put start and stop times into the registry and make sure each start time is later than either of the last start or stop times.

 

There is no perfect solution I think if your PC is non-networked.  Even the BIOS can have its date put back.

0 Kudos
Message 6 of 12
(3,381 Views)

From the linked page on the toolkit:

 

"Deployment Licensing: Licensing an application/executable built with LabVIEW for users to implement. The licensing checks must be manually added to the source code using the provided Licensing VIs, and the licensing checks are performed during run time (when the application is run). "

 

I haven't used it myself, but it sure looks like that's what you're looking for. I'd look there again.

0 Kudos
Message 7 of 12
(3,365 Views)

@MaddieDrakeDMC wrote:

I want the program to run "until October 3, 2018". This needs to be a function of the program, as requested by the client. 


Ask the client how hard this should be to break. You might be making more of this that you need to. The client might think of this as a clever feature, while you might think of it as a anti-hacking project. If they want it tight, make them pay more. Otherwise, it's an completely open specification.

 

If the program just needs to stop, just get the ms ticks and compare with the start regularly. If it wrapped around it's U32, increase a counter. It would be easier to simply check the time, but that would be easy to fool by changing the time.

 

It's still not entirely clear to me if you want to auto-stop each program instance when started, or if you want the program to stop from being started altogether after a certain date\time.

0 Kudos
Message 8 of 12
(3,335 Views)

I would like the program to stop from being started all together after a certain date/time. 

0 Kudos
Message 9 of 12
(3,318 Views)

Consider having the program be two parts.  One is a launcher.  If the date is okay it launches the 2nd executable.

If the date has passed, have it delete the 2nd executable and tell the user that time has expired.

0 Kudos
Message 10 of 12
(3,302 Views)