4

我有以下注册 COM 服务器组件的 WiX 代码

<Component Id="ServerComponent" Guid="<someguid>">
    <File Id="comserverid" Name="comserver.exe" Source="path_to_com_server" DiskId="1" Checksum="yes" >
        <TypeLib Id="{<TYPELIBGUID>}" Description="ComServer 1.0 Type Library"  HelpDirectory="INSTALLLOCATION"  Language="0" MajorVersion="1" MinorVersion="0">
            <AppId Description="ComServer" Id="{<APPIDGUID>}}">
                <Class Id="{<SOMECLASSGUID>}" Context="LocalServer32" Description="ComServerClass Class" ThreadingModel="apartment" Advertise="no">
                    <ProgId Id="ComServer.ComServerClass.1" Description="ComServerClass Class">
                        <ProgId Id="ComServer.ComServerClass" Description="ComServerClass Class" />
                    </ProgId>
                </Class>
            </AppId>                                
        </TypeLib>
    </File>
    <RegistryValue Root="HKCR" Key="AppID\comserver.exe" Name="AppID" Value="{<APPIDGUID>}" Type="string" Action="write" />
</Component>

它成功注册了服务器,但是当我以“运行方式”模式运行程序时,程序没有看到 COM 服务器。

请建议 - 我应该如何更改 WIX 代码

更新:答案是 - 以提升的权限运行 WiX 脚本或comserver.exe /regserver以提升的权限运行,但它不起作用。我认为上面的脚本很有用,所以我保留问题并创建一个稍微不同的问题

4

1 回答 1

2

检查您的ALLUSERS 属性的值。如果您想要每台机器安装,您应该将其定义为 1 或 2。如果它以每个用户的身份安装,则注册表更新将写入 HKCU 而不是 HKLM。(根据安装范围,HKCR 可以指向 HKCU\Software\Classes 或 HKLM\Software\Classes)。

于 2012-08-14T14:20:36.567 回答