【发布时间】:2016-09-22 16:21:34
【问题描述】:
我有一个 java 应用程序。我已经制作了一个 scansol-agent-app.exe 文件,我需要使用 WiX 制作安装程序。下面是scansol-agent.wxs文件的代码。我需要将此应用程序安装为 Windows 服务。 Servise 安装良好,但无法启动。 Windows 显示错误:“服务无法启动 - 验证您是否有足够的权限来启动系统服务” 我尝试了所有可以找到的变体,但没有任何结果。如何启动此服务?
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
UpgradeCode="{EB6B8302-C06E-4bec-ADAC-932C68A3A98D}"
Name="Scansol Agent Application Service"
Version="0.0.1"
Manufacturer="ScienceSoft"
Language="1033">
<Package InstallerVersion="200" Compressed="yes" Comments="Windows Installer Package" Manufacturer="ScienceSoft"/>
<Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>
<Property Id="WHSLogo">1</Property>
<WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
<UI>
<Property Id="ApplicationFolderName" Value="WiX Demo" />
<Property Id="WixAppFolder" Value="WiXxperMachineFolder" />
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
<UIRef Id="WixUI_InstallDir" />
<!-- Skip license dialog -->
<Publish Dialog="WelcomeDlg"
Control="Next"
Event="NewDialog"
Value="InstallDirDlg"
Order="2">1</Publish>
<Publish Dialog="InstallDirDlg"
Control="Back"
Event="NewDialog"
Value="WelcomeDlg"
Order="2">1</Publish>
<!--<Property Id="DefaultUIFont">DlgFont8</Property>-->
<TextStyle Id="DlgFont8" FaceName="Tahoma" Size="8" />
<TextStyle Id="DlgTitleFont" FaceName="Tahoma" Size="8" Bold="yes" />
<Dialog Id="InstallDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
<Text>{\DlgTitleFont}Ready to Install</Text>
</Control>
<Control Id="Install" Type="PushButton" X="304" Y="243" Width="56" Height="17"
Default="yes" Text="Install">
<Publish Event="EndDialog" Value="Return" />
</Control>
</Dialog>
</UI>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="INSTALLDIR" Name="ScansolAgent">
<Component Id="ApplicationServiceInstall" Guid="{908B7199-DE2A-4dc6-A8D0-27A5AE444FEA}">
<File Id='ApplicationFile1' Source="scansol-agent-app.exe" DiskId='1' KeyPath='yes' Vital='yes'/>
<File Id="ApplicationFile2" Source="config.cfg" DiskId='1' KeyPath='no' Vital='yes'/>
<ServiceInstall
Id="ServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="ScansolAgentService"
DisplayName="Scansol Agent Application Service"
Description="File Monitoring and Loading to server"
Start="auto"
Account="LocalSystem"
ErrorControl="ignore"
Interactive="no"
>
</ServiceInstall>
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="ScansolAgentService" Wait="yes" />
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="DefaultFeature" Level="1" Title="ScansolAgentAppService">
<ComponentRef Id="ApplicationServiceInstall" />
</Feature>
</Product>
</Wix>
【问题讨论】:
-
您在哪里看到“服务无法启动...”错误?在安装期间,还是在安装后启动服务时?
-
您是否尝试过手动安装服务?也许它只是损坏或缺少一些库。即使用“sc”命令行工具。
-
我在安装过程中遇到了这个错误。服务安装。但我不能启动它。当我使用 install4j 工具从同一个 .jar 创建安装程序时 - 我没有任何问题!
-
您也可以使用
eventvwr.exe查看事件,找出原因。正如@Nikolay 指出的那样,它可能是一些缺少的库或类似的。
标签: wix windows-services installation wix3.10 service-installer