在 InstallShield 中禁用 Windows ComCtrl 清单

Disable Windows ComCtrls manifest in InstallShield

我正在为我的 .NET 应用程序构建 windows 安装程序,看起来 InstallShield(2012 Spring - 专业版)正在向我的图标添加 Windows Common-Controls 清单,将它们转换为DLL。

这影响了我的应用程序的性能,因为 OS 在启动时尝试解析图标图像时遇到页面错误。

这是 IS 附加的清单。

<?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="CompanyName.ProductName.YourApplication"
    type="win32"
/>
<description>InstallShield Icon Res</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="<>"
            language="*"
        />
    </dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
        <requestedPrivileges>
            <requestedExecutionLevel
                level="asInvoker"
                uiAccess="false"/>
        </requestedPrivileges>
    </security>
</trustInfo>
</assembly>

首先简短地讨论一下为什么会发生这种情况。 Icon table,需要存储图标以支持 Windows 安装程序广告,需要 "Icon files that are associated with shortcuts must be in the EXE binary format and must be named such that their extension matches the extension of the target"。因此 InstallShield 构建了正确的格式文件。 "build" 我的意思是它将图标数据填充到模板 EXE 文件的资源中。

结果如何?您可以通过编辑模板来更改生成的清单。该模板存储在 ...\Support\_IsIcoRes.exe 中,如果您在 Visual Studio 或其他资源编辑器中打开它,您可以在 RT_MANIFEST (24) \ 1 中检查甚至编辑清单。此文件(尚未)未签名,因为构建过程必须修改它,因此会使任何签名无效,因此您的编辑应该是安全的。也就是说,保留原件的备份以防出现问题。