除了 WixUILicenseRtf 之外,我还需要什么来显示许可证? [英] What else do I need to show the license aside from WixUILicenseRtf?

查看:28
本文介绍了除了 WixUILicenseRtf 之外,我还需要什么来显示许可证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 wxs 文件中,在 Product 元素中,我添加了:

In my wxs file, in the Product element, I added:

<WixVariable Id="WixUILicenseRtf" Value="C:\Users\pupeno\...\src\main\deploy\package\windows\License.rtf" />

我认为该文件正在被读取,因为如果我输入一个不存在的路径,则不会生成 msi 文件.但是,在安装过程中没有显示任何内容.我还缺少什么?

I think the file is being read because if I put a path that doesn't exist, the msi file is not generate. But, nothing is shown during the installation process. What else am I missing?

我从 javafxpackager 模板开始,所以它看起来像这样:

I'm starting from the javafxpackager template, so, it looks something like this:

<?xml version="1.0" encoding="utf-8"?>
<!-- Customizing the wix template due to: https://github.com/FibreFoX/javafx-gradle-plugin/issues/100 -->

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
    <Product Id="PRODUCT_GUID" Name="APPLICATION_NAME"
             Language="1033" Version="APPLICATION_VERSION"
             Manufacturer="APPLICATION_VENDOR"
             UpgradeCode="PUT-GUID-HERE">
        <Package Description="APPLICATION_DESCRIPTION" Comments="None"
                 InstallerVersion="200" Compressed="yes"
                 InstallScope="INSTALL_SCOPE" Platform="PLATFORM"/>
        <Media Id="1" Cabinet="simple.cab" EmbedCab="yes"/>

        <!-- We use RemoveFolderEx to ensure application folder is fully
             removed on uninstall. Including files created outside of MSI
             after application had been installed (e.g. on AU or user state).

             Hovewer, RemoveFolderEx is only available in WiX 3.6,
             we will comment it out if we running older WiX.

             RemoveFolderEx requires that we "remember" the path for uninstall.
             Read the path value and set the APPLICATIONFOLDER property with the value.
        -->
        <Property Id="APPLICATIONFOLDER">
            <RegistrySearch Key="SOFTWARE\APPLICATION_VENDOR\APPLICATION_NAME"
                            Root="REGISTRY_ROOT" Type="raw"
                            Id="APPLICATIONFOLDER_REGSEARCH" Name="Path"/>
        </Property>
        <DirectoryRef Id="APPLICATIONFOLDER">
            <Component Id="CleanupMainApplicationFolder" Guid="*" Win64="WIN64">
                <RegistryValue Root="REGISTRY_ROOT"
                               Key="SOFTWARE\APPLICATION_VENDOR\APPLICATION_NAME"
                               Name="Path" Type="string" Value="[APPLICATIONFOLDER]"
                               KeyPath="yes"/>
                <RegistryValue Root="HKLM"
                               Key="SOFTWARE\APPLICATION_VENDOR\APPLICATION_NAME"
                               Name="AutoConnectTo" Type="string" Value="[AUTO_CONNECT_TO]"/>
                <!-- We need to use APPLICATIONFOLDER variable here or RemoveFolderEx
                     will not remove on "install". But only if WiX 3.6 is used. -->
                WIX36_ONLY_START
                <util:RemoveFolderEx On="uninstall" Property="APPLICATIONFOLDER"/>
                WIX36_ONLY_END
            </Component>
        </DirectoryRef>
        <?include bundle.wxi ?>
        UI_BLOCK
        APP_CDS_BLOCK
        <Icon Id="DesktopIcon.exe" SourceFile="APPLICATION_ICON"/>
        <Icon Id="StartMenuIcon.exe" SourceFile="APPLICATION_ICON"/>
        SECONDARY_LAUNCHER_ICONS
        <MajorUpgrade Schedule="afterInstallInitialize"
                      DowngradeErrorMessage="A later version of app is already installed. Setup will now exit."/>
        <Icon Id="icon.ico" SourceFile="App.ico"/>
        <Property Id="ARPPRODUCTICON" Value="icon.ico"/>
        <Property Id="AUTO_CONNECT_TO">
            <RegistrySearch Id="AutoConnectTo"
                            Root="HKLM"
                            Key="SOFTWARE\APPLICATION_VENDOR\APPLICATION_NAME"
                            Name="AutoConnectTo" Type="raw"/>
        </Property>
        <WixVariable Id="WixUILicenseRtf" Value="C:\Users\pupeno\...\src\main\deploy\package\windows\License.rtf" />
    </Product>
</Wix>

我使用完整路径的原因是因为我不知道相对于 javafxpackager 期望的是什么.我想先看看它的效果.

