Because the condition is not re-evaluated once it is installed unless the 
component is marked Transitive.

I would recommend avoiding marking it Transitive and saving and restoring the 
properties necessary for that component to work.  In my experience, that is 
best practice.

--
John Merryweather Cooper
Build & Install Engineer - ESA
Jack Henry & Associates, Inc.®
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
jocoo...@jackhenry.com
www.jackhenry.com 




-----Original Message-----
From: George Fleming [mailto:gef...@microsoft.com] 
Sent: Tuesday, June 18, 2013 1:51 PM
To: WiX-users@lists.sourceforge.net
Subject: [WiX-users] How to skip components during patching

I have following component that I only want to execute during a new install.  
When I do a patch (msp file), I don't want to run this code, since I don't have 
a valid default [SERVICEACCOUNT] value.  Still, the code executes and I get a 
failure at ServiceInstall.  Why isn't my <Condition> working?

     <Component Id='MyService' Win64="$(var.Win64)" 
Guid='{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx}' >
        <Condition><![CDATA[NOT (REMOVE="ALL") AND NOT Installed AND NOT 
REINSTALLMODE AND NOT REINSTALL]]></Condition>
        <util:User Id='ServiceUser' Name='[SERVICEACCOUNT]' 
Password='[SERVICEPASSWORD]' CreateUser='no' LogonAsService='yes'/>
        <File Id="File_MyService.exe" Name="$(var.MyService.exe)" KeyPath="yes" 
Source="$(var.Dir)\$(var.MyService.exe)" />
        <ServiceInstall Id='xxxxx'
                        Name='$(var.ServiceName)'
                        DisplayName='My Service'
                        Type='ownProcess'
                        Start='auto'
                        ErrorControl='normal'
                        Description='My Service'
                        Account='[SERVICEACCOUNT]'
                        Password='[SERVICEPASSWORD]'
                        Vital='yes'>
          <util:ServiceConfig FirstFailureActionType='restart' 
SecondFailureActionType='restart' ThirdFailureActionType='none' 
RestartServiceDelayInSeconds='10'
                              ResetPeriodInDays='1'/>
        </ServiceInstall>
        <ServiceControl Id="StartService" Stop="both" Remove="uninstall" 
Name="$(var.ServiceName)" Wait="yes" />
      </Component>

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are 
intended
exclusively for the individual or entity to which it is addressed. The message, 
together with any attachment, may contain confidential and/or privileged 
information.
Any unauthorized review, use, printing, saving, copying, disclosure or 
distribution 
is strictly prohibited. If you have received this message in error, please 
immediately advise the sender by reply email and delete all copies.


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to