我正在创建一个MSI包,用于使用WiX v3.8安装和启动Windows服务.代码如下:
<Component Id="INSTALLAPSSERVICE" Guid="991D5F82-0E77-4FE3-B1D8-4C941B84C7CD" Win64="yes">
<File Id="ApsService.exe"
Name="ApsService.exe"
Source="Resource\ApsService.exe"
KeyPath="yes"
Vital="yes"
DiskId="1"></File>
<ServiceInstall Id="ApsServiceInstaller"
Name="ApsService"
DisplayName="ApsService"
Type="ownProcess"
Start="auto"
ErrorControl="normal"
Description="A monitor service for windows application."
Account="[SERVICEACCOUNT]"
Password="[SERVICEPASSWORD]"
Vital="yes"
Interactive="no"></ServiceInstall>
<ServiceControl Id="StartService"
Start="install"
Stop="both"
Remove="uninstall"
Name="ApsService"
Wait="yes"/>
</Component>
Run Code Online (Sandbox Code Playgroud)
但安装失败,日志中出现以下错误:
Executing op: ServiceControl(,Name=ApsService,Action=1,Wait=1,)
StartServices: Service: ApsService
Error 1920. Service 'ApsService' (ApsService) failed to start. Verify that you have sufficient privileges to start system services.
MSI (s) (F0:D0) [15:57:28:630]: I/O on thread 3676 could not be cancelled. Error: 1168
MSI (s) (F0:D0) …Run Code Online (Sandbox Code Playgroud) 我想在msi安装程序进行重大升级时保留配置文件.对于配置文件,我在安装时进行了更改.代码如下:
<Component Id="MODIFYCONFIG" Guid="6A1D7762-B707-4084-A01F-6F936CC159CE" Win64="yes">
<File Id="Application.config" Name="Application.config" Vital="yes" KeyPath="yes" Source="Resource\Application.config"></File>
<util:XmlFile Id="SetValueIP" Action="setValue" Permanent="yes" File="[#Application.config]"
ElementPath="/configuration/applicationSettings/Application.Properties.Settings/setting[\[]@name='IpAddress'[\]]/value" Value="[IPADDRESS]" Sequence="1"/>
<util:XmlFile Id="SetValuePort" Action="setValue" Permanent="yes" File="[#Application.config]"
ElementPath="/configuration/applicationSettings/Application.Properties.Settings/setting[\[]@name='IpPort'[\]]/value" Value="[PORT]" Sequence="2"/>
<Condition>Not Installed</Condition>
</Component>
<Component Id="KEEPCONFIG" Guid="F7F173AA-C2FD-4017-BFBC-B81852A671E7" Win64="yes">
<RemoveFile Id="ApplicationConfig" Name="Application.config" On="uninstall"/>
<Condition>(REMOVE=ALL) AND (NOT UPGRADINGPRODUCTCODE)</Condition>
</Component>
Run Code Online (Sandbox Code Playgroud)
但是,当发生重大升级时,不会保留文件.如何保留修改后的文件?
我有一个单选按钮组和复选框覆盖白色背景位图.单选按钮和复选框显示为默认背景控件颜色(灰色).有没有办法在wix中将这些控件的背景颜色更改为白色?
我正在开发一个应该在wix v3.8中安装Windows服务的安装程序.问题是我们需要进行重大升级而不卸载服务只是为了阻止它.
我们在包含服务exe文件的组件中使用ServiceInstall和ServiceControl.有没有办法使ServiceInstall的执行有条件(使用像REMOVE ="ALL"和NOT UPGRADINGPRODUCTCODE这样的条件)所以升级时没有卸载服务(刚刚停止,所以我们可以升级文件)?
一种解决方案是使用自定义操作,但也许有更好的方法?
谢谢!
我可以在wix的setup项目中编写一个注册表项和值,代码如下:
<RegistryKey Id="WinApp" Root="HKLM" Key="Software\App\[ProductName]" Action="createAndRemoveOnUninstall" >
<RegistryValue Type="string" Name="InstallName" Value="[ProductName]" Action="write" KeyPath="yes"></RegistryValue>
</RegistryKey>
Run Code Online (Sandbox Code Playgroud)
我怎么能在bootstrapper项目中做?
wix ×5
upgrade ×2
bitmap ×1
bootstrapper ×1
preserve ×1
radio-button ×1
registry ×1
service ×1
wix3.8 ×1