- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在开发一个项目,我需要从 Windows 的 Wix 安装程序安装一个作为 Spring Boot 应用程序运行的 Java 服务。它应该自动检测系统上是否已经全局安装了 JRE 实例,如果是,则使用它,否则,为此应用程序安装私有(private) JRE。在寻找完整的解决方案并解决许多不同的问题之后,我想出了一个可行的配置。它通过 Wix 手动安装服务并设置 procrun 程序所需的所有注册表项,而不是使用 procrun 来安装服务。
我是该网站的新手(作为提交者),但我将发布我创建的 Wix XML 作为答案。它尚未完美完善,但希望能帮助其他人克服我为完成这项工作而必须跨越的障碍。
最佳答案
这是一个(摘要的)Wix xml,其中包含重要的部分。由于回复大小限制,我不得不总结一下。感谢许多堆栈溢出答案帮助实现这一点。
<?xml version="1.0" encoding="utf-8"?>
<!--
# This comment is generated by WixEdit, the specific commandline
# arguments for the WiX Toolset are stored here.
candleArgs:
lightArgs: "heimdalldemo.wixobj" -out "heimdalldemo.msi" -ext WixUtilExtension -ext WixUIExtension
-->
<!-- installation script for the Heimdall Data Access Platform, www.heimdalldata.com -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="Heimdall Data Access Platform" Language="1033" Version="0.9.0.1" Manufacturer="Heimdall Data" UpgradeCode="98CE97B6-8E91-42F5-8C32-8F0F078433EC">
<Package Description="Heimdall Data Server and Driver Installer" Comments="Heimdall Installer" InstallPrivileges="elevated" InstallScope="perMachine" InstallerVersion="200" Compressed="yes" Platform="x64" />
<Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
<?define ProductName = "Heimdall Data Access Platform" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<!-- Check some requirements ONLY on "install", but not on modify or uninstall. -->
<Property Id="JAVA_CURRENT_VERSION64">
<RegistrySearch Id="JRE_CURRENT_VERSION_REGSEARCH64" Root="HKLM" Key="SOFTWARE\JavaSoft\Java Runtime Environment" Name="CurrentVersion" Type="raw" Win64="yes" />
</Property>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.PlatformProgramFilesFolder)">
<Directory Id="DRIVERDIR" Name="Heimdall">
<!-- driver components -->
</Directory>
<Directory Id="TRAFFICDIR" Name="Heimdall">
<!-- traffic generator components -->
</Directory>
<Directory Id="SERVERDIR" Name="Heimdall">
<Component Id="REGISTRY_A" DiskId="1" Guid="*">
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\Heimdall\Parameters\Java" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Classpath" Value="[SERVERDIR]heimdallserver.jar" KeyPath="yes" />
<RegistryValue Type="string" Name="Jvm" Value="auto" />
<RegistryValue Type="multiString" Action="append" Name="Options">
<MultiStringValue Type="multiString" Name="Options" Action="append">-Duser.dir=[SERVERDIR]</MultiStringValue>
<MultiStringValue Type="multiString" Name="Options" Action="append">-XX:+UseConcMarkSweepGC</MultiStringValue>
<MultiStringValue Type="multiString" Name="Options" Action="append">-XX:+CMSIncrementalPacing</MultiStringValue>
<MultiStringValue Type="multiString" Name="Options" Action="append">-XX:ParallelGCThreads=2</MultiStringValue>
<MultiStringValue Type="multiString" Name="Options" Action="append">-XX:+AggressiveOpts</MultiStringValue>
</RegistryValue>
<RegistryValue Type="integer" Name="JvmMs" Value="128" />
<RegistryValue Type="integer" Name="JvmMx" Value="512" />
<RegistryValue Type="integer" Name="JvmSs" Value="4000" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\Heimdall\Parameters\Log" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Path" Value="[SERVERDIR]log" />
<RegistryValue Type="string" Name="Level" Value="Error" />
<RegistryValue Type="string" Name="Prefix" Value="procrun.log" />
<RegistryValue Type="string" Name="StdError" Value="auto" />
<RegistryValue Type="string" Name="StdOutput" Value="auto" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\Heimdall\Parameters\Start" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Mode" Value="jvm" />
<RegistryValue Type="string" Name="Class" Value="com.heimdalldata.server.Bootstrap" />
<RegistryValue Type="string" Name="WorkingPath" Value="[SERVERDIR]" />
<RegistryValue Type="string" Name="Method" Value="start" />
<RegistryValue Type="string" Name="Params" Value="start" />
<RegistryValue Type="string" Name="StdOutput" Value="auto" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\Heimdall\Parameters\Stop" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Mode" Value="jvm" />
<RegistryValue Type="string" Name="Class" Value="com.heimdalldata.server.Bootstrap" />
<RegistryValue Type="string" Name="Method" Value="stop" />
<RegistryValue Type="string" Name="Params" Value="stop" />
<RegistryValue Type="string" Name="StdOutput" Value="auto" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\Heimdall" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Description" Value="Heimdall Management and Logging Server" />
<RegistryValue Type="string" Name="DisplayName" Value="Heimdall" />
<RegistryValue Type="string" Name="ImagePath" Value="[SERVERDIR]heimdallserver.exe //RS//Heimdall" />
<RegistryValue Type="string" Name="DependsOnService" Value="Tcpip Afd" />
<RegistryValue Type="string" Name="ObjectName" Value="LocalSystem" />
<RegistryValue Type="integer" Name="ErrorControl" Value="1" />
<RegistryValue Type="integer" Name="Start" Value="2" />
<RegistryValue Type="integer" Name="Type" Value="16" />
</RegistryKey>
<RegistryKey Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\Heimdall\Parameters" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="Test" Value="Pass" />
</RegistryKey>
</Component>
<Component Id="REGISTRY_B" DiskId="1" Guid="*">
<RegistryKey Root="HKLM" Key="SOFTWARE\Apache Software Foundation\Procrun 2.0\Heimdall\Parameters\Java" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Name="JavaHome" Value="[SERVERDIR]jre6" />
<RegistryValue Type="string" Name="Jvm" Value="[SERVERDIR]jre6\bin\server\jvm.dll" />
</RegistryKey>
</Component>
<Component Id="HEIMDALLSERVER64.EXE" DiskId="1" Guid="*"> <!-- this is the renamed procrun 64 bit executable -->
<File Id="HEIMDALLSERVER64.exe" Name="heimdallserver.exe" Source="c:\heimdall\heimdallserver64.exe" />
<ServiceInstall Id="HEIMDALLSERVER64" Type="ownProcess" Name="Heimdall" DisplayName="Heimdall" Description="Heimdall Management and Logging Server" Start="auto" Account="[SERVICEACCOUNT]" Password="[SERVICEPASSWORD]" ErrorControl="normal" Arguments=" //RS//Heimdall" />
<ServiceControl Id="StartService64" Start="install" Stop="both" Remove="uninstall" Name="Heimdall" Wait="no" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="Server" Title="Heimdall Server" Level="1" ConfigurableDirectory="SERVERDIR">
<ComponentRef Id="REGISTRY_A" />
<!-- all server components -->
<Feature Id="Configuration" Title="Example Configuration" Level="1" ConfigurableDirectory="CONFIG">
<!-- all configuration components -->
</Feature>
<Feature Id="Drivers" Title="Driver Library" Level="1" ConfigurableDirectory="CONFIG">
<!-- all driver feature components -->
</Feature>
</Feature>
<Feature Id="Driver" Title="Heimdall Driver" Level="1" ConfigurableDirectory="DRIVERDIR">
<!-- driver component -->
<Feature Id="Libraries" Title="Grid API Libraries" Level="6" ConfigurableDirectory="LIBDIR">
<!-- all library components -->
</Feature>
</Feature>
<Feature Id="JRE" Title="Private JRE" Level="1" ConfigurableDirectory="SERVERDIR">
<Condition Level="6">JAVA_CURRENT_VERSION64 >= "1.6"</Condition>
<ComponentRef Id="REGISTRY_B" />
<!-- all JRE file components -->
</Feature>
<UI />
<UIRef Id="WixUI_Mondo" />
<!-- custom dialog (welcome and completion dialogs) 493x312 -->
<WixVariable Id="WixUIDialogBmp" Value="C:\heimdall\banner.bmp" />
<!-- custom logo (top bar) 493x58 -->
<WixVariable Id="WixUIBannerBmp" Value="C:\heimdall\logo.bmp" />
<!-- custom license agreement -->
<!-- <WixVariable Id="WixUILicenseRtf" Value="c:\heimdall\license.rtf" /> -->
<!-- call localhost:8087 on exit of installer when installing -->
<Property Id="MyURL"><![CDATA[http://localhost:8087/]]></Property>
<CustomAction Id="SetOpenURL" Property="WixShellExecTarget" Value="[MyURL]" />
<CustomAction Id="OpenURL" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" Return="ignore" />
<InstallExecuteSequence>
<!-- Launch webpage during full uninstall, but not upgrade -->
<Custom Action="SetOpenURL" After="InstallFinalize"><![CDATA[&Server=3 AND UILevel > 2 AND NOT Installed]]></Custom>
<Custom Action="OpenURL" After="SetOpenURL"><![CDATA[&Server=3 AND UILevel > 2 AND NOT Installed]]></Custom>
</InstallExecuteSequence>
</Product>
</Wix>
关于wix - 有人有完整的 wix 配置示例来安装基于 procrun 的 Java 服务吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32869155/
我一直在尝试查找文章或发布列出 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。
我是一名优秀的程序员,十分优秀!