相关疑难解决方法(0)

使用PyInstaller onefile选项和清单将UAC设置为requireAdministrator

好吧,我一直在四处寻找这个问题.我正在GraphicScriptWizard.exe使用-i -F -w和-m选项构建一个使用PyInstaller 2.0版调用的应用程序.

我已经定义了与-m选项一起使用的清单文件,它GraphicScriptWizard.exe.manifest具有以下内容:

<?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>
Run Code Online (Sandbox Code Playgroud)

使用此清单和命令行选项,我没有得到提示提升的可执行文件.

为了完整起见,Pyinstaller生成的spec文件是:

# -*- 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'))
Run Code Online (Sandbox Code Playgroud)

我尝试使用没有-m选项的pyinstaller进行编译,并使用命令嵌入mt:

mt.exe …
Run Code Online (Sandbox Code Playgroud)

python windows pyinstaller visual-studio

5
推荐指数
1
解决办法
4058
查看次数

标签 统计

pyinstaller ×1

python ×1

visual-studio ×1

windows ×1