​​
​Hi,
 I have created an installer that is supposed to be get install and start
the service. The installer does install in most machines , but during
installation in one of customers, it gave "Error 1920. Service
'SomeService'failed to start" error. The user has installed the software as
an administrator, but still is getting the same error.
The detailed error is "MSI (s) (6C:18) [14:07:48:771]: Product:
SomeProduct-- Error 1920. Service 'SomeService' (SomeService) failed to
start.  Verify that you have sufficient privileges to start system
services."

I have also implemented Custom action in the installer using C# that is
supposed to get the parameter passed to installer and create some config
file.

I have following wix file:

####################################################
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";
     xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension";>
  <Product Id="*" Name="MyProduct" Language="1033" Version="3.0.0"
Manufacturer="Sarvagya" UpgradeCode="50AB9D2F-93A4-4301-B418-4CB31668DC5A">
    <Package InstallerVersion="200" Compressed="yes"
InstallScope="perMachine" />

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

    <Feature Id="ProductFeature" Title="MyProduct" Level="1">
      <ComponentGroupRef Id="ProductComponents" />
    </Feature>
    <PropertyRef Id="NETFRAMEWORK40FULL"/>
    <Condition Message="The application requires .NET Framework 4 or later.
Please Install .NET Framework and try again.">
      <![CDATA[Installed OR NETFRAMEWORK40FULL]]>
    </Condition>
  </Product>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="WindowsVolume">
        <Directory Id="INSTALLFOLDER" Name="HelloWix" />
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">

      <Component Id="ProductComponent">
        <File
          Id="SOMEFILE"
          Name="somefile.exe"
          DiskId="1"
          Source="$(var.lpa.TargetPath)"
          Vital="yes"
          KeyPath="yes" />

        <?if $(var.Configuration) = "Release"?>
        <ServiceInstall Id="ServiceInstaller" Type="ownProcess" Vital="yes"
            Name="SomeService" DisplayName="SomeService"
            Description="This is the service to be started" Start="auto"
            Account="LocalSystem" ErrorControl="normal" Interactive="no" />

        <ServiceControl Id="StartService" Start="install" Stop="both"
Remove="uninstall"
            Name="SomeService" Wait="yes" />
        <?endif?>
      </Component>

      <Component Id="BoostThreadLibrary">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_thread-vc100-mt-gd-1_55.dll" />
        <?else?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_thread-vc100-mt-1_55.dll" />
        <?endif?>
      </Component>
      <Component Id="BoostSystemLibrary">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_system-vc100-mt-gd-1_55.dll" />
        <?else?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_system-vc100-mt-1_55.dll" />
        <?endif?>
      </Component>
      <Component Id="BoostChronoLibrary">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_chrono-vc100-mt-gd-1_55.dll" />
        <?else?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_chrono-vc100-mt-1_55.dll" />
        <?endif?>
      </Component>
      <!--<Component Id="BoostLogLibrary">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_log-vc100-mt-gd-1_55.dll" />
        <?else?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_log-vc100-mt-1_55.dll" />
        <?endif?>
      </Component>-->
      <Component Id="BoostFileSystemLibrary">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_filesystem-vc100-mt-gd-1_55.dll" />
        <?else?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_filesystem-vc100-mt-1_55.dll" />
        <?endif?>
      </Component>
      <Component Id="BoostDateTimeLibrary">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_date_time-vc100-mt-gd-1_55.dll" />
        <?else?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_date_time-vc100-mt-1_55.dll" />
        <?endif?>
      </Component>

      <Component Id="BoostZlibLibrary">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_zlib-vc100-mt-gd-1_55.dll" />
        <?else?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_zlib-vc100-mt-1_55.dll" />
        <?endif?>
      </Component>
      <Component Id="BoostIOStreamLibrary">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_iostreams-vc100-mt-gd-1_55.dll" />
        <?else?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_iostreams-vc100-mt-1_55.dll" />
        <?endif?>
      </Component>
      <Component Id="BoostRegexLibrary">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_regex-vc100-mt-gd-1_55.dll" />
        <?else?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_regex-vc100-mt-1_55.dll" />
        <?endif?>
      </Component>
      <Component Id="BoostLocaleLibrary">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_locale-vc100-mt-gd-1_55.dll" />
        <?else?>
        <File Source
="C:\boost_1_55_0_dyn\stage\lib\boost_locale-vc100-mt-1_55.dll" />
        <?endif?>
      </Component>
      <Component Id="libeay32">
        <File Source ="C:\OpenSSL-Win32\libeay32.dll" />
      </Component>
      <Component Id="ssleay32">
        <File Source ="C:\OpenSSL-Win32\ssleay32.dll" />
      </Component>
      <Component Id="czmq">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="..\..\ext_library\zmq\czmq\czmq-2.1.0\lib\Win32\DebugDLL\czmq.dll" />
        <?else?>
        <File Source
="..\..\ext_library\zmq\czmq\czmq-2.1.0\lib\Win32\ReleaseDLL\czmq.dll" />
        <?endif?>
      </Component>

      <Component Id="log4cplus">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="..\..\ext_library\log4cplus\bin\Debug\log4cplusD.dll" />
        <?else?>
        <File Source
="..\..\ext_library\log4cplus\bin\Release\log4cplus.dll" />
        <?endif?>
      </Component>
      <Component Id="libzmq">
        <?if $(var.Configuration) = "Debug"?>
        <File Source
="..\..\ext_library\zmq\zeromq-4.0.3\lib\Win32\Debug\libzmq.dll" />
        <?else?>
        <File Source
="..\..\ext_library\zmq\zeromq-4.0.3\lib\Win32\Release\libzmq.dll" />
        <?endif?>
      </Component>
      <!--<Component Id="LpaConfig">
        <File Source ="..\..\src\lpa\config\lpa.config" />
      </Component>-->
      <Component Id="SSL_Crt_File">
        <File Source ="..\..\src\keys\ca.crt" />
      </Component>

      <Component Id="RemovingResidues"
Guid="{0524716A-DA7B-436C-BB0B-57B972D1A322}">
        <CreateFolder />
        <RemoveFile Id="ConfigRemove" Name="lpa.config" On="uninstall"/>
        <!--<RemoveFile Id="LogsRemove" Name="*.log" On="uninstall"/>-->
        <RemoveFile Id="ProductCodeRemove" Name="productcode.txt"
On="uninstall"/>
        <RemoveFile Id="FSCChecksumRemove" Name="checksum.json"
On="uninstall"/>
        <RemoveFile Id="ConfigBackupRemove" Name="config_backup.bak"
On="uninstall"/>
        <RemoveFile Id="DBRemove" Name="lpa.db" On="uninstall"/>
      </Component>
    </ComponentGroup>


    <Binary Id="SetupCA"
SourceFile="..\..\ext_library\SetupCA\SetupCA\bin\Release\SetupCA.CA.dll"/>
    <CustomAction Id="WRITEFILETODISK" Execute="immediate"
BinaryKey="SetupCA" DllEntry="WriteFileToDisk" />
    <CustomAction Id="ResidueRemove" Execute="immediate"
BinaryKey="SetupCA" DllEntry="DeleteResidue" />
    <InstallExecuteSequence>
      <Custom Action="WRITEFILETODISK" Before="InstallFinalize">NOT
Installed</Custom>
      <Custom Action="ResidueRemove"
After="InstallFinalize">Installed</Custom>
    </InstallExecuteSequence>
  </Fragment>
</Wix>
#############################################
The dependency of my program is .Net4.0, VS2010 Redistributable, VS2008
Redistributable. The Customer has installed all of these and run the file
as adminstrator as:
msiexec /i myInstaller.msi /l*v out.txt PARAMETER="VALUE" ...

I looked into other website, they gave information regarding GAC. I don't
know about them. If that is what is causing the problem, please do point me
in right direction.
Thanks,
Sarvagya Pant.

-- 
sarvagya
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to