XML установщика Windows (WiX): добавление настраиваемого диалогового окна

Я отчаянно нуждаюсь в помощи. Я застрял в этой проблеме уже несколько дней и искал по всему Интернету, вы моя последняя надежда.

Я пытался создать установщик Windows с помощью WIX, и все выглядит хорошо, пока я не попытаюсь настроить стандартный пользовательский интерфейс (минимальный, чтобы быть конкретным).

Я пытаюсь создать собственный диалог, который войдет в набор минимального пользовательского интерфейса, который позволит пользователю выбирать различные виды установки - это кажется невыполнимой задачей.

Когда я пытаюсь настроить, компиляция выдает ошибку. Пожалуйста помоги.

Продукт.wxs

<?xml version="1.0" encoding="UTF-8"?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
          xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

<?define vendor="Vendor" ?>
<?define productName="Product Name" ?>
<?define vendorAndProductName="$(var.vendor) $(var.productName)" ?>

<!--
    The language 1033 and codepage 1252 refer to 'English, US'
    See:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/localizing_the_error_and_actiontext_tables.asp
-->

    <Product Id="*"
                    Name="$(var.vendorAndProductName)"              
                    Language="1033"
                    Codepage="1252"
                    Version="$(var.version)"
                    Manufacturer="$(var.vendor)"
                    UpgradeCode="c338cb1c-8a1d-44e4-9aff-b2ad82f095fb">
                    <!--GUID defines product family, installed newer product versions in the same family will replace older versions-->

    <Package Id="*" 
                      Keywords="$(var.vendor) atm vm"
                      Description="$(var.vendorAndProductName) installer"
                      Manufacturer="$(var.vendor)"
                      InstallerVersion="110"
                      Platform="x86"
                      Languages="1033"
                      Compressed="yes"
                      SummaryCodepage="1252"
                      InstallScope="perMachine" />                       

    <!-- the property creates a help link -->
    <Property Id="ARPHELPLINK" Value="www.google.com" />

    <!-- the type of interface used; minimal -->
    <UIRef Id="WixUI_AAAMinimal" />

    <!-- this action executes the application at the end of the install -->
    <CustomAction Id="LaunchApplication" 
                               FileKey="fil6D1977925280798FCA16255AB9A3BF63"                               
                               ExeCommand="" 
                               Execute="immediate" 
                               Impersonate="yes" 
                               Return="asyncNoWait" />

    <!-- these properties illustrate the 2 options for execuating/ not the application at the end of installiation -->
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.productName)" />
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" />

    <!-- the install wizard interface customization -->
    <UI>
        <Publish Dialog="ExitDialog" 
                     Control="Finish" 
                     Event="DoAction" 
                     Order="1" 
                     Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>

    </UI>

    <!-- these varaiables are used within the install interface -->
    <WixVariable Id="WixUILicenseRtf" Value="include\License.rtf" />
    <WixVariable Id="WixUIDialogBmp" Value="include\dialog.jpg"/>
    <WixVariable Id="WixUIBannerBmp" Value="include\banner.jpg"/>

    <MajorUpgrade DowngradeErrorMessage="A newer version is already installed." />

    <!--Require admin priviliges-->
    <Condition Message="This software must be installed with administrative priviliges.">Privileged</Condition>

    <Media Id='1' Cabinet='xfsconfigsetupinstaller.cab' EmbedCab='yes'/>

    <!--Defines folders-->
    <Directory Id="TARGETDIR" Name="SourceDir">

        <Directory Id="AAA" Name="vendor" />

    </Directory>

    <!-- creates the system variables on the computer -->
    <Component Id="sysVar" Directory="TARGETDIR" Guid="{30a5b0a5-3c88-40df-ba87-6d8e2bb4afa7}">
        <Environment Id="systemVariable1" Name="PATH" Value="C:\Vendor" Permanent="no" Part="last" Action="set" System="yes" />
        <Environment Id="systemVariable2" Name="PATH" Value="C:\Vendor\bbbbbb" Permanent="no" Part="last" Action="set" System="yes" />
    </Component>

    <!--Reference all components and component groups in a Feature-->
    <Feature Id="Complete" 
                    Display="expand"
                    Level="1"
                    ConfigurableDirectory="C2P"
                    Title="Test0.0.0"
                    Description="Test Copy File">
        <ComponentGroupRef Id="VirutalMachine" />
        <ComponentRef Id="sysVar" />
    </Feature>  

    </Product>
