使用 .manifest 文件运行 .exe 会导致“...未正确安装”错误对话。为什么?
我正在尝试让 VB 应用程序 (my.exe) 在 Windows 7 上以管理员身份运行。因此我使用清单(如下)来执行此操作。但是当我运行它(并立即退出 My.exe)时,我收到程序兼容性助手警告: “该程序可能未正确安装” 当然,我不做任何安装。
- 如果我将 EXE 设置为以管理员身份运行(通过右键单击 My.exe ),那么我不会收到此警告(无论是否存在清单) 或者
- 如果我删除清单文件(并将 exe 设置为以管理员身份运行或不这样做),我不会收到警告。
任何想法为什么会发生这种情况以及如何使用清单不收到此警告?
显现
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<!-- Make My Manifest 0.7.300 -->
<assemblyIdentity name="Bungalow.Software,.Inc..CDCodes" processorArchitecture="X86" type="win32" version="10.0.0.16" />
<description>Internal BSW program to generation installation and actvation codes</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<**requestedExecutionLevel level="requireAdministrator" uiAccess="false"** />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
I'm trying to get a VB app (my.exe) to run as Administrator on Windows 7. So I'm using a Manifest (below) to do that. But when I run it (and immediately exit the My.exe) I get the Program Compatibility Assistant warning:
"This program might not have installed correctly"
Of course, I am not doing any installing.
- If I set the EXE to Run As Administrator (by right-clicking My.exe ) then I do not get this warning (with or without the manifest present)
or - If I remove the manifest file (and set exe to run as admin or do not do that) I do not get the warning.
Any ideas why this is happening and how to NOT get this warning using the Manifest?
MANIFEST
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<!-- Make My Manifest 0.7.300 -->
<assemblyIdentity name="Bungalow.Software,.Inc..CDCodes" processorArchitecture="X86" type="win32" version="10.0.0.16" />
<description>Internal BSW program to generation installation and actvation codes</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<**requestedExecutionLevel level="requireAdministrator" uiAccess="false"** />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试在您的应用程序中添加兼容性部分显现。
Try adding a compatibility section in your manifest.
你的清单上写着“我是一个管理应用程序;我更改了这台计算机”,但是当它完成运行时,注册表没有变化,程序文件也没有变化,等等。所以 Windows 自己想知道 - 一切都好吗?然后它会问你。
Your manifest says "I am an admin app; I change this computer" but when it has finished running, the registry is unchanged, program files is unchanged, etc. So Windows wonders to itself -is everything ok? And then it asks you.