C# Windows Server 2012 R2上的Wix安装程序失败

C# Windows Server 2012 R2上的Wix安装程序失败,c#,wix,wix3.11,C#,Wix,Wix3.11,我有一个windows服务的安装程序,它在windows 10上正常工作,但在windows Server 2012上失败 安装程序代码如下-> <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name=&qu

我有一个windows服务的安装程序,它在windows 10上正常工作,但在windows Server 2012上失败

安装程序代码如下->

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="IWErpnextPoll" Language="1033" Version="1.1.0" Manufacturer="IWW" UpgradeCode="ccc3c2fe-d20f-45ce-b978-4dc7c84ce6c8">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
        <MediaTemplate />

        <Feature Id="ProductFeature" Title="IWERPNextPoll_Setup" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
    </Product>

    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="IWErpnextPoll" />
            </Directory>
        </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
            <Component Id="Sage.Peachtree.API.dll">
                <File Source="$(var.IWErpnextPoll.TargetDir)Sage.Peachtree.API.dll" />
            </Component>
            <Component Id="Sage.Peachtree.API.Resolver.dll">
                <File Source="$(var.IWErpnextPoll.TargetDir)Sage.Peachtree.API.Resolver.dll" />
            </Component>
            <Component Id="Serilog.dll">
                <File Source="$(var.IWErpnextPoll.TargetDir)Serilog.dll" />
            </Component>
            <Component Id="Serilog.Sinks.File.dll">
                <File Source="$(var.IWErpnextPoll.TargetDir)Serilog.Sinks.File.dll" />
            </Component>
            <Component Id="RestSharp.dll">
                <File Source="$(var.IWErpnextPoll.TargetDir)RestSharp.dll" />
            </Component>
            <Component Id="ProductComponent">
                <File Source="$(var.IWErpnextPoll.TargetPath)" />
                <ServiceInstall Id="ServiceInstaller" Name="IWErpnextPoll" Type="ownProcess" Vital="yes" Description="Custom ERPNext connector for Sage 50." Start="auto" Account=".\LocalSystem" ErrorControl="normal" Interactive="no" />
                <ServiceControl Id="StartService" Name="IWErpnextPoll" Stop="both" Start="install" Remove="uninstall" Wait="yes" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

在服务器2012上,服务未启动,最终失败,并显示以下错误消息:


我正在windows 10上构建它,并在其他windows 10计算机上进行了测试。不幸的是,我无法访问Windows Server 2012,因此无法进行实验。是否有任何特定于server 2012的内容需要添加?或者可能是我需要在服务器上验证的某个条件,以便顺利完成安装?

如果没有测试机(有虚拟机?),通常无法进行调试,至少如果您还没有测试机的话。在深入了解很多细节之前:这些框上是否缺少运行时?缺少较旧版本的.NET framework(3.5)?其他缺少的依赖项?VisualC++运行时?失去NT特权?(我认为WiX检查)。A为你的记录做准备。还有很多链接需要添加,但空间有限。稍后再看。@SteinÅsmul感谢您的评论。你给了我正确的方向。我能够调查并发现问题在于,他们在为.NET4.7构建服务时安装了.NET4.5。谢谢你,是不是一样?您在此服务中使用了哪些功能?我还没有详细研究过这个问题。下面是一个不错的小玩具:-这里还有一个链接:。没有测试机(有虚拟机吗?)通常无法调试,至少如果你还没有测试机的话。在深入了解很多细节之前:这些框上是否缺少运行时?缺少较旧版本的.NET framework(3.5)?其他缺少的依赖项?VisualC++运行时?失去NT特权?(我认为WiX检查)。A为你的记录做准备。还有很多链接需要添加,但空间有限。稍后再看。@SteinÅsmul感谢您的评论。你给了我正确的方向。我能够调查并发现问题在于,他们在为.NET4.7构建服务时安装了.NET4.5。谢谢你,是不是一样?您在此服务中使用了哪些功能?我还没有详细看这个。下面是一个不错的小玩具:-这里还有一个链接:。