Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wix:无法覆盖自定义操作中的属性_Wix - Fatal编程技术网

Wix:无法覆盖自定义操作中的属性

Wix:无法覆盖自定义操作中的属性,wix,Wix,Wix工具集3.10 最后,我设法为安装程序创建了一个简单的模拟窗口……但我未能覆盖属性SXS\u PATH的默认值SxSFolder 我在安装顺序中的构思: 在LicenseAgreementDlg之后,将生成一个名为WindowsServerRolesAndFeaturesDlg的自定义对话框 在WindowsServerRolesAndFeaturesDlg中,用户可以浏览浏览DLG,将浏览器路径输入到路径编辑TxtDir(id est属性SXS\u路径覆盖) 按下自定义窗口中的“下一步”

Wix工具集3.10

最后,我设法为安装程序创建了一个简单的模拟窗口……但我未能覆盖属性
SXS\u PATH
的默认值
SxSFolder

我在安装顺序中的构思:

  • 在LicenseAgreementDlg之后,将生成一个名为
    WindowsServerRolesAndFeaturesDlg
    的自定义对话框
  • WindowsServerRolesAndFeaturesDlg
    中,用户可以浏览浏览DLG,将浏览器路径输入到路径编辑TxtDir(id est属性
    SXS\u路径
    覆盖)
  • 按下自定义窗口中的“下一步”按钮,将显示CustomAction
    SetCustomActionData
    ,以存储延迟CustomAction OfflineSxSInstall的属性
  • 最后,在
    SetupTypeDlg
    中,安装按钮使用用户在BrowseDlg浏览器中选择的路径触发延迟的
    CustomAction OfflinesXSINSInstall
  • 但是当我看到自定义安装时,
    offlinesxsinsinstall
    输出
    SXS\u路径的结果
    不会被
    BrowseDlg
    更改

    怎么了?我将感谢任何帮助

    main.wxs
    
    
    许可证接受=“1”
    许可证接受=“1”
    许可证接受=“1”
    1.
    1.
    1.
    未安装
    Windows服务器角色和功能DLG
    
    
    "1"]]>
    "1"]]>
    1.
    1.
    1.
    安装Windows IIS角色和.NET Framework功能
    {\WixUI\u Font\u Title}添加Windows IIS角色和.NET Framework功能
    
    configure.bat的内容如下: 它将hoge.txt复制到一个hoge{%date%,不带斜杠}.txt,并在其中写入%1参数。输出结果为“SxSFolder”

    附言。 这是一个补充信息…我未能理解标记目录Id=“SxSFolder”Name=“SxS”中定义的值“SxSFolder”的含义…(BrowseDlg PathEdit将其理解为“C:\SxS\”作为初始值…)我想将路径(可能包含在覆盖的SxSFolder.Name…)设置为CustomActionData。。。。但是怎么做

    第2页。 我在读取…后将CustomActions更改为设置[“目录id”]。。。。但批处理输出结果仍然是“C:\SxS\”…(未被BrowseDlg结果覆盖…)

    
    
    第3页。msiexec/i{msi}/lv*(对日语字符表示抱歉…)告诉我某些内容覆盖了“SxSFolder”属性,但结果仍然没有被覆盖

    200:アクション 10:39:37: BrowseDlg。Dialog created
    201:MSI (c) (B8:7C) [10:39:40:095]: PROPERTY CHANGE: Modifying SxSFolder property. Its current value is 'C:\SxS\'. Its new value: 'C:\'.
    202:MSI (c) (B8:7C) [10:39:43:411]: PROPERTY CHANGE: Modifying SxSFolder property. Its current value is 'C:\'. Its new value: 'C:\SxSDummy\'. (<--Overwritten Value)
    203:MSI (c) (B8:7C) [10:39:44:259]: Note: 1: 2727 2:  
    204:MSI (c) (B8:7C) [10:39:45:353]: Doing action: SetCustomActionData
    205:アクション 10:39:45: SetCustomActionData。
    206:アクション開始 10:39:45: SetCustomActionData。
    207:MSI (c) (B8:7C) [10:39:45:353]: PROPERTY CHANGE: Adding OfflineSxSInstall property. Its value is 'SxSFolder=C:\SxSDummy\'.
    208:アクション終了 10:39:45: SetCustomActionData。 戻り値 1。
    
    764:Property(C): OfflineSxSInstall = SxSFolder=C:\SxSDummy\
    
    769:Property(C): SxSFolder = C:\SxSDummy\
    
    200:アクション 10:39:37:已创建浏览LG.对话框
    201:MSI(c)(B8:7C)[10:39:40:095]:属性更改:修改SxSFolder属性。其当前值为“C:\SxS\”。它的新值:“C:\”。
    
    202:MSI(c)(B8:7C)[10:39:43:411]:属性更改:修改SxSFolder属性。其当前值为“C:\”。它的新值:“C:\SxSDummy\”。(这是自我回复。我从自定义操作中设置的属性id中删除了所有下划线和所有小写字符

    下面是wxs文件,它可以通过BrowserDlg覆盖属性

    main.wxs

    
    许可证接受=“1”
    许可证接受=“1”
    许可证接受=“1”
    1.
    1.
    1.
    未安装
    
    Windows服务器角色和功能DLG

    
    "1"]]>
    "1"]]>
    1.
    1.
    1.
    安装IIS角色和.NET Framework功能。
    {\WixUI\u Font\u Title}安装IIS角色和.NET Framework功能
    
    我在Wix邮件列表中发布了一个相同的问题……我上传了一个详细的日志文件
    200:アクション 10:39:37: BrowseDlg。Dialog created
    201:MSI (c) (B8:7C) [10:39:40:095]: PROPERTY CHANGE: Modifying SxSFolder property. Its current value is 'C:\SxS\'. Its new value: 'C:\'.
    202:MSI (c) (B8:7C) [10:39:43:411]: PROPERTY CHANGE: Modifying SxSFolder property. Its current value is 'C:\'. Its new value: 'C:\SxSDummy\'. (<--Overwritten Value)
    203:MSI (c) (B8:7C) [10:39:44:259]: Note: 1: 2727 2:  
    204:MSI (c) (B8:7C) [10:39:45:353]: Doing action: SetCustomActionData
    205:アクション 10:39:45: SetCustomActionData。
    206:アクション開始 10:39:45: SetCustomActionData。
    207:MSI (c) (B8:7C) [10:39:45:353]: PROPERTY CHANGE: Adding OfflineSxSInstall property. Its value is 'SxSFolder=C:\SxSDummy\'.
    208:アクション終了 10:39:45: SetCustomActionData。 戻り値 1。
    
    764:Property(C): OfflineSxSInstall = SxSFolder=C:\SxSDummy\
    
    769:Property(C): SxSFolder = C:\SxSDummy\
    
    <?xml version="1.0" encoding="utf-8"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
        <Product Name="Hoge 1.12.0" Id="19DF906A-47EE-4B80-ABE8-D1D3F0D89136" UpgradeCode="9357FAA3-91F9-4976-882F-05F4098BBBE8" Language="1041" Codepage="932" Version="1.12.0" Manufacturer="Fuga">
            <Package Id="*" Keywords="Installer" Description="Hoge 1.12.0 Installer" Comments="Hoge is trademark of Fuga Inc." Manufacturer="Fuga" InstallerVersion="100" Languages="1041" Compressed="yes" SummaryCodepage="932" />
            <Property Id="CMD">
              <DirectorySearch Id="CmdFolder" Path="[SystemFolder]" Depth="1">
                <FileSearch Id="CmdExe" Name="cmd.exe"  />
              </DirectorySearch>
            </Property>
            <Media Id="1" Cabinet="Sample.cab" EmbedCab="yes" DiskPrompt="CD-ROM 1" />
            <Property Id="DiskPrompt" Value="Fuga Hoge 1.12.0 Installer [1]" />
            <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
            <Property Id="SXSPATH" Secure="yes" Value="SXSFOLDER" />
    
            <Directory Id="TARGETDIR" Name="SourceDir">
                <Directory Id="ProgramFilesFolder" Name="PFiles">
                    <Directory Id="Hoge" Name="Hoge">
                        <Directory Id="INSTALLDIR" Name="Hoge 1.0">
                            <Component Id="CONFIGURE.BAT" DiskId="1" Guid="041ED78B-3D42-4EBD-8DAE-29D94DEFFC20">
                             <File KeyPath="yes" Id="file_configure.bat" Name="configure.bat" Source="configure.bat" />
                            </Component>
                        </Directory>
                    </Directory>
                </Directory>
                <Directory Id="ProgramMenuFolder" Name="Programs">
                </Directory>
                <Directory Id="SXSFOLDER" />
                <Directory Id="DesktopFolder" Name="Desktop" />
            </Directory>
    
    
            <Feature Id="Complete" Title="Hoge 1.12.0" Description="Full Package" Display="expand" Level="1" ConfigurableDirectory="INSTALLDIR">
                <Feature Id="MainProgram" Title="Program" Description="Main Executable File" Level="1">
                    <ComponentRef Id="CONFIGURE.BAT" />
                </Feature>
            </Feature>
            <UI Id="MyWixUI_Mondo">
                <UIRef Id="WixUI_Mondo" />
    
                <DialogRef Id="WindowsServerRolesAndFeaturesDlg" />
                <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="WindowsServerRolesAndFeaturesDlg" Order="2">
                 LicenseAccepted = "1"
                </Publish>
                <Publish Dialog="WindowsServerRolesAndFeaturesDlg" Control="Next" Event="NewDialog" Value="SetupTypeDlg" Order="2">
                 LicenseAccepted = "1"
                </Publish>
                  <Publish Dialog="WindowsServerRolesAndFeaturesDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">LicenseAccepted = "1"</Publish>
                  <Publish Dialog="WindowsServerRolesAndFeaturesDlg" Control="Next" Event="SetTargetPath" Value="[SXSPATH]" Order="2">1</Publish>
                  <Publish Dialog="WindowsServerRolesAndFeaturesDlg" Control="ChangeFolder" Property="_BrowseProperty" Value="[SXSPATH]" Order="1">1</Publish>
                  <Publish Dialog="WindowsServerRolesAndFeaturesDlg" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
            </UI>
            <UIRef Id="WixUI_ErrorProgressText" />
            <InstallExecuteSequence>
                <Custom Action="OfflineSxSInstall" After="InstallFiles">NOT Installed</Custom>
            </InstallExecuteSequence>  
        </Product>
    </Wix>
    
    <?xml version="1.0" encoding="utf-8"?>
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
        <Fragment>
            <CustomAction Id="SetCustomActionData" Return="check" Property="OfflineSxSInstall" Value="[SXSFOLDER]" />
            <CustomAction Id="OfflineSxSInstall" Property="CMD" Execute="deferred" Return="check" Impersonate="yes" ExeCommand="/c &quot;&quot;[#file_configure.bat]&quot; &quot;[SXSFOLDER]&quot;&quot;" />
    
            <Property Id="ONOFF_PROPERTY" Secure="yes" Value="0" />
    
            <UI>
                <Dialog Id="WindowsServerRolesAndFeaturesDlg" Width="370" Height="270" Title="[ProductName] [Setup]" NoMinimize="yes">
                    <Control Id="RdxOnlineOffline" Type="RadioButtonGroup" X="40" Y="63" Width="300" Height="35" Property="ONOFF_PROPERTY" Text="Select Install Method:">
                        <RadioButtonGroup Property="ONOFF_PROPERTY">
                            <RadioButton Value="0" X="0" Y="0" Width="300" Height="15" Text="Available Windows Update" />
                            <RadioButton Value="1" X="0" Y="20" Width="300" Height="15" Text="Offline Install" />
                        </RadioButtonGroup>
                    </Control>
                    <Control Id="SourcePath" Type="Text" X="45" Y="98" Width="200" Height="15" TabSkip="no" Text="Input if offline and SxS source path available(&amp;U):" />
                    <Control Type="PathEdit" Id="TxtDir" X="45" Y="110" Width="220" Height="18" Property="SXSPATH" Indirect="yes">
                        <Condition Action="disable"><![CDATA[ONOFF_PROPERTY <> "1"]]></Condition>
                        <Condition Action="enable"><![CDATA[ONOFF_PROPERTY = "1"]]></Condition>
                    </Control>
                    <Control Id="ChangeFolder" Type="PushButton" X="265" Y="110" Width="56" Height="18" Text="Browse...">
                        <Condition Action="disable"><![CDATA[ONOFF_PROPERTY <> "1"]]></Condition>
                        <Condition Action="enable"><![CDATA[ONOFF_PROPERTY = "1"]]></Condition>
                    </Control>
                    <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="Back(&amp;B)">
                        <Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
                    </Control>
                    <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="Next(&amp;N)">
                        <Publish Event="DoAction" Value="SetCustomActionData">1</Publish>
                    </Control>
                    <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
                        <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
                    </Control>
                    <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
                    <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
                        <Text>Install IIS role and .NET Framework features.</Text>
                    </Control>
                    <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
                    <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
                        <Text>{\WixUI_Font_Title}Install IIS role and .NET Framework features</Text>
                    </Control>
                    <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
                </Dialog>
            </UI>
        </Fragment>
    </Wix>