需要使用 WIX 将 EULA UI 添加到此代码。我试过很多网上的博客,none好像都合适。我正在使用带有蜡烛和灯光的 cmd

Need to add EULA UI to this code, using WIX. I have tried many online blog, none seems to fit. I am using cmd with candle and light

我要添加初始部分,因为代码很长,有很多组件 ID 引用。我对与此相关的任何事情都是全新的,所以我有点陷入困境并且对此感到头疼。我想继续前进。

    <?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:utilExt="http://schemas.microsoft.com/wix/UtilExtension"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">

<Product Id="*" UpgradeCode="12345678-1234-1234-1234-111111111111" Name="Sameerto" Version="0.0.1" Manufacturer="Sameer" Language="1033">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" Manufacturer="Sameer" />
    <Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>
    


    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLDIR" Name="Sameerho">
                <Component Id="ApplicationFiles" Guid="12345678-1234-1234-1234-222222222222">
                    <File Id="ApplicationFile1" Source="example.exe"/>
                </Component>

                <Component Id="cmpBB73983CF7E94ED14C76D99BF521C438" Guid="06A9BAB1-AF17-4D14-9318-2584A44F2D75">
                    <File Id="fil287E390545AF7AF698CCF1D63345736E" KeyPath="yes" Source="MySourceFiles\cleanup-dcvviewer.bat" />
                </Component>
                <Component Id="cmp874CCF5A122BDB83D7303BBC3F6929D9" Guid="51C5B07B-ADC9-4C2C-802C-2DB129ED0916">
                    <File Id="fil87D9664F704FABC70266239A88EA1D5A" KeyPath="yes" Source="MySourceFiles\README.txt" />
                </Component>
                <Component Id="cmp190EF23B12FD9F92F3E4D70FE500376C" Guid="7C61CCBA-0810-40B7-B813-4DDF07E8691C">
                    <File Id="filC8691AF57BFFAC9BD556CB015EFE92A0" KeyPath="yes" Source="MySourceFiles\setup-dcvviewer.bat" />
                </Component>
                <Directory Id="dir2C496578EAAEC9B7A90F298F78772FC8" Name="bin">
                    <Component Id="cmp8EEB04762C874D3F206ACA62ABBBCD1B" Guid="77F158AE-CD0E-4F01-9E89-40022A6D03A0">
                        <File Id="fil8E1E4C8F9D916A9719D62E6937094CC3" KeyPath="yes" Source="MySourceFiles\bin\dcvusblist.exe" />
                    </Component>
                    <Component Id="cmp6DFB4632AC8C9F75BB45E66F3A3E3CB4" Guid="B929F579-A86A-477F-BA59-89B538B418AC">
                        <File Id="fil046A23EF9C9AE19E3D1D2A141EC3C8DE" KeyPath="yes" Source="MySourceFiles\bin\dcvusblist.exe.config" />
                    </Component>
                    <Component Id="cmp3EE5EA309DCAE478196917A9438FFDCA" Guid="905C54E2-907C-4C67-8B0E-C8C137E65295">
                        <Class Id="{0304AC76-9382-3817-80A8-BF7390F05D1B}" Context="InprocServer32" Description="ViewerApp.LeftPart" ThreadingModel="both" ForeignServer="mscoree.dll">
                            <ProgId Id="ViewerApp.LeftPart" Description="ViewerApp.LeftPart" />
                        </Class>
                        <Class Id="{05ED9BF8-699B-3359-9BE9-5F024D0CBFBF}" Context="InprocServer32" Description="ViewerApp.FileSystemRedirectionStatusToBoolConverter" ThreadingModel="both" ForeignServer="mscoree.dll">
                            <ProgId Id="ViewerApp.FileSystemRedirectionStatusToBoolConverter" Description="ViewerApp.FileSystemRedirectionStatusToBoolConverter" />
                            ||
                            |
                            |
                            |continued......

WiX 教程:如果您还没有这样做,请浏览一下 WiX 教程:https://www.firegiant.com/wix/tutorial/

WiX UI:WiX 有几个标准的 GUI 集。 These dialog sets are described in the tutorial here. I find that WixUI_Mondo works best. They contain the most common dialogs needed in a setup. They can be customized in various ways: please skim this old answer for more on this. Directly relevant for you should be to customize the dialog set with a license file(来自 WiX 教程)。

Visual Studio:下面是the most basic WiX setup with a GUI. It is a Visual Studio project. You should try to use Visual Studio if you can, much easier. Are you not allowed to in your environment? You can install the community edition for free: https://visualstudio.microsoft.com/

的例子

这里有各种 WiX 样本:https://github.com/glytzhkof - they are very ad-hoc many of them, but they should compile with Visual Studio after you change a couple of GUIDs. Create GUIDs from the Visual Studio tools menu, or here (for example): https://www.guidgenerator.com/

许可协议The essence of adding a license agreement is explained in this answer(向底部)。这是内联的基本代码:

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

Link:

  • Command lines to compile WiX source files using candle and light.