Okay, I've been going around and around trying to figure this one out. I'm building an application called GraphicScriptWizard.exe
using PyInstaller version 2.0 using the -i -F -w and -m options.
The manifest file that I've defined to use with the -m option is called GraphicScriptWizard.exe.manifest
and has the following content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="x86"
name="GraphicScriptWizard"
type="win32"/>
<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Using this manifest and the command line options, I'm not getting an executable that prompts for elevation.
For the sake of completeness, the spec file that gets generated by Pyinstaller is :
# -*- mode: python -*-
a = Analysis(['GraphicScriptWizard.py'],
pathex=[<Full Development Path>],
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'))
I've tried compiling with pyinstaller without the -m option and embedding with mt using the command:
mt.exe -manifest GraphicScriptWizard.exe.manifest -outputresource:GraphicScriptWizard.exe;#1
and when I do that, the application prompts me for elevation, but I get an error when the program runs:
"Cannot open self <Full path to exe>\GraphicScriptWizard.exe or archive..."
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?