Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/332.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

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
C# Wix:Can';t使用自定义操作设置属性_C#_Wix_Installation_Windows Installer - Fatal编程技术网

C# Wix:Can';t使用自定义操作设置属性

C# Wix:Can';t使用自定义操作设置属性,c#,wix,installation,windows-installer,C#,Wix,Installation,Windows Installer,我有一个对话框,它是我的安装程序的一部分,用于输入激活密钥。我可以从这个控件传递值 <Control Id="KEY1" Type="Edit" Property="KEY1" Height="17" Width="45" X="50" Y="150" Text="{5}" Indirect="no"/> 但我似乎不明白为什么我不能设置session[“KEY1”]=“test”并查看控件中的值。。。我什么都试过了,但都没用。这是我目前的密码 C#(自定义操作)

我有一个对话框,它是我的安装程序的一部分,用于输入激活密钥。我可以从这个控件传递值

         <Control Id="KEY1" Type="Edit" Property="KEY1" Height="17" Width="45" X="50" Y="150" Text="{5}" Indirect="no"/>
但我似乎不明白为什么我不能设置session[“KEY1”]=“test”并查看控件中的值。。。我什么都试过了,但都没用。这是我目前的密码

C#(自定义操作)

Wix

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Fragment>
    <Property Id="KEY1" Value="Test" Secure="yes"/>
    <Property Id="Key2"/>
    <Property Id="Key3"/>
    <Property Id="Key4"/>
    <Property Id="Key5"/>
    <Property Id="Key6"/>
    <UI>
      <Dialog Id="ActivationCodeDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)"/>
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}Activation Code"/>
        <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="Please enter your activation code"/>
        <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0"/>

        <Control Id="KEY1" Type="Edit" Property="KEY1" Height="17" Width="45" X="50" Y="150" Text="{5}" Indirect="no"/>
        <Control Id="Hyphen1" Type="Text" Height="17" Width="5" X="96" Y="153" Text="-"/>
        <Control Id="Key2" Type="Edit" Property="Key2" Height="17" Width="45" X="100" Y="150" Text="{5}"/>
        <Control Id="Hyphen2" Type="Text" Height="17" Width="5" X="146" Y="153" Text="-"/>
        <Control Id="Key3" Type="Edit" Property="Key3" Height="17" Width="45" X="150" Y="150" Text="{5}"/>
        <Control Id="Hyphen3" Type="Text" Height="17" Width="5" X="196" Y="153" Text="-"/>
        <Control Id="Key4" Type="Edit" Property="Key4" Height="17" Width="45" X="200" Y="150" Text="{5}"/>
        <Control Id="Hyphen4" Type="Text" Height="17" Width="5" X="246" Y="153" Text="-"/>
        <Control Id="Key5" Type="Edit" Property="Key5" Height="17" Width="45" X="250" Y="150" Text="{5}"/>
        <Control Id="Hyphen5" Type="Text" Height="17" Width="5" X="296" Y="153" Text="-"/>
        <Control Id="Key6" Type="Edit" Property="Key6" Height="17" Width="15" X="300" Y="150" Text="{1}"/>

        <Control Id="Activate" Type="PushButton" X="50" Y="200" Width="56" Height="17" Text="Activate">
          <Publish Event="DoAction" Value="Testing"/>
        </Control>

        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0"/>
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)"/>
        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)"/>
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
        </Control>
      </Dialog>
    </UI>
    <CustomAction Id='Testing' BinaryKey='FooBinary' DllEntry='TestAction' Execute='immediate'/>
    <Binary Id='FooBinary' SourceFile='Feenics.Keep.CustomActions.CA.dll'/>
  </Fragment>
</Wix>

1.

您的InstallExecuteSequence/InstallUISequence代码在哪里

<InstallUISequence>
    <Custom Action="Testing" Sequence="1" />
</InstallUISequence>

也许添加此选项会使此自定义操作在调用UI对话框之前发生

编辑: 另外,您是否对安装程序进行过任何详细的调试(详细日志记录),以检查正在发生的情况以及运行的时间?完成.MSI输出后,打开命令提示符并执行以下操作:

    msiexec.exe /i <yourmsi> /l*vx Output.txt
msiexec.exe/i/l*vx Output.txt

这将给你的东西的详细输出

你有错误吗?您在详细日志中看到了什么?您应该说明何时调用您的自定义操作-显然WiX代码没有调用它。
<InstallUISequence>
    <Custom Action="Testing" Sequence="1" />
</InstallUISequence>
    msiexec.exe /i <yourmsi> /l*vx Output.txt