and the reason why I'm using a full path is because I don't know relative to what is javafxpackager expecting. I want to see it working first.

推荐答案

UPDATE:在下面添加了关于如何在 Visual Studio 之外编译 WiX 源的新部分.留在 Visual Studio 部分以供参考.

UPDATE: New section added underneath on how to compile WiX sources outside Visual Studio. Leaving in Visual Studio section for reference.

您在 Visual Studio 中吗?如果是这样,我尝试制作一个简单的演示,说明如何使用 GUI 执行最小 WiX 安装程序以及不久前的许可协议.也许看看它对你是否有意义:WiX 安装程序 msi 未安装使用 Visual Studio 2017 创建的 Winform 应用.

Are you in Visual Studio? If so, I tried to make a simple demo of how to do a minimal WiX installer with GUI and a license agreement a while back. Maybe see if it makes sense to you: WiX installer msi not installing the Winform app created with Visual Studio 2017.

  • 尝试顶部的分步列表
  • 根据您的先验知识,您还可以直接查看底部的 WiX 源代码(内嵌注释)
  • 至关重要的是,您需要引用 WixUIExtension.dll,在其中找到 GUI 集

如果您遵循这些步骤,您应该会成功.如果您不在 Visual Studio 中,则需要在调用 candle.exelight.exe 时正确获取命令行.不是火箭科学,但我喜欢这样称呼它可能有点繁琐.也许在适当的命令行某处有一个简单的示例 - 我现在没有任何可用的.

If you follow those steps you should succeed. If you are not in Visual Studio, then you need to get the command lines right when you call candle.exe and light.exe. Not rocket science, but it can be a bit fiddly as I like to call it. Maybe there is a simple sample somewhere of proper command lines - I don't have any available right now.

更新:忘记提及除了 WiX 之外,您还需要为 Visual Studio 安装这些扩展:http://wixtoolset.org/releases/.以防万一你还没有.

UPDATE: Forgot to mention that you need to install these extensions for Visual Studio in addition to WiX: http://wixtoolset.org/releases/. Just in case you haven't already.

要编译 WiX 源文件并在 Visual Studio 之外包含带有许可协议 RTF 文件的默认 GUI,请使用上面的示例更新 WiX 源,使其链接默认 GUI,然后尝试这些命令行来编译和链接您的 WiX 来源:

To compile a WiX source file and include a default GUI with a license agreement RTF file outside Visual Studio, please use the sample above to update the WiX source so it links a default GUI, then try these command lines to compile and link your WiX sources:

编译:

candle.exe product.wxs -ext WixUIExtension

链接:

light.exe -out Test.msi product.wixobj -ext WixUIExtension

如果一切正常,您应该在 WiX XML 源文件旁边得到一个 Test.msi 文件,运行它您应该会得到一个带有指定许可协议的默认 GUI.

If things work correctly you should get a Test.msi file next to your WiX XML source file, and running it you should get a default GUI with your specified license agreement.

而且,虽然很明显,但我只想提一下:您可以通过在没有参数的情况下运行它们来获得 candle.exelight.exe 参数的完整列表命令提示符.

And, though obvious, I will just mention it: you can get a full list of candle.exe and light.exe parameters by just running them without parameters via a command prompt.

很明显:您必须使用上面链接答案中的步骤来设置此 GUI 和许可协议文件.在此处重复链接:WiX 安装程序 msi 未安装使用 Visual Studio 2017 创建的 Winform 应用

将您自己的许可协议添加到您的 MSI 的本质就是这个 WiX XML 简介:

<UIRef Id="WixUI_Mondo" />
<WixVariable Id="WixUILicenseRtf" Value="TestLicenseAgreement.rtf" />

  • UIRef 元素 只是指定了 WixUI_Mondo 默认对话框集(在 WixUIExtension.dll 中找到)
  • WixVariable 元素只是指定一个 RTF 许可文件(添加路径,如果有)
  • 然后通过 light.exe 链接器的 -ext 开关与 WixUIExtension.dll 链接,如上面的命令行所示.
    • The UIRef element just specifies the WixUI_Mondo default dialog set (found in WixUIExtension.dll)
    • The WixVariable element simply specifies an RTF license file (add path, if any)
    • Then you link with WixUIExtension.dll by the -ext switch for the light.exe linker as shown in the command line above.
    • 有几个这样的默认对话框集,但我发现 Mondo 是效果最好的一个.如何向WiX 工具集.

      There are several such default dialog sets, but I find that Mondo is the one that works best. How can I add an optional UI to WiX toolset.

      类似答案:从 .wxs 文件创建一个 msi 使用命令行

      这篇关于除了 WixUILicenseRtf 之外,我还需要什么来显示许可证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