Note that there are some explanatory texts on larger screens.

plurals
  1. POSetting UAC to requireAdministrator using PyInstaller onefile option and manifest
    text
    copied!<p>Okay, I've been going around and around trying to figure this one out. I'm building an application called <code>GraphicScriptWizard.exe</code> using PyInstaller version 2.0 using the -i -F -w and -m options.</p> <p>The manifest file that I've defined to use with the -m option is called <code>GraphicScriptWizard.exe.manifest</code> and has the following content:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt; &lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"&gt; &lt;assemblyIdentity version="1.0.0.0" processorArchitecture="x86" name="GraphicScriptWizard" type="win32"/&gt; &lt;!-- Identify the application security requirements. --&gt; &lt;trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"&gt; &lt;security&gt; &lt;requestedPrivileges&gt; &lt;requestedExecutionLevel level="requireAdministrator" uiAccess="false"/&gt; &lt;/requestedPrivileges&gt; &lt;/security&gt; &lt;/trustInfo&gt; &lt;/assembly&gt; </code></pre> <p>Using this manifest and the command line options, I'm not getting an executable that prompts for elevation.</p> <p>For the sake of completeness, the spec file that gets generated by Pyinstaller is :</p> <pre><code># -*- mode: python -*- a = Analysis(['GraphicScriptWizard.py'], pathex=[&lt;Full Development Path&gt;], hiddenimports=[], hookspath=None) pyz = PYZ(a.pure) exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, name=os.path.join('dist', 'GraphicScriptWizard.exe'), debug=False, strip=None, upx=True, console=False , icon='SP.ico', manifest='GraphicScriptWizard.exe.manifest') app = BUNDLE(exe, name=os.path.join('dist', 'GraphicScriptWizard.exe.app')) </code></pre> <p>I've tried compiling with pyinstaller without the -m option and embedding with mt using the command:</p> <pre><code>mt.exe -manifest GraphicScriptWizard.exe.manifest -outputresource:GraphicScriptWizard.exe;#1 </code></pre> <p>and when I do that, the application prompts me for elevation, but I get an error when the program runs:</p> <p><code>"Cannot open self &lt;Full path to exe&gt;\GraphicScriptWizard.exe or archive..."</code></p> <p>I'm really at my wit's end and am hoping that someone with more familiarity with Windows resources and manifests can shed some more light on this for me. Is my manifest XML wrong? Is my methodology with Pyinstaller wrong? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload