Dear Mike and others,
 
        Thank for the help! The service installs, starts, stops and
uninstalls fine now when I use:
 
...
  <Component Id="component3" DiskId="1"
Guid="E0869B28-3FE0-4B82-8123-134EAAF7256C">
    <File Id="file3" Name="stunnel.exe" src="D:\MSI
Creation\stunnelFiles\stunnel.exe" />
    <ServiceInstall Id="serv0" Arguments='-service' Description="Service
for stunnel"
    ErrorControl="normal" Interactive="yes" Name="stunnel"
DisplayName="stunnel" Start="auto"
    Type="ownProcess" Vital="yes" />
    <ServiceControl Id="servcon0" Name="stunnel" Remove="both"
Start="install" Stop="both" />
  </Component>
...
 
But I have had to take the entry in the features list out since there is
now no direct reference to the service installation, so that the service
is always installed and there is no choice to install just the file but
not the service.
 
        Do you know of a way to separate the service installation to a
separate component so it can be referenced and optionally installed
differently to the file it uses?
 
        Thanks again for your help.
 
                    David




________________________________

        From: Mike Dimmick [mailto:[EMAIL PROTECTED] 
        Sent: Sunday, April 29, 2007 11:29 PM
        To: F. David del Campo Hill; wix-users@lists.sourceforge.net
        Subject: RE: [WiX-users] Installing/uninstalling Services
        
        

        The ServiceInstall element installs the exe which is the key
file for the component as a service. Since you haven't specified a
<File> for this component, I suspect this will do nothing. You must
place the <ServiceInstall> element in the same component which installs
the file. The Arguments are the command line options for the service
executable. I suspect that this should actually be just -service. You
should check the
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\stunnel registry
key for the correct value to use.

         

        To ensure that the service can be removed, use a
<ServiceControl> element to stop the service during uninstall, by
setting ServiceControl/@Stop to "uninstall". Consider setting the value
to "both" to ensure that the service is stopped before trying to upgrade
the file.

         

        (Should candle issue a compiler warning or error if there are no
files in a component containing a <ServiceInstall>?)

         

        -- 

        Mike Dimmick

         

        
________________________________


        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of F. David
del Campo Hill
        Sent: 29 April 2007 22:36
        To: wix-users@lists.sourceforge.net
        Subject: [WiX-users] Installing/uninstalling Services

         

        Hi All,

         

            I am using WIX 2 to repackage STunnel for Windows into a MSI
file I can use to attach to an Active Directory group policy object. I
have had no problems in creating WIX files to install the files and
shortcuts necessary for STunnel, but I am having problems in making the
MSI file install and uninstall a service.

         

            The main WXS file in the project has the following entry to
install the service:

         

        ...

          <DirectoryRef Id='TARGETDIR'>
           <Component Id="service0" DiskId="1"
Guid="AB2050E4-94C2-499B-92AA-066DBD5C33E4">
            <ServiceInstall Id="serv0" Arguments='[!file3] -service
-install -quiet'
            Description="Service for stunnel" ErrorControl="normal"
            Interactive="yes" Name="stunnel" DisplayName="stunnel"
Start="auto"
            Type="ownProcess" Vital="yes" />
           </Component>
          </DirectoryRef>
        ...

         

        file3 is the executable for stunnel.exe. 'stunnel.exe -service
-install -quiet' is the line the non-MSI STunnel service has as
executable.

        The features list has the following for choosing to install the
service:

         

        ...

          <Feature Id="service" Title="stunnel Service"
          Description="Install the stunnel service" Level="1"
InstallDefault="local"
          AllowAdvertise="no">
           <ComponentRef Id='service0' />
          </Feature>
        ...

         

            The MSI file I have created works in all respects except
that the service is not installed; not even an error message is given.
Even the presence of Vital="yes" does not stop it from working even
though the service is not installed.

         

            I have also tried to install the service using a
CustomAction:

         

        ...

          <CustomAction Id='InstallService' FileKey='file3'
ExeCommand='-install -quiet'
          Return='ignore' />

          <CustomAction Id='StartService' FileKey='file3'
ExeCommand='-start -quiet'
          Return='ignore' />

          <InstallExecuteSequence>
           <Custom Action='InstallService' After='InstallFinalize' />
           <Custom Action='StartService' After='InstallService' />
          </InstallExecuteSequence>
        ...

         

        This actually works as intended (the service is installed and
started at the end of the installation), but it has the obvious problem
that uninstalling the MSI will not stop and uninstall the service, so it
is no good (remember, this MSI is for automatic installation through a
GPO, so no user involvement is allowed).

         

            What am I doing wrong? The total lack of error messages or
failure to terminate the installation makes me believe that there is
something fundamentally wrong in the way I am trying to install the
service, but I cannot find any tutorials on how to do it properly; can
anyone help, please?

         

            Thank you for your help.

         

                       F. David del Campo Hill

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to