Do not change the service start type on upgrade

6 messages Options
Embed this post
Permalink
Saurabh-5

Do not change the service start type on upgrade

Reply Threaded More More options
Print post
Permalink

Hello,

I am quite new to wix and stuck with an issue.

I have a windows service which is installed as a part of an MSI , the service start being set to manual. The users can change this to automatic after installation.

Now if we install an update, the service is deleted and re-installed and the service start is set to manual again. I would like to have a way in which the service start type should not change if the user has set it to automatic when an upgrade msi is being installed.


I tried :

 Get the current service start type
<Property Id='SERVICE_STATUS'>
     <RegistrySearch Id='ServiceStatus' Type='raw' Root='HKLM' Key='SYSTEM\Current Control Set\Services\My Service' Name='Start' />      
    </Property>

=====
Based on the Property tried suppressing the installservices and deleteservices elements in the InstallExecuete table
 <DeleteServices Suppress="yes" >SERVICE_STATUS </DeleteServices>
 <InstallServices Suppress="yes" >SERVICE_STATUS<InstallServices >

This did not work.

====
Then I tried to create two different component elements:

<Component Id="My_Service" Guid="67B3D72D-0CB9-41BA-B76A-ADEF1DF87745" DiskId="1">
                <!-- If the service is installed and set to automatic -->
                <Condition><![CDATA[SERVICE_STATUS AND (SERVICE_STATUS = "#2")]]></Condition>
<Serviceinstall ... Start="auto"...
<File...
<servicecontrol...

and

              <Component Id="My_Service1" Guid="A50691F0-5C0F-49d5-AA27-9C5280278459" DiskId="1">
                <!--If the service is not installed or not set to automatic and installed-->
                <Condition><![CDATA[(NOT SERVICE_STATUS) OR (SERVICE_STATUS <> "#2")]]></Condition>
                <ServiceInstall Start="demand"...
                <File...
                <servicecontrol...

In this case service does not install when I upgrade from older version of MSI
=======

Any other ways in which i tried setting a property and using it as a value in the start attribute of serviceinstall element failed as it did not support properties.

Could anyone point me to the correct way of doing this?

Thanks



     

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Yan Sklyarenko

Re: Do not change the service start type on upgrade

Reply Threaded More More options
Print post
Permalink
Can you try setting the Component's attribute NeverOverwrite to 'yes'?
Didn't try it myself, though...

-- Yan


-----Original Message-----
From: Saurabh [mailto:[hidden email]]
Sent: Wednesday, July 08, 2009 9:18 AM
To: [hidden email]
Subject: [WiX-users] Do not change the service start type on upgrade


Hello,

I am quite new to wix and stuck with an issue.

I have a windows service which is installed as a part of an MSI , the
service start being set to manual. The users can change this to
automatic after installation.

Now if we install an update, the service is deleted and re-installed and
the service start is set to manual again. I would like to have a way in
which the service start type should not change if the user has set it to
automatic when an upgrade msi is being installed.


I tried :

 Get the current service start type
<Property Id='SERVICE_STATUS'>
     <RegistrySearch Id='ServiceStatus' Type='raw' Root='HKLM'
Key='SYSTEM\Current Control Set\Services\My Service' Name='Start' />

    </Property>

=====
Based on the Property tried suppressing the installservices and
deleteservices elements in the InstallExecuete table
 <DeleteServices Suppress="yes" >SERVICE_STATUS </DeleteServices>
 <InstallServices Suppress="yes" >SERVICE_STATUS<InstallServices >

This did not work.

====
Then I tried to create two different component elements:

<Component Id="My_Service" Guid="67B3D72D-0CB9-41BA-B76A-ADEF1DF87745"
DiskId="1">
                <!-- If the service is installed and set to automatic
-->
                <Condition><![CDATA[SERVICE_STATUS AND (SERVICE_STATUS =
"#2")]]></Condition>
<Serviceinstall ... Start="auto"...
<File...
<servicecontrol...

and

              <Component Id="My_Service1"
Guid="A50691F0-5C0F-49d5-AA27-9C5280278459" DiskId="1">
                <!--If the service is not installed or not set to
automatic and installed-->
                <Condition><![CDATA[(NOT SERVICE_STATUS) OR
(SERVICE_STATUS <> "#2")]]></Condition>
                <ServiceInstall Start="demand"...
                <File...
                <servicecontrol...

In this case service does not install when I upgrade from older version
of MSI
=======

Any other ways in which i tried setting a property and using it as a
value in the start attribute of serviceinstall element failed as it did
not support properties.

Could anyone point me to the correct way of doing this?

Thanks



     

------------------------------------------------------------------------
------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,

vendors submitting new applications to BlackBerry App World(TM) will
have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Bob Arnson-6

Re: Do not change the service start type on upgrade

Reply Threaded More More options
Print post
Permalink
In reply to this post by Saurabh-5
Saurabh wrote:
> Now if we install an update, the service is deleted and re-installed and the service start is set to manual again. I would like to have a way in which the service start type should not change if the user has set it to automatic when an upgrade msi is being installed.
>  

If you use a major upgrade, the only way to prevent the service from
being removed is to use a late scheduling of RemoveExistingProducts,
either just before or just after InstallFinalize. Note that that
scheduling requires adherence to the component rules. See
http://www.joyofsetup.com/2008/12/30/paying-for-upgrades/ for more details.

--
sig://boB
http://joyofsetup.com/



------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Saurabh-5

Re: Do not change the service start type on upgrade

Reply Threaded More More options
Print post
Permalink
In reply to this post by Saurabh-5

Yan,

I would like to overwrite the files, but keep the service start type same after installation as it was before.

--Saurabh

--- On Tue, 7/7/09, Yan Sklyarenko <[hidden email]> wrote:

