带有嵌入式清单的VB6 EXE在Windows7上不起作用 [英] VB6 EXE with embedded manifest doesn't work on Windows7

查看:90
本文介绍了带有嵌入式清单的VB6 EXE在Windows7上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows 7支持的VB6应用程序.为了兼容起见,我需要以管理员身份运行它.我们当前的安装程序能够将其标记为以管理员身份运行",但是我们正在切换到另一个安装程序 不具备此功能的计算机.因此,我正在尝试做到正确"的解决方案.方式和使用应用程序清单.我设法弄清楚了清单的外观(如下),并使用MT.EXE将其嵌入到我的VB6可执行文件中:

I have a VB6 application which we support on Windows7.  I need to have it run as Administrator for compatibility purposes.  Our current installer is able to mark it as "Run as Administrator", but we are switching to another installer that does not have this capability.  So I am trying to do it the "right" way and use an application manifest.  I've managed to figure out what the manifest should look like (below), and using MT.EXE embed it into my VB6 executable:

mt -manifest AppName.exe.manifest -outputresource:AppName.exe;#1

mt -manifest AppName.exe.manifest -outputresource:AppName.exe;#1

<?xml version ="1.0" encoding ="utf-8" ?>
< assembly xmlns ="urn:schemas-microsoft-com:asm.v1" manifestVersion ="1.0">
  < assemblyIdentity version ="1.0.0.0" processorArchitecture ="X86"名称=应用程序" type ="win32" />
  < description>应用程序名称</description>
  < trustInfo xmlns =< urn:schemas-microsoft-com:asm.v3">
    < security>
     < requestedPrivileges>
       < requestedExecutionLevel level =" requireAdministrator" />
       <!-< requestedExecutionLevel level ="asInvoker" /> ->
       <!-< requestedExecutionLevel level ="highestAvailable" /> ->
     </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>

<?xml version="1.0" encoding="utf-8" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Application" type="win32" />
  <description>Application Name</description>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="requireAdministrator" />
        <!-- <requestedExecutionLevel level="asInvoker" /> -->
        <!-- <requestedExecutionLevel level="highestAvailable" /> -->
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>

嵌入清单后,它在Windows XP上仍然可以正常运行,但是当我尝试在Windows7上运行它时,会显示标准UAC提示,我单击允许",但是应用程序无法启动(即使我也将其标记为以管理员身份运行").

With the manifest embedded it still works fine on Windows XP, but when I try to run it on Windows7, the standard UAC prompt shows up, I click "Allow", but the application doesn't start (even if I also mark it as "Run as Administrator").

Windows错误报告为此记录了一个参考性事件:

There is an informational event logged for this by Windows Error Reporting:

事件ID:1001

故障桶,类型0
事件名称:PCA2
响应:不可用
出租车编号:0

Fault bucket, type 0
Event Name: PCA2
Response: Not available
Cab Id: 0

问题签名:
P1:AppName.exe
P2:3.9.0.25
P3:未知
P4:应用名称
P5:公司名称
P6:200
P7:-1
P8:
P9:
P10:

Problem signature:
P1: AppName.exe
P2: 3.9.0.25
P3: unknown
P4: Application Name
P5: Company Name
P6: 200
P7: -1
P8:
P9:
P10:

报告状态:4

如果有人知道问题是什么以及如何解决,请告诉我.谢谢!

If anyone has any idea what the problem is and how to fix it, please let me know.  Thanks!

Marc

推荐答案

Hello Marc,

Hello Marc,

如果尝试以下操作会发生什么:

What happen if you try something like:

 

    <安全性>

    <security>

      < requestedPrivileges>

      <requestedPrivileges>

        < requestedExecutionLevel

        <requestedExecutionLevel

           level =" requireAdministrator"

          level="requireAdministrator"

           uiAccess ="false" />

          uiAccess="false"/>

        </requestedPrivileges>

        </requestedPrivileges>

       </security>

       </security>

当您说但应用程序无法启动"时,您是否收到任何错误消息?

When you say "but the application doesn't start", did you get any error message?



这篇关于带有嵌入式清单的VB6 EXE在Windows7上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