This post is a little long, but hopefully it provides enough information to 
provide some insight into what the
problem is that I am having, and when a solution or directions are provided, it 
will provide enough context to
help others who may have the same requirement later.

I have been struggling with this for more than a day now.  I need to pass some 
of the parameters received on the command line
of the installer to a MergeModule (all in Wix).  It is a Merge Module because 
it will be provided to a customer to embed in
their installers as well.

Basically The Merge Module consists of a service, as follows (Pruned):

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";
      xmlns:util="http://schemas.microsoft.com/wix/UtilExtension";>

  <Module Id="MM.WindowService" Language="1033" Version="1.0.0.0">
    <Package Id="GUID2" InstallerVersion="200"  Manufacturer=" " />

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="MergeRedirectFolder">
        <Component Id='component_WindowsService' Guid="GUID1" DiskId='1'>

          <!-- Install the service -->
          <ServiceInstall
            Id='ServiceInstaller'   Type='ownProcess'   Vital="yes"  
Name="XPedientServiceHost"  DisplayName="XPedient Services Host"
            Description="XPedient Services Host"  Start="auto"
            Account="[ServiceUser]"
            Password="[ServicePassword]"
            ErrorControl="normal" Interactive="no" >
            <ServiceDependency Id="Eventlog" />
            <util:ServiceConfig FirstFailureActionType="restart" 
SecondFailureActionType="restart" ThirdFailureActionType="restart"/>
          </ServiceInstall>
        </Component>
      </Directory>
    </Directory>

    <Property Id="SERVICEUSER" Value=""/>
    <Property Id="SERVICEPASSWORD" Value="" />

    <Property Id="ServiceUser" Value="administrator"/>
    <Property Id="ServicePassword" Value="password" />

    <CustomAction Id='SetServiceUser' Property='ServiceUser' 
Value='[SERVICEUSER]' />
    <CustomAction Id='SetServicePassword' Property='ServicePassword' 
Value='[SERVICEPASSWORD]' />

    <InstallExecuteSequence>
      <Custom Action='SetServiceUser' After='LaunchConditions'></Custom>
      <Custom Action='SetServicePassword' After='LaunchConditions'></Custom>
    </InstallExecuteSequence>

  </Module>
</Wix>



I have tried it with and without the custom action and additional properties.  
I just cannot seem to figure out how to
get the information passed into the merge module; all of the googling I did 
indicated that others had tried, but I was
not able to find any further hints than what I have included within this 
request for help.  I did see that Rob had answered
a similiar problem quite sometime ago but I did not understand his reply about 
using .Module/@Property, and have not been
able to find any sort of information as to how that would work either.

The Product Module looks like this:



<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"; 
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension";>

  <Product Id="GUID3" Name=" " Language="1033" Version="1.4.3.0" 
UpgradeCode="GUID4" Manufacturer=" ">
    <Package Id="*" InstallerVersion="200" Compressed="yes" Keywords=" " 
Description="" />
    <Media Id="1" Cabinet="WindowsService.cab" EmbedCab="yes" DiskPrompt=" 
Installation Media"/>
    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Directory Id='ProgramFilesFolder' Name='PFiles'>
        <Directory Id="XT" Name="XT">

              <!-- WindowsService -->
              <Directory Id="WINDOWSSERVICE" Name="WindowsService">

                <Merge Id='mm.xpj.winservice' Language='1033' 
SourceFile='WindowsService.msm' DiskId='1'>
                  <ConfigurationData Name='SERVICEUSER' 
Value='[XPJDOMAIN]\[XPJUSER]'/>
                  <ConfigurationData Name='SERVICEPASSWORD' 
Value='[XPJPASSWORD]'/>
                </Merge>

<<<< SNIPPED >>>>>

    <!--
    **************************************************************
       Command Line Parameters, and Actions to Retrieve and User them
    **************************************************************
    -->

    <!-- Command Line Parameters (and their defaults -->
    <Property Id="XPJDOMAIN" Value="XPTDomain" />
    <Property Id="XPJUSER" Value="XPTUser" />
    <Property Id="XPJPASSWORD" Value="XPTPassword" />

    <!-- Custom Actions used to set the Command Line Parameters to the 
properties used for installation -->
    <CustomAction Id='SetPermissionableUser' Property='PermissionableUser' 
Value='[XPJDOMAIN]\[XPJUSER]' />

    <!--
    **************************************************************
       Install/Uninstall Actions
    **************************************************************
    -->

    <!-- Install/Uninstall Actions -->
    <InstallExecuteSequence>
      <Custom Action='SetPermissionableUser' After='LaunchConditions'></Custom>
      <RemoveExistingProducts After="InstallFinalize"></RemoveExistingProducts>
    </InstallExecuteSequence>

  </Product>
</Wix>

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to