目录用户选择与Wix的接口

时间:2015-12-02 09:08:44

标签: wix

我是一个拥有出色Wix系统的新用户;这是我的麻烦。我不明白如何在双目录用户选择器中有两个选择器。我的代码(.wks)无法让用户选择一个目录。但我希望系统预先选择一个用于程序组件,第二个用于安装工作目录用户选择。这是我的代码。

http://schemas.microsoft.com/wix/2006/wi'>   

<Package Id='*' Keywords='Installer'
  Description="Acme's Foobar 1.0 Installer"
  Comments='Foobar is a registered trademark of Acme Ltd.' Manufacturer='Acme Ltd.'
  InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />

<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="Acme's Foobar 1.0 Installation [1]" />

<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id="WindowsFolder" Name="Windows">
    <Directory Id="WindowsSystem32" Name="System32">
      <Component Id="ApplicationDll" Guid="45645678-1234-1234-1234-782222222222">
        <File Id="ApplicationFile7" Source="BolosData\dll\Bol_Dll.dll" />
        <File Id="ApplicationFile8" Source="BolosData\dll\libBol_Dll.dll.a" />
        <File Id="ApplicationFile9" Source="BolosData\dll\libBol_Dll.dll.def" />
        <File Id="ApplicationFile10" Source="BolosData\dll\mingwm10.dll" />
      </Component>
    </Directory>
  </Directory>
  <Directory Id='ProgramFilesFolder' Name='PFiles'>
    <Directory Id='Acme' Name='Acme'>
      <Directory Id='INSTALLDIR' Name='Foobar 1.0'>

        <Component Id='MainExecutable' Guid='12345678-83F1-4F22-985B-FDB3C8ABD471'>
          <File Id='FoobarEXE' Name='FoobarAppl10.exe' DiskId='1' Source='FoobarAppl10.exe' KeyPath='yes'>
            <Shortcut Id="startmenuFoobar10" Directory="ProgramMenuDir" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
            <Shortcut Id="desktopFoobar10" Directory="DesktopFolder" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
          </File>
        </Component>

        <Component Id='HelperLibrary' Guid='12345678-6BE3-460D-A14F-75658D16550B'>
          <File Id='HelperDLL' Name='Helper.dll' DiskId='1' Source='Helper.dll' KeyPath='yes' />
        </Component>

        <Component Id='Manual' Guid='12345678-574D-4A9A-A266-5B5EC2C022A4'>
          <File Id='Manual' Name='Manual.pdf' DiskId='1' Source='Manual.pdf' KeyPath='yes'>
            <Shortcut Id="startmenuManual" Directory="ProgramMenuDir" Name="Instruction Manual" Advertise="yes" />
          </File>
        </Component>

      </Directory>
    </Directory>
  </Directory>

  <Directory Id="ProgramMenuFolder" Name="Programs">
    <Directory Id="ProgramMenuDir" Name="Foobar 1.0">
      <Component Id="ProgramMenuDir" Guid="12345678-7E98-44CE-B049-C477CC0A2B00">
        <RemoveFolder Id='ProgramMenuDir' On='uninstall' />
        <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
      </Component>
    </Directory>
  </Directory>

  <Directory Id="DesktopFolder" Name="Desktop" />
</Directory>

<Feature Id='Complete' Title='Title 5001' Description='The complete package.'
  Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'>


  <Feature Id='MainProgram' Title='Program 5002' Description='The main executable.' Level='1'>
    <ComponentRef Id='MainExecutable' />
    <ComponentRef Id='HelperLibrary' />
    <ComponentRef Id='ProgramMenuDir' />
  </Feature>

  <Feature Id='Documentation' Title='Description 5003' Description='The instruction manual.' Level='1000'>
    <ComponentRef Id='Manual' />
  </Feature>

  <Feature Id='Dll' Title='Description 5004' Description='The Dll et C++ runtimes.' Level='1000'>
    <ComponentRef Id='ApplicationDll' />
  </Feature>
</Feature>

<UIRef Id="WixUI_Mondo" />
<UIRef Id="WixUI_ErrorProgressText" />

<Icon Id="Foobar10.exe" SourceFile="FoobarAppl10.exe" />

这是我的批处理命令行:

@echo off
candle %1.wxs
light -ext WixUIExtension -cultures:fr-fr -dWixUILicenseRtf=D:\chinoi\BolosData\Res\bolosRd_intro.rtf %1.wixobj -out %1.msi

如果有人可以帮助我......

1 个答案:

答案 0 :(得分:1)

您必须设置一个新的目录属性并将其传递给UI Installdir对话框。

下载wix的源代码并将WixUI_Mondo.wxs复制到您的项目中。 对InstallDirDlg.wxs执行相同的操作。

编辑并重命名它们。

查看本教程的编辑对话框。

http://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html

在installdir对话框中,您必须添加几乎相同的部分:

    <Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">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>

希望它能帮助你找到正确的方向。