我为 Windows 服务创建了一个 Wix 设置项目。在我的本地开发人员机器(Windows 7 - 64)上,它运行并启动没有问题。但是,当我尝试在 Windows Server 2008 上安装它时,我收到“验证您有足够的权限...”的“常见”错误。在事件查看器中,我可以看到这是由 .NET 运行时引发 FileNotFoundException
应用程序:RT.Tools.AutoBettingWinService.exe
框架版本:v4.0.30319 描述:进程因未处理的异常而终止。
异常信息:System.IO.FileNotFoundException
堆栈:在 RT.Tools.AutoBettingWinService.Program.Main()
我已经尝试在我的 .wxs 文件中添加我能想到的所有文件。如下
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="AutoBettingWinService.Setup" Language="1033" Version="1.0.0.0" Manufacturer="Norsk RT" UpgradeCode="5756e8b0-3eef-4b1c-9c74-60c05386bff5">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="AutoBettingWinService.Setup" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="AutoBettingWinService.Setup" >
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="RT.Tools.AutoBettingWinService" Guid="{8B3B5B09-701E-4BA4-9FD2-093072B303D3}">
<File Id="Common.Logging.dll" Name="Common.Logging.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\Common.Logging.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="RT.Tools.Betting.dll" Name="RT.Tools.Betting.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\RT.Tools.Betting.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="Moq.dll" Name="Moq.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\Moq.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="Newtonsoft.Json.dll" Name="Newtonsoft.Json.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\Newtonsoft.Json.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="nunit.framework.dll" Name="nunit.framework.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\nunit.framework.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="Quartz.dll" Name="Quartz.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\Quartz.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="RT.Testing.dll" Name="RT.Testing.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\RT.Testing.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="RT.WebAPI.dll" Name="RT.WebAPI.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\RT.WebAPI.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="System.Net.Http.dll" Name="System.Net.Http.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\System.Net.Http.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="System.Net.Http.Formatting.dll" Name="System.Net.Http.Formatting.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\System.Net.Http.Formatting.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="System.Net.Http.WebRequest.dll" Name="System.Net.Http.WebRequest.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\System.Net.Http.WebRequest.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="System.Web.Http.dll" Name="System.Web.Http.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\System.Web.Http.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="System.Web.Http.WebHost.dll" Name="System.Web.Http.WebHost.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\System.Web.Http.WebHost.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="Thinktecture.IdentityModel.dll" Name="Thinktecture.IdentityModel.dll" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\Thinktecture.IdentityModel.dll" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="_1000UserIds.txt" Name="1000UserIds.txt" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\1000UserIds.txt" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="RT.Tools.AutoBettingWinService.exe.manifest" Name="RT.Tools.AutoBettingWinService.exe.manifest" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\RT.Tools.AutoBettingWinService.exe.manifest" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="RT.Tools.AutoBettingWinService.exe.config" Name="RT.Tools.AutoBettingWinService.exe.config" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\RT.Tools.AutoBettingWinService.exe.config" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="RT.Tools.AutoBettingWinService.pdb" Name="RT.Tools.AutoBettingWinService.pdb" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\RT.Tools.AutoBettingWinService.pdb" Vital="yes" KeyPath="no" DiskId="1"/>
<File Id="RT.Tools.AutoBettingWinService.exe" Name="RT.Tools.AutoBettingWinService.exe" Source="..\RT.Tools.AutoBettingWinService\bin\Debug\RT.Tools.AutoBettingWinService.exe" Vital="yes" KeyPath="yes" DiskId="1"/>
<ServiceInstall
Id="ServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="AutoBettingService"
DisplayName="AutoBettingService"
Description="Places bets automatically a given time of day"
Start="auto"
Account="NT AUTHORITY\NETWORK SERVICE"
ErrorControl="normal"
Interactive="no"
>
</ServiceInstall>
<ServiceControl Id="StartService" Start="install" Stop="both" Remove="uninstall" Name="AutoBettingService" Wait="yes" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>
我还尝试省略“开始”属性并尝试手动启动它,结果相同。
谁能告诉我我的设置有什么问题?为什么会出现 FileNotFoundException?
谢谢!