Car*_*arl 43 .net c# uac manifest windows-7
我在Win 7 RTM x64上创建了一个.NET C#WinForms应用程序,假设我已经调用了DataInstaller.
当我在调试器之外运行这个程序时(这只是一个没有功能的空表单),它可以正常工作,直到我关闭表单.然后,我从程序兼容性助手那里收到一条消息:
此程序可能未正确安装
然后,我可以选择使用推荐的设置重新安装,或者说安装确实按预期工作.
如果我将应用程序命名为"DataThingy",这不是问题,我想这与程序调用*Setup获得UAC屏蔽图标的方式有关.
我假设我可以将一些简单的东西放在应用程序清单中以防止这种情况发生?
我不确定这是否发生在Vista上,因为我目前没有访问权限.
更改名称不是一个选项,关闭UAC不是一个选项,所以请不要建议这个!
编辑:
我的天啊.
似乎如果以下任何一种情况属实,UAC坚持:
exe名称包含单词Installer
AssemblyInfo.cs中
AssemblyTitle contains the word 'Installer'
e.g. [assembly: AssemblyTitle("DataInstaller")]
AssemblyProduct contains the word 'Installer'
e.g. [assembly: AssemblyProduct("Data Installation Utility")]
Run Code Online (Sandbox Code Playgroud)
'Installer'也可以是'Setup'.
它乞丐信仰,它真的.显然,其中一位老VB6程序员已经在Redmond重新安置到UAC团队.
我仍然需要一个解决方法,我不准备接受我的应用程序不可能被称为安装程序,因为它不会触及注册表或将任何文件放在Program Files文件夹中.
我假设如果我尝试执行名为IAmAVirus.exe的应用程序,UAC会将机器置于完全锁定状态.(实际上,我不敢尝试,因为我并不完全相信我只是愚蠢)
小智 43
将其添加到清单中.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--The ID below indicates application support for Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--The ID below indicates application support for Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!--The ID below indicates app support for Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--The ID below indicates app support for Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
</application>
</compatibility>
Run Code Online (Sandbox Code Playgroud)
上一个示例中所有操作系统的GUID都提供了下层支持.支持多个平台的应用程序不需要为每个平台单独显示.
取自App(可执行)清单.
| 归档时间: |
|
| 查看次数: |
15347 次 |
| 最近记录: |