How to open folder and file in place with admin status
Hello!
I created a software that reads a file from a closed folder when it is started, but when it detects that the file and the folder don't exist, it creates a new one with predefined names.
The problem is that the software is hold in the C:program files (x86) folder, which is a place which require admin status for files and folder creation (and I don't know why I don't have that permission despite being administrator, but anyway). So what happens is that if I put the .exe plus .dll files in a common folder, the software runs ok, but when the software is put inside Program Files (x86), it doesn't open and the folder and the file is not created.
How should I proceed in this case? Is there a function in Qt or C++ that ask the user for permission and, once the permission is given, it would open the folder and create the file?
Thanks!
Momergil
Re: How to open folder and file in place with admin status
I guess you have to run app as an administrator to get those permissions.
Right click on the app and select 'run as administrator' (on w7, vista will have something similar but I can't tell atm).
Re: How to open folder and file in place with admin status
One solution is to make sure your folder location is somewhere less restricted, like 'my documents' or similar. I think you can do this with desktop services:
http://developer.qt.nokia.com/doc/qt...pservices.html
use storageLocation() and enum QDesktopServices::ApplicationsLocation