Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 从jar向编译的exe文件添加清单_Windows_Jar_Permissions_Uac - Fatal编程技术网

Windows 从jar向编译的exe文件添加清单

Windows 从jar向编译的exe文件添加清单,windows,jar,permissions,uac,Windows,Jar,Permissions,Uac,我有一个可运行的MyApp.jar,我使用launch4j将其编译为MyApp.exe,并且由于此应用程序需要管理员权限,因此我尝试按照本文的说明向其添加清单文件: 当我表演的时候 mt.exe –manifest manifest.xml –outputresource:MyApp.exe;#1 进程已完成,但MyApp.exe文件的大小仅从6mb减小到32kb,当我尝试运行该文件时,出现以下错误:错误:文件无效或损坏。 也许有人知道怎么回事? 我的清单文件附在下面: <?xml ve

我有一个可运行的MyApp.jar,我使用launch4j将其编译为MyApp.exe,并且由于此应用程序需要管理员权限,因此我尝试按照本文的说明向其添加清单文件: 当我表演的时候

mt.exe –manifest manifest.xml –outputresource:MyApp.exe;#1
进程已完成,但MyApp.exe文件的大小仅从6mb减小到32kb,当我尝试运行该文件时,出现以下错误:错误:文件无效或损坏。 也许有人知道怎么回事? 我的清单文件附在下面:

<?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="MyApp.exe"
     type="win32"/> 
  <description>{app name}</description> 
  <!-- Identify the application security requirements. -->
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="requireAdministrator"
          uiAccess="true"/>
        </requestedPrivileges>
       </security>
  </trustInfo>
</assembly>

{app name}

最后,我们通过在编译期间通过launch4j应用程序添加清单文件解决了这个问题,并将uiAccess标志从true更改为false
uiAccess=“false”
尽管我们的应用程序是图形化的,否则它无法工作

我使用了这个文件:

    <?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="MyApp.exe"
     type="win32"/> 
  <description>{app name}</description> 
  <!-- Identify the application security requirements. -->
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="requireAdministrator"
          uiAccess="false"/>
        </requestedPrivileges>
       </security>
  </trustInfo>
</assembly>

{app name}
把它放在这里:

最后,我们通过在编译期间通过launch4j应用程序添加清单文件解决了这个问题,并将uiAccess标志从true更改为false
uiAccess=“false”
,尽管我们的应用程序是图形化的,否则它无法工作

我使用了这个文件:

    <?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="MyApp.exe"
     type="win32"/> 
  <description>{app name}</description> 
  <!-- Identify the application security requirements. -->
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="requireAdministrator"
          uiAccess="false"/>
        </requestedPrivileges>
       </security>
  </trustInfo>
</assembly>

{app name}
把它放在这里:

能否解释一下您是如何使用Launch4j实现这一点的?非常感谢@汤姆,我只会在周日上班,我会做一些截图并更新我的答案。能否解释一下你是如何用Launch4j做到这一点的?非常感谢@汤姆,我只在星期天上班,会做一些截图并更新我的答案。