I'm working on a project that has a proprietary file format. The project has a large install-necessary program and a smaller viewer that requires no install. I would like to be able to export files from my main application that are 'self opening' .exe's - that is, you can double click the exe and the embedded file will show (this is to make passing around the viewer to people who have NOT installed the main application able to view it - they will only pass around the document).
I'm a little lost on how to do this. My two thoughts that I've been investigating have come to a dead end. They are:
1) Embed the file in the viewer. I can do this manually through Visual Studio, and I've got a working demo of that, but I can't figure out a way to do this on the fly.
2) Create a self-extracting archive that extracts the file and the exe to temp and runs the exe with the file's name on command line. This sounds easy and possible (albeit hacky), but I've run into the issue that archive or install programs don't seem to have the command line necessary to do all that.
Any ideas? I prefer the second because it's easy, but the first because it seems more bullet proof / less hacky.