<p>We're doing an "Amazing Race" kind of event, and thought it would be cool to have CDs that could only play once... like a "this message will self destruct in 5 seconds..." </p>

<p>Any thoughts on how to do this?  I was thinking it could be a compiled HTML website that would write a cookie and only play once.  I don't want to write to the registry (don't want to depend on windows, don't want to install anything, etc).</p>

<p>I also don't care if it's hackable... This is a one-time fun event, and I don't really care too much if people could remove the cookie or something.</p>

<p>Any other ideas?</p>

[{'answer_id': 42244, 'author': 'Brian Lyttle', 'author_id': 636, 'author_profile': 'https://Stackoverflow.com/users/636', 'pm_score': 2, 'selected': False, 'text': "<p>If the content is HTML and run inside a normal browser window, then a cookie may work but there are caveats:</p>\n\n<ul>\n<li>User runs the CD once when IE is the default browser. User runs at a later time, when Firefox is the default browser so cookie cannot be checked.</li>\n<li>The browser's security settings may be locked down to prevent use of script so the cookie cannot be set (more of an IE problem).</li>\n</ul>\n\n<p>An alternative might be Flash's equivalent of cookies, but if script was locked down then the same may be true for Flash.</p>\n"}, {'answer_id': 42249, 'author': 'pc1oad1etter', 'author_id': 525, 'author_profile': 'https://Stackoverflow.com/users/525', 'pm_score': 1, 'selected': False, 'text': "<p>Not quite what you're looking for, but you could put in on re-writable media and have an executable over-write itself (or part of itself).</p>\n\n<p>I don't know if a CD-RW could do that automatically, or if you would have to look at cheap USB sticks.</p>\n"}, {'answer_id': 42265, 'author': 'John Sheehan', 'author_id': 1786, 'author_profile': 'https://Stackoverflow.com/users/1786', 'pm_score': 2, 'selected': False, 'text': '<p>Will the computers this is run on have internet access? You can easily load up a remote url (execute \'start <a href="http://yoururl.com" rel="nofollow noreferrer">http://yoururl.com</a>\' from autorun.inf), store the cookie and prevent it from being loaded again if the cookie exists.</p>\n'}, {'answer_id': 42268, 'author': 'Kamiel Wanrooij', 'author_id': 4174, 'author_profile': 'https://Stackoverflow.com/users/4174', 'pm_score': 2, 'selected': False, 'text': "<p>I would say encrypt (part of) the contents of the disc with a unique one time pad, that you request from a server that does a read directly followed by a delete of the decryption key. You could write an identifier on each disk so you can use multiple disks, each with a unique key.</p>\n\n<p>This requires network access and some encryption tools, but a very simple implementation would do what you want it to do, is feasible, and it would be 'unbreakable' unless the one time pad is captured and stored.</p>\n\n<p>If just for fun, this should be secure enough.</p>\n"}, {'answer_id': 42291, 'author': 'Raleigh Buckner', 'author_id': 1153, 'author_profile': 'https://Stackoverflow.com/users/1153', 'pm_score': 2, 'selected': False, 'text': '<p>If you used Flash to create the content, you could then use a wrapper program such as <a href="http://multidmedia.com/" rel="nofollow noreferrer">Zinc</a> to produce cross-platform executables of the content. </p>\n\n<p>Then, the Flash could use its version of cookies (<a href="http://en.wikipedia.org/wiki/Local_Shared_Object" rel="nofollow noreferrer">local shared objects</a>) to determine when the content has been displayed - write to the LSO the first time and read from it thereafter.</p>\n'}, {'answer_id': 42417, 'author': 'Domenic', 'author_id': 3191, 'author_profile': 'https://Stackoverflow.com/users/3191', 'pm_score': 2, 'selected': False, 'text': "<p>If it's allowed to be hackable, then I'd just go with a simple solution of HTML + JavaScript, requiring (say) a GUID to enter, with some silly obfuscation in the code to validate the GUID.</p>\n\n<p>What I mean by silly obfuscated validation is something like putting together a big array of ROT13'ed GUIDs, then adding code to only accept the <code>Math.floor(PI * E + 32/(new DateTime()).getYear())</code>'th GUID in the array, and ROT13 it again using sufficiently uncommented/unclear code, <em>then</em> check the user input against the result. Do it all in one line for kicks, or generate the GUIDs in some pseudo-random manner using a known seed... you get the idea :).</p>\n\n<p>The only snag might be if IE doesn't allow local JavaScript? Hmm, looks like they'd need to deal with the InfoBar thing :(.</p>\n"}, {'answer_id': 42449, 'author': 'UnkwnTech', 'author_id': 115, 'author_profile': 'https://Stackoverflow.com/users/115', 'pm_score': 2, 'selected': False, 'text': '<p>You could also set a registry key that would prevent playing, though this could be bypassed.</p>\n'}, {'answer_id': 44460, 'author': 'Fernando Barrocal', 'author_id': 2274, 'author_profile': 'https://Stackoverflow.com/users/2274', 'pm_score': 2, 'selected': False, 'text': '<p>I think your best bet is to use Rewritable media for this. You can create your application easily, like HTML site or something like that, and after the last link or last page, however you decide to do you could execute a script with some command-line burner that would erase the rewritable media, or even write an ISO that you keep in CD with a text file or a flash that explains that the CD is lost forever.</p>\n\n<p>Give a look at some Command Line Burners. Linux have several, that isn\'t worth to mention here, for windows you can use <a href="http://www.google.com.br/search?rlz=1C1GGLS_pt-BRBR291&amp;sourceid=chrome&amp;ie=UTF-8&amp;q=Cheetah+CommandLine+Burner" rel="nofollow noreferrer">Cheetah CommandLine Burner</a> among several others. </p>\n\n<p>If you wish to do a CD without depending on the installed OS you should give a look at LIVE CDs. FreeDOS is a choice for "DOS Compatible applications" or my suggestioon you use a <a href="http://www.frozentech.com/content/livecd.php" rel="nofollow noreferrer">Linux live CD</a>.</p>\n\n<p>Also you will have several options for small HTTP servers, like lighthttpd and even browsers in several flavors from text interfaces to the graphical ones.</p>\n\n<p>Good luck on the race :D. Great idea BTW!</p>\n'}, {'answer_id': 47719, 'author': 'Eugene Yokota', 'author_id': 3827, 'author_profile': 'https://Stackoverflow.com/users/3827', 'pm_score': 2, 'selected': False, 'text': '<p>Make a Java Swing application. That will not require Internet and it runs on Mac, Windows, and Linux. You can write to the file system for the lock. <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html" rel="nofollow noreferrer">System.getProperty("user.home")</a> gives you the home equivalent for the platform. You might have to include a jre in your CD.</p>\n'}, {'answer_id': 48990, 'author': 'Nick Zalutskiy', 'author_id': 1959, 'author_profile': 'https://Stackoverflow.com/users/1959', 'pm_score': 2, 'selected': False, 'text': '<p>You can create a volatile registry entry. It will only exist untill the computer is restarted. This solution is very much "hackable", but it is simple and may suffice for what you want to do.</p>\n\n<p>Take a look at the REG_OPTION_VOLATILE <a href="http://msdn.microsoft.com/en-us/library/ms724844(VS.85).aspx" rel="nofollow noreferrer">here</a>.</p>\n'}]
['https://Stackoverflow.com/questions/42239', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1753/']