In order to protect the binary files (*.exe) that my program used, I reference this post (Adding executables as resources of a Qt application?) to import some of binary files into the QT resource file (if there is a better way to protect the binary file, it would be very helpful to know).
I would like to extract the binary files into temporary directory when program runs. I have tried the QFile::copy with QTemporaryFile::createNativeFile, but some errors showing (I am totally new on C++ and QT, sorry for the stupid questions).
QT version is 5.4.2
OS: Win7 64bit
Update@0930 0927 UTC: Thanks for the comment from @drescherjm, the error is fixed. But another error showing when I try to use below code to copy the file from resource file to C:.
QFile f(":/test.exe");
f.copy("C:\\test.exe");
qDebug() << "CopyResult" << f.errorString() ;
or
QFile::copy(":/test.exe", "C:\\test.exe");
and the error message is showing, is it a permission issue?
"Cannot create C:\test.exe for output"