1

I have an installer for a windows service which works as expected on Windows 10 but fails on Windows Server 2012.

The installer code is this ->

<?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>

On server 2012, the service does not start and ultimately fails with this error message:

enter image description here

I'm building it on windows 10 and it is tested on other windows 10 computers as OK. Unfortunately, I don't have access to Windows Server 2012 so I can't experiment. Is there anything specific to server 2012 that I need to add? Or perhaps some condition that I need to verify on the server for the installation to complete smoothly?

Tundebabzy
  • 829
  • 2
  • 11
  • 24
  • Generally hopeless to debug without a test machine (got a virtual?), at the very least [create a proper, verbose log file](https://stackoverflow.com/a/54458890/129130) if you don't have one already. Before getting into a lot of details: is there a missing runtime on those boxes? An older version of the .NET framework is missing (3.5)? Other missing dependencies? Visual C++ Runtime? Missing NT privilege? (I think WiX checks). A [Service FAQ](https://www.coretechnologies.com/WindowsServices/FAQ.html) for your records. Plenty further links to add, but out of space. Will look later. – Stein Åsmul Jul 02 '20 at 16:38
  • [One more starting point for debugging](https://stackoverflow.com/a/61149858/129130). – Stein Åsmul Jul 02 '20 at 22:26
  • @SteinÅsmul Thanks for your comments. You put me in the right direction. I was able to investigate and find the problem to be that they had .net 4.5 installed while the service was built for .NET 4.7. Thanks a lot – Tundebabzy Jul 09 '20 at 16:38
  • Isn't that the same [.NET runtime](https://stackoverflow.com/a/10594278/129130)? What features are you using in this service? I haven't looked at this in detail. – Stein Åsmul Jul 09 '20 at 16:51
  • A nice little toy down the page here: https://dotnet.microsoft.com/platform/dotnet-standard - and here is one more link: https://learn.microsoft.com/en-us/dotnet/standard/net-standard. – Stein Åsmul Jul 09 '20 at 17:11
  • It's not the same runtime. https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/startup/supportedruntime-element?redirectedfrom=MSDN#remarks is what put me on track. If the element with the sku attribute is present in the configuration file and the installed .NET Framework version is lower then the specified supported version, the application fails to run and instead displays a message asking to install the supported version. This was exactly the problem. After an upgrade and reboot, installer worked as expected. – Tundebabzy Jul 09 '20 at 17:37

0 Answers0