由于 WiX 安装,添加显示 HTML 页面

Add showing HTML page due WiX installation

我在添加 html 出现在我的 WiX 包中时遇到问题。你知道怎么做吗?

我解决的第一种方法是使用内部 WiX dll WixShellExec

<Property Id="WixShellExecTarget" Value="[InputResourcesDir]index.html" />
<CustomAction Id="OpenHtmlPage" BinaryKey="WixCA" DllEntry="WixShellExec" />

<InstallExecuteSequence>
    <Custom Action='OpenHtmlPage' After='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>

<Directory Id="InputResourcesDir" Name="resource">
    <Component Id="index.html" Guid="{EE71FB84-2328-474E-9E5C-A29D2AD6EFD5}">
        <File Id="filEE71FB842328474E9E5CA29D2AD6EFD5" 
        Source="$(var.project.path)/$(var.project.resourceDir)/index.html" />
     </Component>
</Directory>

<Feature Id>
    <ComponentRef Id="index.html"/>
</Feature>

但是这种方式有一个问题,bcs html 页面是由默认应用程序(记事本、Sublime、Chrome 等)打开的,显然可能不是浏览器。

第二种解决方法是打开默认浏览器

<Property Id="BROWSER">
    <RegistrySearch Id='DefaultBrowser' Type='raw' Root='HKCR' Key='http\shell\open\command' />
</Property>

<CustomAction Id="LaunchBrowser" Directory="INSTALLDIR" Impersonate="no" Execute="deferred" 
      ExeCommand='[BROWSER] "file://[InputResourcesDir]html.html"' Return="asyncNoWait"/>

<InstallExecuteSequence>
        <Custom Action='LaunchBrowser' Before='InstallFinalize'>NOT Installed</Custom>
</InstallExecuteSequence>

<Directory Id="InputResourcesDir" Name="resource">
    <Component Id="index.html" Guid="{EE71FB84-2328-474E-9E5C-A29D2AD6EFD5}">
        <File Id="filEE71FB842328474E9E5CA29D2AD6EFD5" 
        Source="$(var.project.path)/$(var.project.resourceDir)/index.html" />
     </Component>
</Directory>

<Feature Id>
    <ComponentRef Id="index.html"/>
</Feature>