> From: Yan Sklyarenko <[hidden email]>
> Subject: Re: [WiX-users] Do not change the service start type on upgrade
> To: "General discussion for Windows Installer XML toolset." <[hidden email]>
> Date: Tuesday, July 7, 2009, 11:38 PM
> Can you try setting the Component's
> attribute NeverOverwrite to 'yes'?
> Didn't try it myself, though...
>
> -- Yan
>
>
> -----Original Message-----
> From: Saurabh [mailto:[hidden email]]
> Sent: Wednesday, July 08, 2009 9:18 AM
> To: [hidden email]
> Subject: [WiX-users] Do not change the service start type
> on upgrade
>
>
> Hello,
>
> I am quite new to wix and stuck with an issue.
>
> I have a windows service which is installed as a part of an
> MSI , the
> service start being set to manual. The users can change
> this to
> automatic after installation.
>
> Now if we install an update, the service is deleted and
> re-installed and
> the service start is set to manual again. I would like to
> have a way in
> which the service start type should not change if the user
> has set it to
> automatic when an upgrade msi is being installed.
>
>
> I tried :
>
>  Get the current service start type
> <Property Id='SERVICE_STATUS'>
>      <RegistrySearch
> Id='ServiceStatus' Type='raw' Root='HKLM'
> Key='SYSTEM\Current Control Set\Services\My Service'
> Name='Start' />
>
>     </Property>
>
> =====
> Based on the Property tried suppressing the installservices
> and
> deleteservices elements in the InstallExecuete table
>  <DeleteServices Suppress="yes" >SERVICE_STATUS
> </DeleteServices>
>  <InstallServices Suppress="yes"
> >SERVICE_STATUS<InstallServices >
>
> This did not work.
>
> ====
> Then I tried to create two different component elements:
>
> <Component Id="My_Service"
> Guid="67B3D72D-0CB9-41BA-B76A-ADEF1DF87745"
> DiskId="1">
>                
> <!-- If the service is installed and set to automatic
> -->
>                
> <Condition><![CDATA[SERVICE_STATUS AND
> (SERVICE_STATUS =
> "#2")]]></Condition>
> <Serviceinstall ... Start="auto"...
> <File...
> <servicecontrol...
>
> and
>
>              
> <Component Id="My_Service1"
> Guid="A50691F0-5C0F-49d5-AA27-9C5280278459" DiskId="1">
>                
> <!--If the service is not installed or not set to
> automatic and installed-->
>                
> <Condition><![CDATA[(NOT SERVICE_STATUS) OR
> (SERVICE_STATUS <> "#2")]]></Condition>
>                
> <ServiceInstall Start="demand"...
>                
> <File...
>                
> <servicecontrol...
>
> In this case service does not install when I upgrade from
> older version
> of MSI
> =======
>
> Any other ways in which i tried setting a property and
> using it as a
> value in the start attribute of serviceinstall element
> failed as it did
> not support properties.
>
> Could anyone point me to the correct way of doing this?
>
> Thanks
>
>
>
>      
>
> ------------------------------------------------------------------------
> ------
> Enter the BlackBerry Developer Challenge 
> This is your chance to win up to $100,000 in prizes! For a
> limited time,
>
> vendors submitting new applications to BlackBerry App
> World(TM) will
> have
> the opportunity to enter the BlackBerry Developer
> Challenge. See full
> prize 
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge 
> This is your chance to win up to $100,000 in prizes! For a
> limited time,
> vendors submitting new applications to BlackBerry App
> World(TM) will have
> the opportunity to enter the BlackBerry Developer
> Challenge. See full prize 
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>


     

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Saurabh-5

Re: Do not change the service start type on upgrade

Reply Threaded More More options
Print post
Permalink
In reply to this post by Saurabh-5

Bob,

That i what we are doing in the wix (I checked after your reply)
<RemoveExistingProducts After="InstallFinalize"/>

Also I do not mind if we delete the service as long as we can save the start type before deleting and then set the start type to the same during serviceinstall.

--Saurabh

--- On Wed, 7/8/09, Bob Arnson <[hidden email]> wrote:

> From: Bob Arnson <[hidden email]>
> Subject: Re: [WiX-users] Do not change the service start type on upgrade
> To: "General discussion for Windows Installer XML toolset." <[hidden email]>
> Date: Wednesday, July 8, 2009, 4:55 AM
> Saurabh wrote:
> > Now if we install an update, the service is deleted
> and re-installed and the service start is set to manual
> again. I would like to have a way in which the service start
> type should not change if the user has set it to automatic
> when an upgrade msi is being installed.
> >   
>
> If you use a major upgrade, the only way to prevent the
> service from
> being removed is to use a late scheduling of
> RemoveExistingProducts,
> either just before or just after InstallFinalize. Note that
> that
> scheduling requires adherence to the component rules. See
> http://www.joyofsetup.com/2008/12/30/paying-for-upgrades/
> for more details.
>
> --
> sig://boB
> http://joyofsetup.com/
>
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge 
> This is your chance to win up to $100,000 in prizes! For a
> limited time,
> vendors submitting new applications to BlackBerry App
> World(TM) will have
> the opportunity to enter the BlackBerry Developer
> Challenge. See full prize 
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> WiX-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/wix-users
>


     

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users
Bob Arnson-6

Re: Do not change the service start type on upgrade

Reply Threaded More More options
Print post
Permalink
Saurabh wrote:
> Also I do not mind if we delete the service as long as we can save the start type before deleting and then set the start type to the same during serviceinstall.
>  

MSI  doesn't support that; it will install the service with the start
type defined in the ServiceInstall table.

--
sig://boB
http://joyofsetup.com/



------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
WiX-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/wix-users