Passive MSI installation with immediate BizTalk deployment

Topics: Server Deployment
Jun 14, 2010 at 12:37 PM

Hi,

In our deployment process the BTDF MSI is part of another installation, so I wanted to reduce the necessary steps/clicks installing the MSI. I therefore changed the batchfile that starts the msiexec program to use the passive mode:

 

start "" msiexec.exe /i xxx-2.1.0.0.msi INSTALLDIR="xxx"  /passive /l*vx logfile.txt WIXUI_EXITDIALOGOPTIONALCHECKBOX=1

 

This basically does what I want (immediately staring installation, omit the license) but does not start the deployment. There is this checkbox at the end of the dialog and I belive its configured using the WIXUI_EXITDIALOGOPTIONALCHECKBOX variable but it simply does not start the deployment (it creates the links of course). If I omit the "passive" switch and check the checkbox the deployment starts.

Any ideas?

Eljakim

 

Coordinator
Jun 14, 2010 at 3:15 PM

Hi Eljakim,

The WIXUI_EXITDIALOGOPTIONALCHECKBOX variable just causes WiX to display the checkbox.  I have not found any way to get it checked by default, even after digging through the source code for that dialog.  Maybe I'll eventually find an answer for that..

In any case, that's why you are not seeing it start the deployment.  What happens at the end of the install when the checkbox is checked is this:

CMD.EXE /C ""Deployment\Framework\DeployTools\UacElevate.exe" "Deployment\Framework\ServerDeployWizardMSI.bat" <.btdfprojFilename>"

This runs in the context of 1) the installing user's account and 2) current working directory set to the install folder (relative paths above).

You're probably best off running that command yourself in a batch file after the MSI completes.

Thanks,
Tom

Jun 15, 2010 at 12:20 AM

I'm interesting in the same scenario, but I haven't tried it yet.  I was going to ask where you passed the QA/PROD settings xml file on your msiexec above, but then as I was thinking, that's a parm to the one of the install screens of the Deploy actually.   So can we specify that as well on Tom's response? Or at that point, the installer must manually fill in those three screens?

I have just 7 applications to deploy here, but the last place I worked, we had something like 24.  Management had asked one of their developers to develop a super-MSI to do everything, and do it in the proper order, but it never quite happened.

Thanks,
Neal

Jun 15, 2010 at 8:40 AM

I gave it another try by modifying the wxs file to explicitly call the appropriate action via the InstallExecuteSequence tag, but I get an error in the logfile:

- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2732.

These are the wxs-files I tried:

a) simply adding the custom action call:

<?xml version="1.0" encoding="utf-8"?>

<!--
    Deployment Framework for BizTalk 5.0
    Copyright (C) 2008-2010 Thomas F. Abraham and Scott Colestock
    
    This source file is subject to the Microsoft Public License (Ms-PL).
-->

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <Product UpgradeCode="$(var.ProductUpgradeCode)"
           Name="$(var.ProductName) $(var.ProjectVersion)"
           Id="$(var.ProductId)"
           Version="$(var.ProductVersion)"
           Manufacturer="$(var.Manufacturer)"
           Language="1033">

    <Package Id="*"
             Description="$(var.PackageDescription)"
             Comments="$(var.PackageComments)"
             Manufacturer="$(var.Manufacturer)"
             InstallerVersion="200"
             Languages="1033"
             Compressed="yes"/>

    <?include $(var.ContentsIncludePath) ?>

    <WixVariable Id="WixUILicenseRtf" Value="License.rtf" />
    <WixVariable Id="WixUISupportPerUser" Value="0" />

    <SetProperty Id="DEPLOYMENTDIR" Value="[INSTALLDIR]\Deployment" Sequence="execute" After="InstallInitialize"/>
    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
    <Property Id="LicenseAccepted" Value="1" />
	<Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" /> <!-- KRI -->
	
    <!-- Set up for checkbox to auto-start deploy script at end of install wizard -->
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Start deploying to BizTalk when I click Finish" />
    <Property Id="WIXUI_EXITDIALOGOPTIONALTEXT" Value="***IMPORTANT***: Application deployment IS NOT COMPLETE. The application must be deployed into BizTalk. Check the box below to begin deployment immediately, or use the link on the Start menu." />
    <CustomAction
      Id="LaunchApplication"
      ExeCommand='CMD.EXE /C ""Deployment\Framework\DeployTools\UacElevate.exe" "Deployment\Framework\ServerDeployWizardMSI.bat" $(var.ProjectFilename)"'
      Directory="INSTALLDIR" Impersonate="yes" Return="check" />

    <UI>
      <UIRef Id="WixUI_InstallDir" />

      <Publish Dialog="ExitDialog"
          Control="Finish"
          Event="DoAction"
          Value="LaunchApplication">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
    </UI>

    <InstallExecuteSequence>
         <Custom Action="LaunchApplication" Sequence='1'/>
    </InstallExecuteSequence>
	
    <Property Id='ALLUSERS' Value='1' />

    <Upgrade Id="$(var.ProductUpgradeCode)">
      <UpgradeVersion Minimum="1.0.0" Property="NEWERPRODUCTFOUND" OnlyDetect="yes" IncludeMinimum="yes" />
    </Upgrade>

    <Media Id="1" EmbedCab="yes" Cabinet="BizTalkSolution.cab" />
  </Product>
