- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我的安装程序中有一个对话框,用于输入激活 key 。我能够从这个控件传递值,
<Control Id="KEY1" Type="Edit" Property="KEY1" Height="17" Width="45" X="50" Y="150" Text="{5}" Indirect="no"/>
我的自定义操作,
session["KEY1"]
但我似乎无法弄清楚为什么我不能设置 session["KEY1"] = "test"并在我的控件中查看值...我尝试了一切但没有任何效果。这是我当前的代码,
C#(自定义操作)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Deployment.WindowsInstaller;
namespace Test.CustomActions
{
public class CustomActions
{
[CustomAction]
public static ActionResult TestAction(Session session)
{
session.Log("Begin CustomAction1");
session["KEY1"] = "lol";
string[] lines = { session["KEY1"], "Second line", "Third line" };
System.IO.File.WriteAllLines(@"C:\CustomAction.txt", lines);
return ActionResult.Success;
}
}
}
维克斯
<?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>
最佳答案
InstallExecuteSequence/InstallUISequence 的代码在哪里?
<InstallUISequence>
<Custom Action="Testing" Sequence="1" />
</InstallUISequence>
也许添加这个将使这个自定义操作在您的 UI 对话框被调用之前发生。
编辑:此外,您是否对安装程序进行了任何详细的调试(详细日志记录)以检查发生了什么以及何时运行?获得 .MSI 输出后,打开命令提示符并执行以下操作:
msiexec.exe /i <yourmsi> /l*vx Output.txt
这将为您提供详细的输出结果!
关于c# - Wix:无法使用自定义操作设置属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23349651/
我一直在尝试查找文章或发布列出 WiX (Windows Installer XML)/WiX 工具集的功能限制的文章,但均未成功。使用 WiX 几个星期后,我至少能想到两个 限制 在最新的 RTM
我们在 SomeDialog.wxs 文件中有一个 WiX 片段,它会提示用户输入一些信息。它在 InstallerUI.wxs 文件中控制对话框顺序的另一个片段中被引用。当然,Product.wxs
我们有多个配置文件。根据所选的环境,正确的文件将被复制,其余文件应被删除。 我正在使用RemoveFile,但是不会删除任何内容,或者可能是我没有正确使用它。复制所有文件后,有人可以举一个例子在安装过
我正在为现有产品编写 MSI。在以前的版本中有一个自定义操作,它不仅限于在安装时运行,现在在使用 MajorUpgrade 卸载时失败。 新安装程序中是否有任何方法可以告诉 WiX 在卸载时跳过该特定
我需要在安装之前检查 .NET Framework。我添加了这个 文件的开头包含 并在链接时出现错误 error LGHT0094 :
如果在功能选择树中选择了另一个功能,是否有任何方法可以强制安装特定功能?那就是没有让功能成为它们依赖项的子项? 最佳答案 是的,这应该是可能的,如果您在 Feature 元素下使用 Condition
有没有办法在 WiX 中强制自动登录? 目前,要生成日志,我需要使用此参数执行我的包: application.msi /l*v log.txt 我想在 中找到一个方法标记 - 例如 - 强制日志始
我正在为我的项目创建一个 WIX 模板,以确保相对标准的布局。 我已经使用 定义了一个变量来引用主应用程序其中 MyApp 是引用项目的名称。然后,我使用 MainApp 变量在 .wxs 和 .w
我有一个名为 MyProject(P2P) 的 visual studio 项目,它一直运行良好。 现在我正在使用 Wix 3 将这个项目打包到 MSI 中,其中一个步骤是编写组件节点:
我正在使用Wix 3.6。我有一个问题,在卸载时是否打开了任何窗口并显示在任务栏中(此窗口是我试图卸载的msi的一部分),它显示了一个对话框,要求用户关闭应用程序(“在继续安装之前,应关闭以下应用程序
我需要澄清 *.wxs 文件中的目录结构。据我所知,它将文件安装在我们在目录元素中指定的目录中。它还有其他用途吗? 如果它确实描述了将安装产品的目录结构,那么如果用户在安装程序中有浏览选项会发生什么。
我们已经为我们的应用程序创建了 WIX 安装程序。我们面临的问题是: 我们已经定义了两个不同的自定义操作(比如 ActionForInstall 和 ActionForUninstall),我们希望在
我有一个应用程序安装程序,无论版本号如何,都需要通过任何现有版本进行安装。 相反,我有一个安装程序,不断说我需要添加/删除程序。对于我的测试人员而言,这是非常令人沮丧的行为,因为这只会在没有真正原因的
我正在使用VS 2010创建一个由Wix安装的程序,并且已经准备好product.wxs。 在我的wxs文件中,我有类似以下的目录定义:
关注 example here ,我在 ProgramMenuFolder 中添加了一个快捷方式启动我的应用程序。 (我的代码实际上更简单,因为我不需要额外的文件夹。)
即使在重新启动后,服务仍然存在,即使可执行文件消失了。我正在使用 WIX 版本 3.0.5419.0 安装 Windows 服务工作正常。卸载它似乎什么也没做。卸载日志文件的部分
我正在尝试配置 WiX 设置和库,以便将库中文件之一的版本用作设置中的 Product/@Version。 背景 在本地定义文件的设置中,这相对简单,因为假设组件项目被 WiX 项目引用然后配置:
我想在wix项目生成的msi文件的文件名中包含一些动态部分。这个动态部分应该由变量控制,这些变量是我的wix项目的一部分,并且应这样声明: 有谁知道将wix变量的值发送给链接器以将其用作输出文件名的
我真的觉得我不必为了获得这样的基本信息而在SO上提问,但是我在任何地方都找不到可靠的消息来源。 WiX v4是否已发布?开发中?在Beta中?还在设计中? 如此看来,许多人似乎已经在使用WiX v4。
如果注册表项 HKEY_CURRENT_USER\Control Panel\International\LocaleName 的值为 de-DE,我希望将 INSTALL_DE 属性值设置为 1。
我是一名优秀的程序员,十分优秀!