views:

699

answers:

17
+13  Q: 

Make a CD run once

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..."

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).

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.

Any other ideas?

+3  A: 

If the content is HTML and run inside a normal browser window, then a cookie may work but there are caveats:

  • 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.
  • 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).

An alternative might be Flash's equivalent of cookies, but if script was locked down then the same may be true for Flash.

BrianLy
A: 

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).

I don't know if a CD-RW could do that automatically, or if you would have to look at cheap USB sticks.

pc1oad1etter
+3  A: 

@Tanoku

WTF? This is a perfectly good question, of a programming nature. The whole reason this site exists is so that people can ask good questions and get good answers, and there is not another site that does this well, and has a good community behind it. Please, if this is how helpful you will be, perhaps you should go to Yahoo! Answers and help people understand how babby is formed.

Chris Marasti-Georg
+1  A: 

Will the computers this is run on have internet access? You can easily load up a remote url (execute 'start http://yoururl.com' from autorun.inf), store the cookie and prevent it from being loaded again if the cookie exists.

John Sheehan
A: 

We currently don't have any content at all. My other thought was a Silverlight/Flash application on a USB drive, but CDs are a ton cheaper.

A self-destructive executable on a CD-RW would be awesome! Can an application automatically access the CD burner like that?

Nathan DeWitt
+2  A: 

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.

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.

If just for fun, this should be secure enough.

Kamiel Wanrooij
A: 

I can't control the platform this will run on, so it might be OSX, Vista, Linux, etc. I might not be up to the task of writing a multi-platform application like this (would Java be able to do this?)

@Kamiel - that's a good idea, but I don't think people will have internet connections. This is like a scavenger hunt... they'll be outside and walking around.

Nathan DeWitt
A: 

@John, probably no internet access. I'll confirm that though.

If they have internet, then I can just make a website and control who can see it that way, maybe by giving them a unique code or something.

This is a puzzle-ish activity, so I could totally generate some GUIDs and then have them enter that to view the content. On the server-side I can only allow a GUID to view the content once.

Nathan DeWitt
+3  A: 

If you used Flash to create the content, you could then use a wrapper program such as Zinc to produce cross-platform executables of the content.

Then, the Flash could use its version of cookies (local shared objects) to determine when the content has been displayed - write to the LSO the first time and read from it thereafter.

81bronco
A: 

@81bronco - Zinc is $350. I'm looking for easy and cheap. Sorry I didn't mention it earlier.

If I make a Flash app, can't I also include a runtime or something on the CD for OS X, Win, & Linux?

Nathan DeWitt
+1  A: 

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.

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 Math.floor(PI * E + 32/(new DateTime()).getYear())'th GUID in the array, and ROT13 it again using sufficiently uncommented/unclear code, then 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 :).

The only snag might be if IE doesn't allow local JavaScript? Hmm, looks like they'd need to deal with the InfoBar thing :(.

Domenic
+1  A: 

You could also set a registry key that would prevent playing, though this could be bypassed.

Unkwntech
A: 

@Unkwntech, setting a registry flag limits this to Windows. I suspect there will be a good number of Mac users out there, though probably no Linux laptop users for this event.

Nathan DeWitt
+1  A: 
Fernando Barrocal
+1  A: 

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. System.getProperty("user.home") gives you the home equivalent for the platform. You might have to include a jre in your CD.

eed3si9n
+1  A: 

This could be exactly what you want if your participants have internet access.

http://www.destructingmessage.com

qwertyuu
We ended up going with this because the easy-to-implement factor was through the roof. Thanks.
Nathan DeWitt
+2  A: 

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.

Take a look at the REG_OPTION_VOLATILE here.

Nick