I am trying to make a program that only has a single exe file. That is a requirement.
But I also have to implement help for that program, so the user can know what does what. I decided to make a chm file and use a HelpProvider. Initially I thought I'd be able to embed the chm file and tell the HelpProvider to open it from the resources.resx.
Well, that didn't work.
Since I don't know of any other options to display help, without adding more files to the program or using online hosting or whatever, I decided I will be writing the embedded chm to the disk (when the user opens it) and deleting it after (this after I failed at coming up with a way to do so in memory).
The problem is creating the file with the FileOptions.DeleteOnClose
flag and writing to it. If I
File.Create(path, 100, FileOptions.DeleteOnClose);
File.WriteAllBytes(path, mychm);
The file is locked by the Create
method. If I put using
on the Create
method the file gets deleted before writing.