</Wix>

b) minimal version

<?xml version="1.0" encoding="utf-8"?>

<!--
    Deployment Framework for BizTalk 5.0
    Copyright (C) 2008-2010 Thomas F. Abraham and Scott Colestock
    
    This source file is subject to the Microsoft Public License (Ms-PL).
-->

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <Product UpgradeCode="$(var.ProductUpgradeCode)"
           Name="$(var.ProductName) $(var.ProjectVersion)"
           Id="$(var.ProductId)"
           Version="$(var.ProductVersion)"
           Manufacturer="$(var.Manufacturer)"
           Language="1033">

    <Package Id="*"
             Description="$(var.PackageDescription)"
             Comments="$(var.PackageComments)"
             Manufacturer="$(var.Manufacturer)"
             InstallerVersion="200"
             Languages="1033"
             Compressed="yes"/>

    <?include $(var.ContentsIncludePath) ?>

    <SetProperty Id="DEPLOYMENTDIR" Value="[INSTALLDIR]\Deployment" Sequence="execute" After="InstallInitialize"/>
	
    <!-- Set up for checkbox to auto-start deploy script at end of install wizard -->
    <CustomAction
      Id="LaunchApplication"
      ExeCommand='CMD.EXE /C ""Deployment\Framework\DeployTools\UacElevate.exe" "Deployment\Framework\ServerDeployWizardMSI.bat" $(var.ProjectFilename)"'
      Directory="INSTALLDIR" Impersonate="yes" Return="check" />
    
    <InstallExecuteSequence>
         <Custom Action="LaunchApplication" Sequence='1'/>
    </InstallExecuteSequence>
	
    <Property Id='ALLUSERS' Value='1' />

    <Upgrade Id="$(var.ProductUpgradeCode)">
      <UpgradeVersion Minimum="1.0.0" Property="NEWERPRODUCTFOUND" OnlyDetect="yes" IncludeMinimum="yes" />
    </Upgrade>

    <Media Id="1" EmbedCab="yes" Cabinet="BizTalkSolution.cab" />
  </Product>
</Wix>

Both have the same effekt.

E.

 

Coordinator
Jun 15, 2010 at 5:15 PM
Your a) version is probably close, but your sequencing is incorrect. You put Sequence="1" which is going to cause it to run at the very beginning of the install. Try replacing Sequence="1" with After="InstallFinalize". Tom
Jun 16, 2010 at 7:32 AM

Your correction works! The deployment starts right after the installation.

One problem remains though: When uninstalling the MSI the installer tries to execute the custom action again but fails to do so. Can we add a condition so that the action is only executed when installing?

thanks Eljakim

Coordinator
Jun 16, 2010 at 3:42 PM

OK, great.  The last piece then is probably to change the CustomAction to this form: <CustomAction Id="LaunchApplication" ...>NOT Installed</CustomAction>.

Thanks,
Tom

Jun 17, 2010 at 1:13 PM

Hi Tom,

you got it nearly right, cause one has to add the condition to the Custom tag. This is the final XML file that works for me. Thanks again!

<?xml version="1.0" encoding="utf-8"?>

<!--
    Deployment Framework for BizTalk 5.0
    Copyright (C) 2008-2010 Thomas F. Abraham and Scott Colestock
    
    This source file is subject to the Microsoft Public License (Ms-PL).
	
    Adaptions for passive installation by Christoph Rettinger
-->

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <Product UpgradeCode="$(var.ProductUpgradeCode)"
           Name="$(var.ProductName) $(var.ProjectVersion)"
           Id="$(var.ProductId)"
           Version="$(var.ProductVersion)"
           Manufacturer="$(var.Manufacturer)"
           Language="1033">

    <Package Id="*"
             Description="$(var.PackageDescription)"
             Comments="$(var.PackageComments)"
             Manufacturer="$(var.Manufacturer)"
             InstallerVersion="200"
             Languages="1033"
             Compressed="yes"/>

    <?include $(var.ContentsIncludePath) ?>

    <SetProperty Id="DEPLOYMENTDIR" Value="[INSTALLDIR]\Deployment" Sequence="execute" After="InstallInitialize"/>
	
    <CustomAction
      Id="LaunchApplication"
      ExeCommand='CMD.EXE /C ""Deployment\Framework\DeployTools\UacElevate.exe" "Deployment\Framework\ServerDeployWizardMSI.bat" $(var.ProjectFilename)"'
      Directory="INSTALLDIR" Impersonate="yes" Return="check"></CustomAction>

    <InstallExecuteSequence>
         <Custom Action="LaunchApplication" After="InstallFinalize">NOT Installed</Custom>
    </InstallExecuteSequence>
	
    <Property Id='ALLUSERS' Value='1' />

    <Upgrade Id="$(var.ProductUpgradeCode)">
      <UpgradeVersion Minimum="1.0.0" Property="NEWERPRODUCTFOUND" OnlyDetect="yes" IncludeMinimum="yes" />
    </Upgrade>

    <Media Id="1" EmbedCab="yes" Cabinet="BizTalkSolution.cab" />
  </Product>
</Wix>