-
Does anyone know how to add a file to a program? What I mean is, say if the user didn't have this sound file, how would I distibute it with the program without the P&D wizard? I thought about storing all the contents of the wave file in a textbox, and then writing it to the hard drive later, then playing it, but that would be to stupid.
So if nobody understands, please say so and I will try to be more specific.
-
Whatever you do, don't add it into a textbox, it removes all the chr(0)
I havent used the P&D wizard cuz i have vb5, but can't you add your file into that.
-
If you include the file in the P&D wizard, then the user can freely change the file to a different one. Say if I had "beep.wav", the user could either rename it, or change the sound to "meep.wav" or something. It must able to be done.
-
Well, I don't think thats a problem. We have tons of files we can change name on our computer that belongs to other applications that will crash if you rename. That's users own problem if he gotta change it to meep.wav
You can always include a search that search for this specific wav file whatever it has been renamed to, but i think thats a waste of time
This is what I think youre trying to do: Protect the file from manipulation
If you really want that noone goes and overwrite/record hes/her own scream into your beep.wav and then it plays in your app, you can encrypt that file so that it cant be played from outside neither been replaced by another file. Of couse it could but it wont work.
If you're desperate having that file in your compiled exe, you can put it into a rtfbox, it wont remove the chr(0)
-
The trouble is, the file has to be deleted after it is used. It isn't a beep.wav, but evillarf.wav. After the program has finished what it is doing it shows a laughing Jolly Roger.
-
You may integrate that into your exe, extract it and put it open so that no other app or user may modify or delete it (without unlocking your harddisk protection). Then after closing it, kill it
-
That's right.
If you send it out you can't guarentee it will be deleted before it's copied or whatever but you can arrange things so that it would take a pro to grab your wave file.
When you say "the file has to be deleted after it is used" I assume you mean you don't want anyone to copy it.
Encrypt it, (even simply by Xor'ing The bytes against a password, proper encrypting would be better but annoying to impliment) and hold the bytes in a file or append them onto the end of the exe file.