我在Wix 3.7上.我有一个MSI,我想设置一个注册表项(可能通过自定义操作,因为他将不得不检查该键是否已存在).
据我所知,bootstrapper项目中的Bundle无法更改机器状态(例如设置注册表).因此,我试图通过命令行参数传递<MsiProperty>,但似乎不会在我的日志文件中显示为引导程序的命令行参数.
束:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle
Name="MyInstallerBootstrapperLocalDb"
Version="1.0.0.0"
Manufacturer="some company"
UpgradeCode="PUT-GUID-HERE">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<MsiPackage Id="MyInstallerInstaller"
SourceFile="$(var.MyInstallerInstaller.TargetPath)"
Compressed="no">
<!-- TODO - if this is being set correctly, the MSI needs to
interpret it and set up the key-->
<MsiProperty Name="SetLocalDb" Value="yes"/>
</MsiPackage>
</Chain>
</Bundle>
</Wix>
Run Code Online (Sandbox Code Playgroud) 可能重复:
在C#中从short转换为byte时会发生什么?
有人可以解释在将值转换为字节时发生的情况,如果它超出了最小/最大字节的范围吗?它似乎取整数值并用255模数.我试图理解为什么这不会引发异常的原因.
int i = 5000;
byte b = (byte)i;
Console.WriteLine(b); // outputs 136
Run Code Online (Sandbox Code Playgroud) 我目前有一个Visual Studio部署项目,用于为我的应用程序创建MSI,我正在移植到WiX安装程序.VS安装程序使用具有从System.Configuration.Install.Installer继承的自定义安装操作的库,例如:
[RunInstaller(true)]
public partial class MyCustomInstaller: Installer
{
}
Run Code Online (Sandbox Code Playgroud)
这些如何等同于Wix行动?我认为一般来说,WiX允许您在安装后运行自定义操作.这些只是可执行文件吗?在我的例子中,我所拥有的自定义安装操作是DLL中的类,而不是EXE.如何从我的WiX配置中执行这些操作?
我有一个自定义JavaFx控件,在我的应用程序中呈现.但是,我不能让SceneBuilder理解它.
我有CustomTextField.java/CustomTextField.fxml.CustomTextField从用户控件继承,定义在这里,但是我创造的任何自定义控制我的场景生成器的问题发生.
首先,我必须将我的import语句更改为通配符.从
<import sample.CustomTextField>
Run Code Online (Sandbox Code Playgroud)
至
<import sample.*>
Run Code Online (Sandbox Code Playgroud)
否则,scenebuilder抛出一个异常/显示一个栈跟踪,表明无法找到源文件.我不知道为什么这是必要的,但似乎有效,所以我继续前进.
我已经读过你要在fxml文件中指定一个scenebuilder-classpath-element.所以,我尝试了我能想到的每一个组合:
<?scenebuilder-classpath-element ../../bin?>
<?scenebuilder-classpath-element ../../out?>
<?scenebuilder-classpath-element ../../../out?>
<?scenebuilder-classpath-element ./?>
<?scenebuilder-classpath-element ../../../../../target/classes?>
Run Code Online (Sandbox Code Playgroud)
我的问题是自定义控件不会在Scene Builder中呈现.在层次结构树中选择它,它表示"选择包含未解析的引用".如果我无法拖放自定义控件,那是可以接受的.但是,我真的想在Scene Builder中渲染它并布置其他东西.
我正在使用IntelliJ IDEA 14和Scene Builder 2.0
sample.fxml:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import sample.*?>
<?scenebuilder-classpath-element ../../bin?>
<?scenebuilder-classpath-element ../../out?>
<?scenebuilder-classpath-element ../../../out?>
<?scenebuilder-classpath-element ./?>
<?scenebuilder-classpath-element ../../../../../target/classes?>
<Pane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
<children>
<Button fx:id="topButton" layoutY="2.0" mnemonicParsing="false" text="Button Top" />
<CustomTextField fx:id="myCustomTextField" layoutX="1.0" layoutY="40.0" />
<Button layoutX="1.0" layoutY="125.0" mnemonicParsing="false" text="Button Bot" />
</children> …Run Code Online (Sandbox Code Playgroud) 我的目标是.NET 3.5.假设我有一个类Bob,它是SubBob的抽象基类.
我可以声明这个:
Bob b = new SubBob();
Run Code Online (Sandbox Code Playgroud)
但我不能这样做:
// compliation error - can't convert
BindingList<Bob> myList = new BindingList<SubBob>();
Run Code Online (Sandbox Code Playgroud)
我的猜测是BindingList不希望你这样做,因为它必须知道右侧的类型与左侧的内存布局相同.SubBob的大小可能比Bob大.
有没有办法可以进行隐式转换,还是需要强制转换?
我试图断言在存根上调用了一个方法.我试图断言的方法被称为IEnumerable<string>.我不关心确切的内容,但我只想测试计数是一定数量.我知道,我无法得到断言
Rhino.Mocks.Exceptions.ExpectationViolationException : Bob.DoThings(collection count equal to 10); Expected #1, Actual #0.
Run Code Online (Sandbox Code Playgroud)
我知道DoThings()确实被调用了...我只是无法使约束正确...
var myBob= MockRepository.GenerateStub<Bob>();
var countConstraint = Rhino.Mocks.Constraints.List.Count(Rhino.Mocks.Constraints.Is.Equal(10));
// execution code....
Joe myJoe = new Joe(myBob);
myJoe.MethodThatShouldCallDoThingWith10();
myBob.AssertWasCalled(s => s.DoThings(null), o => Constraints(countConstraint));
Run Code Online (Sandbox Code Playgroud)
我也尝试添加"IgnoreArguments"作为约束.我错过了什么?
我想创建一个模式对话框,其控件比标准.NET MessageBox提供的控件多.我创建了自己的Windows窗体,将使用ShowDialog()调用它来提供模态行为.但是,我想利用MessageBox通过的图形MesageBoxIcon.这可能吗?是否也可以复制播放与消息框图标关联的错误/警告窗口声音(因为它们是在用户的窗口设置中设置的)?
我使用的是WiX 3.7,我无法使用简单的<PackageGroupRef Id ="NetFx40Web"/> bundle元素,因为它不会带来Net FX安装程序包,或者将它嵌入到setup.exe中.我已经在我的Bundle.wxs文件中为此创建了自己的包,但我仍然遇到了麻烦.它似乎总是尝试安装.NET 4,即使机器已经安装了.NET.
我不太确定InstallCondition和DetectCondition之间的区别.我认为如果评估为true,则使用InstallCondition来安装软件包,否则将其卸载.如何处理通常是永久性的东西=是,例如大多数先决条件?我认为,DetectCondition几乎完全相反,它检查它是否已经在系统上,如果是,则不安装它.
下面是我Bundle.wxs在Visual Studio WiX Bootstrapper项目中的完整文件.我试图查看注册表和.NET 4.0注册表项的范围.如果它存在,那么我不想安装.NET 4.如果它不存在,那么安装它.但是,这不起作用,它总是尝试安装.NET.
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle
Name="MyProgramBootstrapper"
Version="1.0.0.0"
Manufacturer="Microsoft"
UpgradeCode="{2299B51D-9FD8-4278-90C8-2B79DB37F402}">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<PackageGroupRef Id="Netfx4Full"/>
<MsiPackage
Id="MyProgramInstaller"
SourceFile="$(var.MyProgramInstaller.TargetPath)"
Compressed="no"/>
</Chain>
</Bundle>
<Fragment>
<Property Id="NET40_FULL_INSTALL_32">
<RegistrySearch
Id ="SearchNet40_32bit"
Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Name="Version"
Type ="raw"/>
</Property>
<Property
Id="NET40_FULL_INSTALL_64">
<RegistrySearch
Id ="SearchNet40_64bit"
Root="HKLM"
Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full"
Name="Version"
Type ="raw"
Win64="yes" /> …Run Code Online (Sandbox Code Playgroud) 我正在使用osmdroid,并且已在地图上添加MyLocationNewOverlay以显示当前位置。看起来不错。我想要的是一个按钮,该按钮会将地图中心放在我的当前位置,类似于Google地图。
有内置的方法吗?如果没有,我该如何创建自定义叠加层来做到这一点?
我意识到MyLocationNewOverlay具有启用跟踪位置的功能。我不想这样。我只想要一个按需的中心按钮。
回到 Windows 7,Ctrl+C 可以很好地终止诸如 gradle 之类的任务。在 Windows 10 上,它没有。我升级到 Git Bash 2.20.1,它声称它已修复(找不到网络链接,发行说明是安装包的一部分并在本地查看)。
Ctrl+C 现在在 Git Bash 中以一种复杂的方式处理:它模拟了 Ctrl+C 在 Git CMD 中的处理方式,但是以细粒度的方式。
Ctrl+C 仍然对我不起作用。我通过右键单击资源管理器中的文件夹并选择“Git Bash Here”来启动 git bash
当我在 bash 终端空闲时(没有运行任务),Ctrl+C 似乎可以工作,但是例如 gradle 对 Ctrl+C 没有响应。
c# ×3
wix ×3
wix3.7 ×3
casting ×2
.net ×1
.net-3.5 ×1
android ×1
bash ×1
bootstrapper ×1
byte ×1
ctrl ×1
dictionary ×1
generics ×1
git-bash ×1
java ×1
javafx ×1
list ×1
messagebox ×1
osmdroid ×1
rhino-mocks ×1
scenebuilder ×1
terminal ×1
unit-testing ×1
winforms ×1