Reputation: 67
I have written a Python script to save time, which creates and writes files to my machine locally. (Python 3)
I've turned it into an executable using PyInstaller, but in order to execute it the executable needs permissions on their machines - and doing so manually isn't going to be easy for some of them.
It'll need both permission to run and to create files.
Is there a way I can configure the executable to grant itself permissions?
(ie. prompt the user for a the admin password or something like that).
I've searched elsewhere for an answer but I think my lack of knowledge of the correct terms for this is getting in the way.
Upvotes: 1
Views: 288
Reputation: 36
As far as I understand, this is achieved by running the executable as root or administrator or perhaps by use of an included script to alter whatever other permissions may be needed.
This might be useful in relation to unix systems: Bash: How to give executable permission to all the python scripts in unix? Here is a related link wherein it is highlighted as a 'Note' as to what other potential causes for 'permission errors' may be encountered: https://pyinstaller.readthedocs.io/en/stable/operating-mode.html
For windows systems, looking into the --uac-admin option will likely be useful, as it will require admin privileges before running the app.
Upvotes: 1