Thank you for the help Blair/Wendell. Both were very well articulated answers
and it worked a treat. I do get a couple of ICE30 errors however:

 'The target file '[InstalledFile]' might be installed in [Program Folder]
by two different conditionalized components on an LFN system. If the
conditions are not mutually exclusive, this will break the component
reference counting system. 

I take it this is just a normal side effect of what we are doing?

I can see your point Phil and it has made me reconsider including this
option. Originally I wanted to put it in for the following reason. If the
service fails to start for some reason (e.g. wrong user credentials), the
whole installation is rolled back. I thought it would be better to allow the
user to get the service installed, then resolve any issues manually.
Thinking about this, if the service fails to start this is definitely a
valid reason to fail the whole installation as it is kind of pointless in
install a service that isn't going to start.

Thanks for all your help guys.


Wilson, Phil wrote:
> 
> This the kind of thing that depends on your customers. Sometimes too much
> choice is a bad thing. If I installed a new product and it said "do you
> want to start some service?" my reaction would be "how the hell would I
> know and why should I care?"  Just start the darn thing! It's potentially
> up there with things like wanting to give the installing user multiple
> browse dialogs, one for the application folder, another for some database,
> another for some other files, etc etc.  I'm on a soapbox here, but when
> people wonder why installation can be so complicated the short answer is
> that sometimes we go out of our way to make them that way. 
> 
> Phil Wilson 
> 
> 
> 
> -----Original Message-----
> From: Wendell Joost [mailto:wende...@gmail.com] 
> Sent: Thursday, September 17, 2009 11:02 AM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Start service based on user choice.
> 
> +1 to what Blair said (far more articulately than I.)
> 
> Wendell
> 
> On Thu, Sep 17, 2009 at 10:57 AM, Blair <os...@live.com> wrote:
>> If you only will ever have one service you could try conditioning the
>> StartServices action (based on the property you set in the UI) but you
>> will
>> need to ensure that it does the right thing with upgrades, with no UI
>> (how
>> do you want to default this?), with repairs, and with uninstalls (there
>> shouldn't be anything that starts on uninstall, should there?). Action
>> conditions (not based on platform) have been proven to often not be right
>> in
>> all circumstances, and are hard to get right, so they are often
>> discouraged.
>>
>> Further, if you might ever have more than one service you will not be
>> able
>> to distinguish them because the one action covers all components in the
>> entire MSI, so it doesn't scale well. You really need per-service
>> control.
>>
>> You could try separating your two ServiceControl elements in separate
>> components, each of which is conditioned oppositely.
>>
>> <Component Id='TyrellForwarderService' Guid='*'>
>> <File ...>
>> <ServiceInstall ...>
>> <ServiceControl Id='TyrellForwarderServiceNoStart' Name='Tyrell
>> Forwarder'
>> Stop='both' Remove='uninstall' Wait='yes'/>
>> </Component>
>>
>> <Component Id='TyrellForwarderServiceStart' Guid='PLACE-GUID-HERE'>
>> <Condition>INSTALLSERVICE = 1</Condition>
>> <ServiceControl Id='TyrellForwarderServiceStart' Name='Tyrell Forwarder'
>> Start='install' Wait='yes'/>
>> </Component>
>>
>> If you wish to use the UI during minor upgrades/patches (and/or otherwise
>> use the property to change your initial setting) you will need to make
>> the
>> TyrellForwarderServiceStart component Transitive. You should test whether
>> you need to add some other keypath to that component as well, so it
>> doesn't
>> get ignored during upgrades/patches (since installer may think that it is
>> already up-to-date).
>>
>> This builds, but I haven't tested it yet.
>>
>> -Blair
>>
>> -----Original Message-----
>> From: Lewis99 [mailto:andrewhawke...@gmail.com]
>> Sent: Thursday, September 17, 2009 9:08 AM
>> To: wix-users@lists.sourceforge.net
>> Subject: [WiX-users] Start service based on user choice.
>>
>>
>> Can someone tell me the best way to conditionally determine whether a
>> service
>> is started based on user input. I have added a checkbox 'Start Service'
>> to
>> the VerifyReadyDialog and want to use that selection to condition whether
>> the service is started or not.
>>
>> My ServiceControl element looks like this
>> <ServiceControl Id='TyrellForwarderService' Name='Tyrell Forwarder'
>> Start='install' Stop='both' Remove='uninstall' Wait='yes'/>
>>
>> The start property only has enum values of install/uninstall/both so I
>> don't
>> see how I can use a property value here as it won't be recognised as a
>> valid
>> value. As you will know removing the start property stops the service
>> from
>> starting. So somehow I need to be able to condition the removal of the
>> start
>> property.
>>
>> Also, if I manually edit the MSI and add a condition to the StartServices
>> InstallExecuteSequence row of And INSTALLSERVICE = 1 it works.
>>
>> So the question is - what is the best way to achieve this. Can I define
>> two
>> ServiceControl elements with different ID's and pick one at runtime
>> somehow?
>> Alternatively how do I set a condition on an InstallExecuteSequence row
>> via
>> WIX? Any advice on the best way to achieve this would be greatly
>> appreciated. I am trying to get my head around both WIX and MSI's in
>> general
>> so I may be taking the wrong approach completely.
>>
>> Thanks
>> --
>> View this message in context:
>> http://n2.nabble.com/Start-service-based-on-user-choice-tp3664066p3664066.ht
>> ml
>> Sent from the wix-users mailing list archive at Nabble.com.
>>
>> ----------------------------------------------------------------------------
>> --
>> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9&#45;12, 2009. Register
>> now&#33;
>> http://p.sf.net/sfu/devconf
>> _______________________________________________
>> WiX-users mailing list
>> WiX-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9&#45;12, 2009. Register
>> now&#33;
>> http://p.sf.net/sfu/devconf
>> _______________________________________________
>> WiX-users mailing list
>> WiX-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/wix-users
>>
> 
> 
> 
> -- 
> "Some people come visit Europe and are really let down when they find
> out it's not like a credit-card commercial; others really get into
> meeting all the quirky people and careening along narrow mountain
> roads in rickety cabs driven by suicidal, gap-toothed Carpathians. I
> guess it's pretty obvious which one you are..." - Justin Crevier, May
> '01
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9&#45;12, 2009. Register
> now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
> 
> 
> 
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9&#45;12, 2009. Register
> now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Start-service-based-on-user-choice-tp3664066p3668081.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to