Reputation: 1
I am facing a problem i.e. when I install my python application using an NSIS and install it for "anyone using this computer" and after the installation when I open the application nothing is happening as it should prompt the UAC to continue with administration access but it is not happening and I have to right click the application, only then I can run it as administrator I have tried many ways like including "RequestExecutionLevel Admin" in nsis script and also tried to include the manifest file to keep the requestedExecutionLevel level as "asInvoker" as I was expecting a UAC prompt to be triggered to get access of the administrator, but none are working. Any insights or suggestions on how to prompt the UAC elevation dialog when launching the application would be very helpful.
Attached is the logs from application run when run with double click
Traceback (most recent call last):
File "C:\Program Files (x86)\Discovery App\Discovery_App.launch.pyw", line 34, in <module>
from Handlers.AppMain import main
File ".\AppMain.py", line 5, in <module>
File ".\DiscoveryHandler.py", line 52, in <module>
File "C:\Program Files (x86)\Discovery App\pkgs\paramiko\util.py", line 255, in log_to_file
f = open(filename, "a")
PermissionError: [Errno 13] Permission denied: 'C:\\Program Files (x86)\\Discovery App\\pkgs\\Handlers/paramiko.txt'
Upvotes: 0
Views: 64
Reputation: 101606
If you have RequestExecutionLevel Admin
in your .nsi then the installer will be UAC elevated and any process you start from the installer with Exec
/ExecWait
will be elevated as well. Things started with ExecShell
might be elevated (a .exe will, other filetypes might not).
If your application does not elevate when you start it from the Start Menu then it is lacking a manifest.
Now that you have edited your question we can see that it is Python. Unless you are shipping your own python.exe, you cannot use a manifest.
Your options are perhaps:
A) Use a custom launcher application .exe that finds and calls python.exe.
Upvotes: 0