gpt4 book ai didi

installation - 蜡安装

转载 作者:行者123 更新时间:2023-12-04 06:14:51 26 4
gpt4 key购买 nike

即将放弃 Wix 作为安装程序!

我希望安装程序做的事情

  • 提示用户选择语言
  • 以选定的语言继续安装
  • 跳过许可协议(protocol)窗口
  • 提示功能列表
  • 提示安装文件夹到
  • 安装所选语言的应用程序二进制文件
  • 卸载时,语言应该是安装时使用的语言。

  • 在上面的列表中,我只设法使第 3 点起作用。但是我不知道这是否是正确的方法。我找不到关于什么标签应该嵌套在什么标签中的文档。属性 ID 名称可以或不能是什么。根据 CHM 指南,我删除了许可证对话框,并将 InstallDirDlg 指定为欢迎对话框之后的下一个对话框。尽管这样做,我无法让它工作。它完全跳过上面的第 4 点和第 5 点,直接进入“确认开始安装”窗口。点击那里的下一步安装产品,甚至不问我要安装哪个文件夹或哪个功能。

    问题:
  • UI 和 UIRef 标签是进入 Fragment 标签还是 Product 标签?
  • 究竟是什么放入片段标签?
  • 如果我将整个 UI 标记放入 Fragment 标记,则产品安装时没有任何 UI。那不可能是它的正确位置。对?
  • 我应该查看任何其他免费安装程序以满足上述安装程序要求吗?

  • 完整的问题脚本文件按原样在下面。
        <?xml version="1.0" encoding="UTF-8"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

    <Product Id="077765d1-236d-4299-b751-f921828f2ac8"
    Name="A Wix Setup Example"
    Language="1033"
    Version="1.0.0.0"
    Manufacturer="Study Products" UpgradeCode="1b0f72a7-8e17-4897-9f96-66509cc39573">

    <Package InstallerVersion="200" Compressed="yes" />

    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />


    <Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramFilesFolder" >

    <Directory Id="INSTALLLOCATION" Name="My Application Folder">

    <Component Id="ProductComponent" Guid="17e13748-8d44-47f6-b020-66d29f8a84fe">
    <File Id="WindowsFormsApp.exe"
    Source="../WindowsFormsApp/bin/Debug/WindowsFormsApp.exe">
    </File>
    </Component>
    </Directory>
    </Directory>
    </Directory>

    <Feature Id="ProductFeature" Title="WixSetupProject" Level="1">


    <ComponentRef Id="ProductComponent" />
    </Feature>



    <UI Id="WixUI_InstallDir">

    <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
    <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" />
    <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" />

    <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
    <Property Id="WixUI_Mode" Value="Advanced" />
    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLLOCATION" />


    <DialogRef Id="BrowseDlg" />
    <DialogRef Id="DiskCostDlg" />
    <DialogRef Id="ErrorDlg" />
    <DialogRef Id="FatalError" />
    <DialogRef Id="FilesInUse" />
    <DialogRef Id="MsiRMFilesInUse" />
    <DialogRef Id="PrepareDlg" />
    <DialogRef Id="ProgressDlg" />
    <DialogRef Id="ResumeDlg" />
    <DialogRef Id="UserExit" />

    <Publish Dialog="BrowseDlg" Control="OK" Event="DoAction" Value="WixUIValidatePath" Order="3">1</Publish>
    <Publish Dialog="BrowseDlg" Control="OK" Event="SpawnDialog" Value="InvalidDirDlg" Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>

    <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish>

    <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="1">1</Publish>
    <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="1">1</Publish>




    <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
    <Publish Dialog="InstallDirDlg" Control="Next" Event="SetTargetPath" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
    <Publish Dialog="InstallDirDlg" Control="Next" Event="DoAction" Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
    <Publish Dialog="InstallDirDlg" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
    <Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
    <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
    <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="1">NOT Installed</Publish>
    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish>
    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">Installed AND PATCH</Publish>

    <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>

    <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
    <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
    <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>

    <Property Id="ARPNOMODIFY" Value="1" />




    </UI>

    <UIRef Id="WixUI_Common" />


    </Product>

    <Fragment>
    <CustomAction Id="CA_Set_WIXUI_EXITDIALOGOPTIONALTEXT" Property="WIXUI_EXITDIALOGOPTIONALTEXT" Value="Thank you for installing [ProductName]."/>
    <InstallUISequence>
    <Custom Action="CA_Set_WIXUI_EXITDIALOGOPTIONALTEXT" After="FindRelatedProducts">NOT Installed</Custom>
    </InstallUISequence>
    <Property Id="ApplicationFolderName" Value="My Application Folder" />
    <Property Id="WixAppFolder" Value="WixPerMachineFolder" />


    <WixVariable Id="WixUISupportPerUser" Value="1" Overridable="yes" />
    <WixVariable Id="WixUISupportPerMachine" Value="1" Overridable="yes" />

    <PropertyRef Id="ApplicationFolderName" />
    <UI >
    <Dialog Id="CustomBrowseDlg" Width="370" Height="270" Title="!(loc.BrowseDlg_Title)">
    <Control Id="PathEdit" Type="PathEdit" X="25" Y="202" Width="320" Height="18" Property="_BrowseProperty" Indirect="yes" />
    <Control Id="OK" Type="PushButton" X="240" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUIOK)">
    <Publish Event="SetTargetPath" Value="[_BrowseProperty]">1</Publish>
    <Publish Event="EndDialog" Value="Return">1</Publish>
    </Control>
    <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
    <Publish Event="Reset" Value="0">1</Publish>
    <Publish Event="EndDialog" Value="Return">1</Publish>
    </Control>
    <Control Id="ComboLabel" Type="Text" X="25" Y="58" Width="44" Height="10" TabSkip="no" Text="!(loc.BrowseDlgComboLabel)" />
    <Control Id="DirectoryCombo" Type="DirectoryCombo" X="70" Y="55" Width="220" Height="80" Property="_BrowseProperty" Indirect="yes" Fixed="yes" Remote="yes">
    <Subscribe Event="IgnoreChange" Attribute="IgnoreChange" />
    </Control>
    <Control Id="WixUI_Bmp_Up" Type="PushButton" X="298" Y="55" Width="19" Height="19" ToolTip="!(loc.BrowseDlgWixUI_Bmp_UpTooltip)" Icon="yes" FixedSize="yes" IconSize="16" Text="!(loc.BrowseDlgWixUI_Bmp_Up)">
    <Publish Event="DirectoryListUp" Value="0">1</Publish>
    </Control>
    <Control Id="NewFolder" Type="PushButton" X="325" Y="55" Width="19" Height="19" ToolTip="!(loc.BrowseDlgNewFolderTooltip)" Icon="yes" FixedSize="yes" IconSize="16" Text="!(loc.BrowseDlgNewFolder)">
    <Publish Event="DirectoryListNew" Value="0">1</Publish>
    </Control>
    <Control Id="DirectoryList" Type="DirectoryList" X="25" Y="83" Width="320" Height="98" Property="_BrowseProperty" Sunken="yes" Indirect="yes" TabSkip="no" />
    <Control Id="PathLabel" Type="Text" X="25" Y="190" Width="320" Height="10" TabSkip="no" Text="!(loc.BrowseDlgPathLabel)" />
    <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.BrowseDlgBannerBitmap)" />
    <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
    <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
    <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.BrowseDlgDescription)" />
    <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.BrowseDlgTitle)" />
    </Dialog>

    </UI>
    </Fragment>
    </Wix>

    抱歉格式不好。我尽力修好了。感谢您抽出宝贵时间完成此...

    最佳答案

    关于语言,这个问题可能会有所帮助:

    is it possible to create a multilanguage installer using WIX?

    片段的目的是分离安装程序的逻辑部分。根本不需要 Fragment,但可以很好地将 UI 部分放在单独的文件中。它没有显示的原因是您需要从产品部分引用它。

    例如,您的代码中的这些行引用了其他地方的 UI 或 Dialog 元素。

    <UIRef Id="WixUI_Common" />
    <DialogRef Id="BrowseDlg" />

    您需要做的另一件事是在对话框序列中引用您的自定义对话框。这可能涉及替换 BrowseDlg与您的 CustomBrowseDlg .
    <Publish Dialog="InstallDirDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>

    对于检索语言,这篇文章可能会有所帮助: the WiX toolsets Remember Property pattern

    Windows Installer 相当复杂,但我不能说尝试另一种技术是否会更好。很多人似乎都喜欢 NSIS尽管。

    关于installation - 蜡安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7384306/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com