</Wix>

Компиляция.bat

@echo off
setlocal

rem Set the WiX tools path
set wixTools="C:\Program Files (x86)\WiX Toolset v3.9\bin"

rem Heat.exe is used to harvest the directory and generate components
%wixTools%\heat.exe dir "C:\program\VirtualMachine" -dr C2P -cg VirtualMachine -gg -scam -sreg -sfrag -srd -out "%~dp0\heat.wxs" || goto installer_failure

rem Generate the msi file
%wixTools%\candle.exe Installer.wxs heat.wxs WixUI_AAAMinimal.wxs -dversion=%version% -ext WiXUIExtension
%wixTools%\light.exe Installer.wixobj heat.wixobj WixUI_AAAMinimal.wixobj -out Installer.msi -ext WiXUIExtension
echo Successfully created installer XFSConfigInstaller.msi.
pause
exit /b 0

:installer_failure
exit /b 1

WixUI_AAAMinimal.wxs

<?xml version="1.0" encoding="UTF-8"?>
<!--
  <copyright file="WixUI_Minimal.wxs" company="Outercurve Foundation">
    Copyright (c) 2004, Outercurve Foundation.
    This software is released under Microsoft Reciprocal License (MS-RL).
    The license and further copyright text can be found in the file
    LICENSE.TXT at the root directory of the distribution.
  </copyright>
-->

<!--
First-time install dialog sequence:
 - WixUI_WelcomeEulaDlg

Maintenance dialog sequence:
 WixUI_MaintenanceWelcomeDlg
 - WixUI_MaintenanceTypeDlg
 - WixUI_VerifyReadyDlg

Patch dialog sequence:
 - WixUI_WelcomeDlg
 - WixUI_VerifyReadyDlg
-->

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <UI Id="WixUI_C2PMinimal">
            <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="Minimal" />

            <DialogRef Id="ErrorDlg" />
            <DialogRef Id="FatalError" />
            <DialogRef Id="FilesInUse" />
            <DialogRef Id="MsiRMFilesInUse" />
            <DialogRef Id="PrepareDlg" />
            <DialogRef Id="ProgressDlg" />
            <DialogRef Id="ResumeDlg" />
            <DialogRef Id="UserExit" />
            <DialogRef Id="WelcomeDlg" />
            <DialogRef Id="WelcomeEulaDlg" />

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

            <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</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>

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

            <InstallUISequence>
                <Show Dialog="WelcomeDlg" Before="WelcomeEulaDlg">Installed AND PATCH</Show>
                <Show Dialog="WelcomeEulaDlg" Before="ProgressDlg">NOT Installed</Show>
            </InstallUISequence>

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

        <UIRef Id="WixUI_Common" />
    </Fragment>
</Wix>

Выход

Duplicate symbol 'ControlEve
nt:WelcomeDlg/Next/NewDialog/VerifyReadyDlg/Installed AND PATCH' found. This typically means that an Id is duplicated. Check to make sure all your identifiers of a given type (File, Component, Feature) are unique.

error LGHT0091 : Duplicate symbol 'Property:WixUI_Mode' found. This typically means that an Id is duplicated. Check to make sure all your identifiers of a given type (File, Component, Feature) are unique

Просто скажу, что все это сработало, прежде чем я попытаюсь настроить пользовательский интерфейс или диалоговое окно. Спасибо за помощь в продвижении.


person Hector210387    schedule 16.04.2015    source источник


Ответы (1)


В вашем фрагменте вы ссылаетесь

<Property Id="WixUI_Mode" Value="Minimal" />

Я считаю, что это жалуется, потому что вы также вызываете это позже.

<UIRef Id="WixUI_Common" />

Вам не нужно свойство top, если вы используете общий ref.

person KenWin0x539    schedule 31.08.2015