【发布时间】:2015-12-02 09:08:43
【问题描述】:
我是一个拥有出色 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
如果有人可以帮助我...
【问题讨论】:
-
您是否尝试自定义 UI 以设置 2 个目录?
-
不,因为我不知道该怎么做。我是 15 天前的 Wix 用户。我正在“小武器”方面取得进展。在我看来,文档有点晦涩难懂。 Bref,如果您有示例或链接,我会非常感兴趣,因为如果使用 C 或 ++ 或 VB,如果 xml 或声明性语言我不是冠军,它就会正确。谢谢
-
你能再解释一下你想要达到的目标吗?
-
所以我的代码的一部分是 .wxs。我们可以看到 TARGETDIR 目录谁处理选择器
INSTALLDIR 我的所有程序文件。但是要安装 dll 和 mingw 文件。我希望用户可以通过对话框选择安装目录。 -
如何为 system32 目录(dll 等)添加第二个选择器?
标签: wix