I have a auto-patcher for my game which downloads and updates files just like most patchers for games. I create a dummy file called "temp.xxx", insert the file data into the file as it gets transferred from the server, then once the data is all received, I call rename() to rename the file to the actual name, and the function also moves it to the correct destination directory.
However, since many users have access restriction to creating/deleting/renaming files that need confirmations, file creation fails.
The patcher works fine if I install the game into the Users/Appdata directory where most users have full rights, however some people get the same error there as well.
To create a file I simply use:
recvFile.open( VGlobal::CURRWORKDIR + VGlobal::CurrTempFileDir + "Temp.txt", std::ios_base::out | std::ios_base::binary );
So my question is, how can I get around this access restriction? Can I change the folder settings in code? Should I use something other than recvFile.open(...), and rename() to change the file name and move the file to another location?
Thanks for any help.