WIX中的条件属性失败导致整个MSI作业失败
我正在使用WIX为C#服务创建MSI安装程序。MSI执行3项任务: a) 将解决方案文件从bin复制到特定位置 b) 创建一个文件夹,服务在其中写入日志 c) 如果以前不存在该服务,请在机器上安装该服务 用户希望以类似的顺序执行这些操作。但是,当检查服务是否安装的条件失败时,上一步似乎没有执行,即复制和创建步骤也失败 下面是代码片段WIX中的条件属性失败导致整个MSI作业失败,wix,windows-installer,Wix,Windows Installer,我正在使用WIX为C#服务创建MSI安装程序。MSI执行3项任务: a) 将解决方案文件从bin复制到特定位置 b) 创建一个文件夹,服务在其中写入日志 c) 如果以前不存在该服务,请在机器上安装该服务 用户希望以类似的顺序执行这些操作。但是,当检查服务是否安装的条件失败时,上一步似乎没有执行,即复制和创建步骤也失败 下面是代码片段 <Directory Id="TARGETDIR" Name="SourceDir"> <!--Creating folder h
<Directory Id="TARGETDIR" Name="SourceDir">
<!--Creating folder hierarchy for storing project solution files; reference defined in fragments-->
<Directory Id="ProgramFilesFolder" Name="PFiles"/>
<!--Creating folder hierarchy for storing logs; reference defined in fragments-->
<Directory Id="LOGS" Name="Logs"/>
</Directory>
<InstallExecuteSequence>
<LaunchConditions After='AppSearch' />
<Custom Action='CMDInstallService' Before='InstallFinalize'></Custom>
</InstallExecuteSequence>
这将不起作用,因为在
InstallFinalize
之前未提交文件和文件夹。要安装服务,应使用以下命令:
<Component Id="Component_WinService" Directory="Directory_WindowsService" Guid="*">
<File Id="File_WindowsService" KeyPath="yes"
Source="WindowsService.exe" />
<ServiceInstall Id="ServiceInstall_WindowsService"
Type="ownProcess"
Vital="yes"
Name="My Windows service"
Description="Windows service."
Start="auto"
Account="LocalSystem"
ErrorControl="ignore"
Interactive="no"
/>
<ServiceControl Id="ServiceControl_WindowsService"
Start="install"
Stop="both"
Remove="uninstall"
Name="My Windows Service"
Wait="no"
/>
</Component>
我删除了自定义操作。服务安装程序当前不工作。它抛出错误,“服务“myService”(myService)启动失败。请验证您是否有足够的权限启动系统服务。”C:\Windows\assembly\GAC\adodb\7.0.3300.0\uuu b03f5f7f11d50a3a\adodb.dll C:\Windows\Microsoft.NET\Framework\v2.0.50727\您的安装是否正在运行?您是否更改了服务安装
的帐户
?这些是常见的问题。有关真正原因的更多信息,必须使用以下命令从提升的命令提示符运行安装:msiexec/i installer.msi/l*v log.txt
,然后搜索日志中与服务启动相关的任何错误。marlos,我在InstallPrivileges=“提升”上运行。日志文件没有任何额外错误。我可以使用Installutill.exe手动安装服务。现在服务安装工作正常。我的服务有以前的副本。我一洗干净,它就开始自动运转了。
<Component Id="Component_WinService" Directory="Directory_WindowsService" Guid="*">
<File Id="File_WindowsService" KeyPath="yes"
Source="WindowsService.exe" />
<ServiceInstall Id="ServiceInstall_WindowsService"
Type="ownProcess"
Vital="yes"
Name="My Windows service"
Description="Windows service."
Start="auto"
Account="LocalSystem"
ErrorControl="ignore"
Interactive="no"
/>
<ServiceControl Id="ServiceControl_WindowsService"
Start="install"
Stop="both"
Remove="uninstall"
Name="My Windows Service"
Wait="no"
/>
</Component>