Phil, as you suggested i have written the information in both the tables Service Control and Service Install. It works fine.
Now my question is i had to copy some files for installing the service in the target manchine. So i want to avoid this when i do the installation second time, or adding a patch, When i install second time, my msi file should check if service is already installed in the machine, if yes, it should not copy the files and also it should not install the service.
One thing i want to do is i want to remove the values what i have entered in service control table because service get uninstalled when my new patch or version in installed.
If i do this directly from the Custom Action UI and using the property NOT PREVIOUSVERSIONSINSTALLED it did not work
1) You can't install the same setup a second time, so you're talking about some kind of upgrade. If it's a major upgrade, then that's an uninstall and an install, so generally speaking you do want to uninstall the service.
2) For a patch you can condition the way you're installing the service with a condition such as NOT PATCH. So the InstallServices and DeleteServices standard actions can be conditioned on NOT PATCH if you're using the ServiceInstall/Control tables.
3) You're referring to PREVIOUSVERSIONSINSTALLED, so that probably means you're doing a major upgrade, so a patching scenario won't apply.
Generally speaking, if you're using the ServiceControl and ServiceInstall tables to install services then you don't need Visual Studio custom actions or any conditions at all, and RemovePreviousVersions should just work.
> Phil, as you suggested i have written the information in both the tables > Service Control and Service Install. It works fine.
> Now my question is i had to copy some files for installing the service in > the target manchine. So i want to avoid this when i do the installation > second time, or adding a patch, When i install second time, my msi file > should check if service is already installed in the machine, if yes, it > should not copy the files and also it should not install the service.
> One thing i want to do is i want to remove the values what i have entered > in > service control table because service get uninstalled when my new patch or > version in installed.
> If i do this directly from the Custom Action UI and using the property NOT > PREVIOUSVERSIONSINSTALLED it did not work
For a patch you can condition the way you're installing the service with a condition such as NOT PATCH. So the InstallServices and DeleteServices standard actions can be conditioned on NOT PATCH if you're using the ServiceInstall/Control tables
I would prefer this answer. But here you are saying it applies only for a patch. In my case there is no concept of patches. I mean here when we are chaning to a new version there would be some few set of files which are changed.
In my case when the user installs for the first time also it should check whether the service is already installed ( Because this is a third party service which would have already been installed by the user and he might have done some changes to the configuration also, So i dont want to copy the files again ( files which are related to service, I can do this keeping a condition in Launch Conditions or makiing it is permanent) and also i dont want to install the service again). How to check this condition in the Service Install table? And this process follows for every install.
Thanks for you help and suggestions. It is quite useful for all the developers.
"Wilson, Phil" wrote: > There are some complications here.
> 1) You can't install the same setup a second time, so you're talking about > some kind of upgrade. If it's a major upgrade, then that's an uninstall and > an install, so generally speaking you do want to uninstall the service.
> 2) For a patch you can condition the way you're installing the service with > a condition such as NOT PATCH. So the InstallServices and DeleteServices > standard actions can be conditioned on NOT PATCH if you're using the > ServiceInstall/Control tables.
> 3) You're referring to PREVIOUSVERSIONSINSTALLED, so that probably means > you're doing a major upgrade, so a patching scenario won't apply.
> Generally speaking, if you're using the ServiceControl and ServiceInstall > tables to install services then you don't need Visual Studio custom actions > or any conditions at all, and RemovePreviousVersions should just work.
> > Phil, as you suggested i have written the information in both the tables > > Service Control and Service Install. It works fine.
> > Now my question is i had to copy some files for installing the service in > > the target manchine. So i want to avoid this when i do the installation > > second time, or adding a patch, When i install second time, my msi file > > should check if service is already installed in the machine, if yes, it > > should not copy the files and also it should not install the service.
> > One thing i want to do is i want to remove the values what i have entered > > in > > service control table because service get uninstalled when my new patch or > > version in installed.
> > If i do this directly from the Custom Action UI and using the property NOT > > PREVIOUSVERSIONSINSTALLED it did not work
I only mentioned patching because you used the word in your original post.
It doesn't seem to me that there is anything much here that MSI can do for you. Basically you need a custom action to check if a service is already installed or not (or maybe a registry search for the service entry). Then you need a condition on the service executable and on the service install that they won't get get installed if the service already exists.
I don't know you got to the point where you are (or might be) installing a 3rd party service. If they allow you to redistribute and install that service also, then they should supply a merge module that you (and everyone else) can use to install the service if necessary, and do the right thing with configuration etc. -- Phil Wilson The Definitive Guide to Windows Installer http://www.apress.com/book/view/1590592972
"Amar" <A...@discussions.microsoft.com> wrote in message
> For a patch you can condition the way you're installing the service with > a condition such as NOT PATCH. So the InstallServices and DeleteServices > standard actions can be conditioned on NOT PATCH if you're using the > ServiceInstall/Control tables
> I would prefer this answer. But here you are saying it applies only for a > patch. In my case there is no concept of patches. I mean here when we are > chaning to a new version there would be some few set of files which are > changed.
> In my case when the user installs for the first time also it should check > whether the service is already installed ( Because this is a third party > service which would have already been installed by the user and he might > have > done some changes to the configuration also, So i dont want to copy the > files > again ( files which are related to service, I can do this keeping a > condition > in Launch Conditions or makiing it is permanent) and also i dont want to > install the service again). How to check this condition in the Service > Install table? > And this process follows for every install.
> Thanks for you help and suggestions. It is quite useful for all the > developers.
> REgards, > Amarnath Aitha.
> "Wilson, Phil" wrote:
>> There are some complications here.
>> 1) You can't install the same setup a second time, so you're talking >> about >> some kind of upgrade. If it's a major upgrade, then that's an uninstall >> and >> an install, so generally speaking you do want to uninstall the service.
>> 2) For a patch you can condition the way you're installing the service >> with >> a condition such as NOT PATCH. So the InstallServices and DeleteServices >> standard actions can be conditioned on NOT PATCH if you're using the >> ServiceInstall/Control tables.
>> 3) You're referring to PREVIOUSVERSIONSINSTALLED, so that probably means >> you're doing a major upgrade, so a patching scenario won't apply.
>> Generally speaking, if you're using the ServiceControl and ServiceInstall >> tables to install services then you don't need Visual Studio custom >> actions >> or any conditions at all, and RemovePreviousVersions should just work.
>> > Phil, as you suggested i have written the information in both the >> > tables >> > Service Control and Service Install. It works fine.
>> > Now my question is i had to copy some files for installing the service >> > in >> > the target manchine. So i want to avoid this when i do the installation >> > second time, or adding a patch, When i install second time, my msi file >> > should check if service is already installed in the machine, if yes, it >> > should not copy the files and also it should not install the service.
>> > One thing i want to do is i want to remove the values what i have >> > entered >> > in >> > service control table because service get uninstalled when my new patch >> > or >> > version in installed.
>> > If i do this directly from the Custom Action UI and using the property >> > NOT >> > PREVIOUSVERSIONSINSTALLED it did not work
> you need a condition on the service executable and on the service install > that they won't get get installed if the service already exists."
I would search the registry for the name and will keep a condition on service executable. How to keep the condition in the service install table. What is the attribute which should be updated to check this condition in the following
ServiceInstall,Name,DisplayName,ServiceType,StartType,ErrorControl,LoadOrde rGroup,Dependencies,StartName,Password,Arguments,Component_,Description which are the column names for service install table.
I am installing the service using service install table and service control table. So Please let me know how to keep this condition here.
"Wilson, Phil" wrote: > I only mentioned patching because you used the word in your original post.
> It doesn't seem to me that there is anything much here that MSI can do for > you. Basically you need a custom action to check if a service is already > installed or not (or maybe a registry search for the service entry). Then > you need a condition on the service executable and on the service install > that they won't get get installed if the service already exists.
> I don't know you got to the point where you are (or might be) installing a > 3rd party service. If they allow you to redistribute and install that > service also, then they should supply a merge module that you (and everyone > else) can use to install the service if necessary, and do the right thing > with configuration etc. > -- > Phil Wilson > The Definitive Guide to Windows Installer > http://www.apress.com/book/view/1590592972
> > For a patch you can condition the way you're installing the service with > > a condition such as NOT PATCH. So the InstallServices and DeleteServices > > standard actions can be conditioned on NOT PATCH if you're using the > > ServiceInstall/Control tables
> > I would prefer this answer. But here you are saying it applies only for a > > patch. In my case there is no concept of patches. I mean here when we are > > chaning to a new version there would be some few set of files which are > > changed.
> > In my case when the user installs for the first time also it should check > > whether the service is already installed ( Because this is a third party > > service which would have already been installed by the user and he might > > have > > done some changes to the configuration also, So i dont want to copy the > > files > > again ( files which are related to service, I can do this keeping a > > condition > > in Launch Conditions or makiing it is permanent) and also i dont want to > > install the service again). How to check this condition in the Service > > Install table? > > And this process follows for every install.
> > Thanks for you help and suggestions. It is quite useful for all the > > developers.
> > REgards, > > Amarnath Aitha.
> > "Wilson, Phil" wrote:
> >> There are some complications here.
> >> 1) You can't install the same setup a second time, so you're talking > >> about > >> some kind of upgrade. If it's a major upgrade, then that's an uninstall > >> and > >> an install, so generally speaking you do want to uninstall the service.
> >> 2) For a patch you can condition the way you're installing the service > >> with > >> a condition such as NOT PATCH. So the InstallServices and DeleteServices > >> standard actions can be conditioned on NOT PATCH if you're using the > >> ServiceInstall/Control tables.
> >> 3) You're referring to PREVIOUSVERSIONSINSTALLED, so that probably means > >> you're doing a major upgrade, so a patching scenario won't apply.
> >> Generally speaking, if you're using the ServiceControl and ServiceInstall > >> tables to install services then you don't need Visual Studio custom > >> actions > >> or any conditions at all, and RemovePreviousVersions should just work.
> >> > Phil, as you suggested i have written the information in both the > >> > tables > >> > Service Control and Service Install. It works fine.
> >> > Now my question is i had to copy some files for installing the service > >> > in > >> > the target manchine. So i want to avoid this when i do the installation > >> > second time, or adding a patch, When i install second time, my msi file > >> > should check if service is already installed in the machine, if yes, it > >> > should not copy the files and also it should not install the service.
> >> > One thing i want to do is i want to remove the values what i have > >> > entered > >> > in > >> > service control table because service get uninstalled when my new patch > >> > or > >> > version in installed.
> >> > If i do this directly from the Custom Action UI and using the property > >> > NOT > >> > PREVIOUSVERSIONSINSTALLED it did not work
Add your condition to the InstallServices standard action, if this is the only service you're installing. -- Phil Wilson The Definitive Guide to Windows Installer http://www.apress.com/book/view/1590592972
"Amar" <A...@discussions.microsoft.com> wrote in message
> "Then >> you need a condition on the service executable and on the service install >> that they won't get get installed if the service already exists."
> I would search the registry for the name and will keep a condition on > service executable. How to keep the condition in the service install > table. > What is the attribute which should be updated to check this condition in > the > following
> ServiceInstall,Name,DisplayName,ServiceType,StartType,ErrorControl,LoadOrde rGroup,Dependencies,StartName,Password,Arguments,Component_,Description > which are the column names for service install table.
> I am installing the service using service install table and service > control > table. So Please let me know how to keep this condition here.
> Amar.
> "Wilson, Phil" wrote:
>> I only mentioned patching because you used the word in your original >> post.
>> It doesn't seem to me that there is anything much here that MSI can do >> for >> you. Basically you need a custom action to check if a service is already >> installed or not (or maybe a registry search for the service entry). Then >> you need a condition on the service executable and on the service install >> that they won't get get installed if the service already exists.
>> I don't know you got to the point where you are (or might be) installing >> a >> 3rd party service. If they allow you to redistribute and install that >> service also, then they should supply a merge module that you (and >> everyone >> else) can use to install the service if necessary, and do the right thing >> with configuration etc. >> -- >> Phil Wilson >> The Definitive Guide to Windows Installer >> http://www.apress.com/book/view/1590592972
>> > For a patch you can condition the way you're installing the service >> > with >> > a condition such as NOT PATCH. So the InstallServices and >> > DeleteServices >> > standard actions can be conditioned on NOT PATCH if you're using the >> > ServiceInstall/Control tables
>> > I would prefer this answer. But here you are saying it applies only for >> > a >> > patch. In my case there is no concept of patches. I mean here when we >> > are >> > chaning to a new version there would be some few set of files which are >> > changed.
>> > In my case when the user installs for the first time also it should >> > check >> > whether the service is already installed ( Because this is a third >> > party >> > service which would have already been installed by the user and he >> > might >> > have >> > done some changes to the configuration also, So i dont want to copy the >> > files >> > again ( files which are related to service, I can do this keeping a >> > condition >> > in Launch Conditions or makiing it is permanent) and also i dont want >> > to >> > install the service again). How to check this condition in the Service >> > Install table? >> > And this process follows for every install.
>> > Thanks for you help and suggestions. It is quite useful for all the >> > developers.
>> > REgards, >> > Amarnath Aitha.
>> > "Wilson, Phil" wrote:
>> >> There are some complications here.
>> >> 1) You can't install the same setup a second time, so you're talking >> >> about >> >> some kind of upgrade. If it's a major upgrade, then that's an >> >> uninstall >> >> and >> >> an install, so generally speaking you do want to uninstall the >> >> service.
>> >> 2) For a patch you can condition the way you're installing the service >> >> with >> >> a condition such as NOT PATCH. So the InstallServices and >> >> DeleteServices >> >> standard actions can be conditioned on NOT PATCH if you're using the >> >> ServiceInstall/Control tables.
>> >> 3) You're referring to PREVIOUSVERSIONSINSTALLED, so that probably >> >> means >> >> you're doing a major upgrade, so a patching scenario won't apply.
>> >> Generally speaking, if you're using the ServiceControl and >> >> ServiceInstall >> >> tables to install services then you don't need Visual Studio custom >> >> actions >> >> or any conditions at all, and RemovePreviousVersions should just work.
>> >> > Phil, as you suggested i have written the information in both the >> >> > tables >> >> > Service Control and Service Install. It works fine.
>> >> > Now my question is i had to copy some files for installing the >> >> > service >> >> > in >> >> > the target manchine. So i want to avoid this when i do the >> >> > installation >> >> > second time, or adding a patch, When i install second time, my msi >> >> > file >> >> > should check if service is already installed in the machine, if yes, >> >> > it >> >> > should not copy the files and also it should not install the >> >> > service.
>> >> > One thing i want to do is i want to remove the values what i have >> >> > entered >> >> > in >> >> > service control table because service get uninstalled when my new >> >> > patch >> >> > or >> >> > version in installed.
>> >> > If i do this directly from the Custom Action UI and using the >> >> > property >> >> > NOT >> >> > PREVIOUSVERSIONSINSTALLED it did not work
In the InstallExecuteSequence table value for InstallServices should be updated with the CONDITION "NOT INSTALLED"
InstallServices NOT Installed 5800
How to do this writing a query, for inserting the row i am using the query to write from the C++ code.
"INSERT INTO `ServiceControl`(`ServiceControl`,`Name`,`Event`,`Arguments`,`Wait`,`Compon ent_`) VALUES ('NR Service Control','NR',162,'',0,'C__8E79904005DE45829AB2CC2750DE30C0')"
If i want to update the values for InstallServices how should i write the query? InstallServices VersionNT 5800 should be replaced with InstallServices NOT Installed 5800
"Wilson, Phil" wrote: > Add your condition to the InstallServices standard action, if this is the > only service you're installing. > -- > Phil Wilson > The Definitive Guide to Windows Installer > http://www.apress.com/book/view/1590592972
> > "Then > >> you need a condition on the service executable and on the service install > >> that they won't get get installed if the service already exists."
> > I would search the registry for the name and will keep a condition on > > service executable. How to keep the condition in the service install > > table. > > What is the attribute which should be updated to check this condition in > > the > > following
> > ServiceInstall,Name,DisplayName,ServiceType,StartType,ErrorControl,LoadOrde rGroup,Dependencies,StartName,Password,Arguments,Component_,Description > > which are the column names for service install table.
> > I am installing the service using service install table and service > > control > > table. So Please let me know how to keep this condition here.
> > Amar.
> > "Wilson, Phil" wrote:
> >> I only mentioned patching because you used the word in your original > >> post.
> >> It doesn't seem to me that there is anything much here that MSI can do > >> for > >> you. Basically you need a custom action to check if a service is already > >> installed or not (or maybe a registry search for the service entry). Then > >> you need a condition on the service executable and on the service install > >> that they won't get get installed if the service already exists.
> >> I don't know you got to the point where you are (or might be) installing > >> a > >> 3rd party service. If they allow you to redistribute and install that > >> service also, then they should supply a merge module that you (and > >> everyone > >> else) can use to install the service if necessary, and do the right thing > >> with configuration etc. > >> -- > >> Phil Wilson > >> The Definitive Guide to Windows Installer > >> http://www.apress.com/book/view/1590592972
> >> > For a patch you can condition the way you're installing the service > >> > with > >> > a condition such as NOT PATCH. So the InstallServices and > >> > DeleteServices > >> > standard actions can be conditioned on NOT PATCH if you're using the > >> > ServiceInstall/Control tables
> >> > I would prefer this answer. But here you are saying it applies only for > >> > a > >> > patch. In my case there is no concept of patches. I mean here when we > >> > are > >> > chaning to a new version there would be some few set of files which are > >> > changed.
> >> > In my case when the user installs for the first time also it should > >> > check > >> > whether the service is already installed ( Because this is a third > >> > party > >> > service which would have already been installed by the user and he > >> > might > >> > have > >> > done some changes to the configuration also, So i dont want to copy the > >> > files > >> > again ( files which are related to service, I can do this keeping a > >> > condition > >> > in Launch Conditions or makiing it is permanent) and also i dont want > >> > to > >> > install the service again). How to check this condition in the Service > >> > Install table? > >> > And this process follows for every install.
> >> > Thanks for you help and suggestions. It is quite useful for all the > >> > developers.
> >> > REgards, > >> > Amarnath Aitha.
> >> > "Wilson, Phil" wrote:
> >> >> There are some complications here.
> >> >> 1) You can't install the same setup a second time, so you're talking > >> >> about > >> >> some kind of upgrade. If it's a major upgrade, then that's an > >> >> uninstall > >> >> and > >> >> an install, so generally speaking you do want to uninstall the > >> >> service.
> >> >> 2) For a patch you can condition the way you're installing the service > >> >> with > >> >> a condition such as NOT PATCH. So the InstallServices and > >> >> DeleteServices > >> >> standard actions can be conditioned on NOT PATCH if you're using the > >> >> ServiceInstall/Control tables.
> >> >> 3) You're referring to PREVIOUSVERSIONSINSTALLED, so that probably > >> >> means > >> >> you're doing a major upgrade, so a patching scenario won't apply.
> >> >> Generally speaking, if you're using the ServiceControl and > >> >> ServiceInstall > >> >> tables to install services then you don't need Visual Studio custom > >> >> actions > >> >> or any conditions at all, and RemovePreviousVersions should just work.
> >> >> > Phil, as you suggested i have written the information in both the > >> >> > tables > >> >> > Service Control and Service Install. It works fine.
> >> >> > Now my question is i had to copy some files for installing the > >> >> > service > >> >> > in > >> >> > the target manchine. So i want to avoid this when i do the > >> >> > installation > >> >> > second time, or adding a patch, When i install second time, my msi > >> >> > file > >> >> > should check if service is already installed in the machine, if yes, > >> >> > it > >> >> > should not copy the files and also it should not install the > >> >> > service.
> >> >> > One thing i want to do is i want to remove the values what i have > >> >> > entered > >> >> > in > >> >> > service control table because service get uninstalled when my new > >> >> > patch > >> >> > or > >> >> > version in installed.
> >> >> > If i do this directly from the Custom Action UI and using the > >> >> > property > >> >> > NOT > >> >> > PREVIOUSVERSIONSINSTALLED it did not work
I am able to successfully update the table value NOT Installed from the code.
But still i see when i run the installer, it is overriding the existing service. Though i have ketp a condtion that it should be installed only if the service is not installed "NOT Installed"
> In the InstallExecuteSequence table value for InstallServices should be > updated with the CONDITION "NOT INSTALLED"
> InstallServices NOT Installed 5800
> How to do this writing a query, for inserting the row i am using the query > to write from the C++ code.
> "INSERT INTO > `ServiceControl`(`ServiceControl`,`Name`,`Event`,`Arguments`,`Wait`,`Compon ent_`) > VALUES ('NR Service > Control','NR',162,'',0,'C__8E79904005DE45829AB2CC2750DE30C0')"
> If i want to update the values for InstallServices how should i write the > query? > InstallServices VersionNT 5800 should be replaced with > InstallServices NOT Installed 5800
> thanks, > Amar
> "Wilson, Phil" wrote:
> > Add your condition to the InstallServices standard action, if this is the > > only service you're installing. > > -- > > Phil Wilson > > The Definitive Guide to Windows Installer > > http://www.apress.com/book/view/1590592972
> > > "Then > > >> you need a condition on the service executable and on the service install > > >> that they won't get get installed if the service already exists."
> > > I would search the registry for the name and will keep a condition on > > > service executable. How to keep the condition in the service install > > > table. > > > What is the attribute which should be updated to check this condition in > > > the > > > following
> > > ServiceInstall,Name,DisplayName,ServiceType,StartType,ErrorControl,LoadOrde rGroup,Dependencies,StartName,Password,Arguments,Component_,Description > > > which are the column names for service install table.
> > > I am installing the service using service install table and service > > > control > > > table. So Please let me know how to keep this condition here.
> > > Amar.
> > > "Wilson, Phil" wrote:
> > >> I only mentioned patching because you used the word in your original > > >> post.
> > >> It doesn't seem to me that there is anything much here that MSI can do > > >> for > > >> you. Basically you need a custom action to check if a service is already > > >> installed or not (or maybe a registry search for the service entry). Then > > >> you need a condition on the service executable and on the service install > > >> that they won't get get installed if the service already exists.
> > >> I don't know you got to the point where you are (or might be) installing > > >> a > > >> 3rd party service. If they allow you to redistribute and install that > > >> service also, then they should supply a merge module that you (and > > >> everyone > > >> else) can use to install the service if necessary, and do the right thing > > >> with configuration etc. > > >> -- > > >> Phil Wilson > > >> The Definitive Guide to Windows Installer > > >> http://www.apress.com/book/view/1590592972
> > >> > For a patch you can condition the way you're installing the service > > >> > with > > >> > a condition such as NOT PATCH. So the InstallServices and > > >> > DeleteServices > > >> > standard actions can be conditioned on NOT PATCH if you're using the > > >> > ServiceInstall/Control tables
> > >> > I would prefer this answer. But here you are saying it applies only for > > >> > a > > >> > patch. In my case there is no concept of patches. I mean here when we > > >> > are > > >> > chaning to a new version there would be some few set of files which are > > >> > changed.
> > >> > In my case when the user installs for the first time also it should > > >> > check > > >> > whether the service is already installed ( Because this is a third > > >> > party > > >> > service which would have already been installed by the user and he > > >> > might > > >> > have > > >> > done some changes to the configuration also, So i dont want to copy the > > >> > files > > >> > again ( files which are related to service, I can do this keeping a > > >> > condition > > >> > in Launch Conditions or makiing it is permanent) and also i dont want > > >> > to > > >> > install the service again). How to check this condition in the Service > > >> > Install table? > > >> > And this process follows for every install.
> > >> > Thanks for you help and suggestions. It is quite useful for all the > > >> > developers.
> > >> > REgards, > > >> > Amarnath Aitha.
> > >> > "Wilson, Phil" wrote:
> > >> >> There are some complications here.
> > >> >> 1) You can't install the same setup a second time, so you're talking > > >> >> about > > >> >> some kind of upgrade. If it's a major upgrade, then that's an > > >> >> uninstall > > >> >> and > > >> >> an install, so generally speaking you do want to uninstall the > > >> >> service.
> > >> >> 2) For a patch you can condition the way you're installing the service > > >> >> with > > >> >> a condition such as NOT PATCH. So the InstallServices and > > >> >> DeleteServices > > >> >> standard actions can be conditioned on NOT PATCH if you're using the > > >> >> ServiceInstall/Control tables.
> > >> >> 3) You're referring to PREVIOUSVERSIONSINSTALLED, so that probably > > >> >> means > > >> >> you're doing a major upgrade, so a patching scenario won't apply.
> > >> >> Generally speaking, if you're using the ServiceControl and > > >> >> ServiceInstall > > >> >> tables to install services then you don't need Visual Studio custom > > >> >> actions > > >> >> or any conditions at all, and RemovePreviousVersions should just work.
> > >> >> > Phil, as you suggested i have written the information in both the > > >> >> > tables > > >> >> > Service Control and Service Install. It works fine.
> > >> >> > Now my question is i had to copy some files for installing the > > >> >> > service > > >> >> > in > > >> >> > the target manchine. So i want to avoid this when i do the > > >> >> > installation > > >> >> > second time, or adding a patch, When i install second time, my msi > > >> >> > file > > >> >> > should check if service is already installed in the machine, if yes, > > >> >> > it > > >> >> > should not copy the files and also it should not install the > > >> >> > service.
> > >> >> > One thing i want to do is i want to remove the values what i have > > >> >> > entered > > >> >> > in > > >> >> > service control table because service get uninstalled when my new > > >> >> > patch > > >> >> > or > > >> >> > version in installed.
> > >> >> > If i do this directly from the Custom Action UI and using the > > >> >> > property > > >> >> > NOT > > >> >> > PREVIOUSVERSIONSINSTALLED it did not work
> I am able to successfully update the table value NOT Installed from the > code.
> But still i see when i run the installer, it is overriding the existing > service. Though i have ketp a condtion that it should be installed > only if the service is not installed "NOT Installed"
> Please let me know if i am missing something.
> Thanks in advance, > Amar
> "Amar" wrote:
>> Hi Phil,
>> Thank you for your response.
>> So what i understand from below is
>> In the InstallExecuteSequence table value for InstallServices should be >> updated with the CONDITION "NOT INSTALLED"
>> InstallServices NOT Installed 5800
>> How to do this writing a query, for inserting the row i am using the >> query >> to write from the C++ code.
>> "INSERT INTO >> `ServiceControl`(`ServiceControl`,`Name`,`Event`,`Arguments`,`Wait`,`Compon ent_`) >> VALUES ('NR Service >> Control','NR',162,'',0,'C__8E79904005DE45829AB2CC2750DE30C0')"
>> If i want to update the values for InstallServices how should i write the >> query? >> InstallServices VersionNT 5800 should be replaced with >> InstallServices NOT Installed 5800
>> thanks, >> Amar
>> "Wilson, Phil" wrote:
>> > Add your condition to the InstallServices standard action, if this is >> > the >> > only service you're installing. >> > -- >> > Phil Wilson >> > The Definitive Guide to Windows Installer >> > http://www.apress.com/book/view/1590592972
>> > > "Then >> > >> you need a condition on the service executable and on the service >> > >> install >> > >> that they won't get get installed if the service already exists."
>> > > I would search the registry for the name and will keep a condition on >> > > service executable. How to keep the condition in the service install >> > > table. >> > > What is the attribute which should be updated to check this condition >> > > in >> > > the >> > > following
>> > > ServiceInstall,Name,DisplayName,ServiceType,StartType,ErrorControl,LoadOrde rGroup,Dependencies,StartName,Password,Arguments,Component_,Description >> > > which are the column names for service install table.
>> > > I am installing the service using service install table and service >> > > control >> > > table. So Please let me know how to keep this condition here.
>> > > Amar.
>> > > "Wilson, Phil" wrote:
>> > >> I only mentioned patching because you used the word in your original >> > >> post.
>> > >> It doesn't seem to me that there is anything much here that MSI can >> > >> do >> > >> for >> > >> you. Basically you need a custom action to check if a service is >> > >> already >> > >> installed or not (or maybe a registry search for the service entry). >> > >> Then >> > >> you need a condition on the service executable and on the service >> > >> install >> > >> that they won't get get installed if the service already exists.
>> > >> I don't know you got to the point where you are (or might be) >> > >> installing >> > >> a >> > >> 3rd party service. If they allow you to redistribute and install >> > >> that >> > >> service also, then they should supply a merge module that you (and >> > >> everyone >> > >> else) can use to install the service if necessary, and do the right >> > >> thing >> > >> with configuration etc. >> > >> -- >> > >> Phil Wilson >> > >> The Definitive Guide to Windows Installer >> > >> http://www.apress.com/book/view/1590592972
>> > >> > For a patch you can condition the way you're installing the >> > >> > service >> > >> > with >> > >> > a condition such as NOT PATCH. So the InstallServices and >> > >> > DeleteServices >> > >> > standard actions can be conditioned on NOT PATCH if you're using >> > >> > the >> > >> > ServiceInstall/Control tables
>> > >> > I would prefer this answer. But here you are saying it applies >> > >> > only for >> > >> > a >> > >> > patch. In my case there is no concept of patches. I mean here when >> > >> > we >> > >> > are >> > >> > chaning to a new version there would be some few set of files >> > >> > which are >> > >> > changed.
>> > >> > In my case when the user installs for the first time also it >> > >> > should >> > >> > check >> > >> > whether the service is already installed ( Because this is a third >> > >> > party >> > >> > service which would have already been installed by the user and he >> > >> > might >> > >> > have >> > >> > done some changes to the configuration also, So i dont want to >> > >> > copy the >> > >> > files >> > >> > again ( files which are related to service, I can do this keeping >> > >> > a >> > >> > condition >> > >> > in Launch Conditions or makiing it is permanent) and also i dont >> > >> > want >> > >> > to >> > >> > install the service again). How to check this condition in the >> > >> > Service >> > >> > Install table? >> > >> > And this process follows for every install.
>> > >> > Thanks for you help and suggestions. It is quite useful for all >> > >> > the >> > >> > developers.
>> > >> > REgards, >> > >> > Amarnath Aitha.
>> > >> > "Wilson, Phil" wrote:
>> > >> >> There are some complications here.
>> > >> >> 1) You can't install the same setup a second time, so you're >> > >> >> talking >> > >> >> about >> > >> >> some kind of upgrade. If it's a major upgrade, then that's an >> > >> >> uninstall >> > >> >> and >> > >> >> an install, so generally speaking you do want to uninstall the >> > >> >> service.
>> > >> >> 2) For a patch you can condition the way you're installing the >> > >> >> service >> > >> >> with >> > >> >> a condition such as NOT PATCH. So the InstallServices and >> > >> >> DeleteServices >> > >> >> standard actions can be conditioned on NOT PATCH if you're using >> > >> >> the >> > >> >> ServiceInstall/Control tables.
>> > >> >> 3) You're referring to PREVIOUSVERSIONSINSTALLED, so that >> > >> >> probably >> > >> >> means >> > >> >> you're doing a major upgrade, so a patching scenario won't apply.
>> > >> >> Generally speaking, if you're using the ServiceControl and >> > >> >> ServiceInstall >> > >> >> tables to install services then you don't need Visual Studio >> > >> >> custom >> > >> >> actions >> > >> >> or any conditions at all, and RemovePreviousVersions should just >> > >> >> work.
>> > >> >> > Phil, as you suggested i have written the information in both >> > >> >> > the >> > >> >> > tables >> > >> >> > Service Control and Service Install. It works fine.
>> > >> >> > Now my question is i had to copy some files for installing the >> > >> >> > service >> > >> >> > in >> > >> >> > the target manchine. So i want to avoid this when i do the >> > >> >> > installation >> > >> >> > second time, or adding a patch, When i install second time, my >> > >> >> > msi >> > >> >> > file >> > >> >> > should check if service is already installed in the machine, if >> > >> >> > yes, >> > >> >> > it >> > >> >> > should not copy the files and also it should not install the >> > >> >> > service.
>> > >> >> > One thing i want to do is i want to remove the values what i >> > >> >> > have >> > >> >> > entered >> > >> >> > in >> > >> >> > service control table because service get uninstalled when my >> > >> >> > new >> > >> >> > patch >> > >> >> > or >> > >> >> > version in installed.
>> > >> >> > If i do this directly from the Custom Action UI and using the >> > >> >> > property >> > >> >> > NOT >> > >> >> > PREVIOUSVERSIONSINSTALLED it did not work
1) I have filled the ServiceInstall and ServiceControl tables. 2) edited the installservices value with NOT Installed Condition.
I want to achieve this functionality
1) My msi installer would have to copy the service related files and install the service only when the service is not previously installed by any other person or program. 2) When i install i should not replace the existing files of the service if it is already installed. ( we dont know, at runtime we should check whether this service is already installed by some on the target machine already.) This is because the user might have changed the information in the config files. So we dont wnt to touch the config files or any service related files. 3) If we write table values for Service Control table, while uninstalling it is removing all the service related files, It should not remove any service related files while un installing.
> > I am able to successfully update the table value NOT Installed from the > > code.
> > But still i see when i run the installer, it is overriding the existing > > service. Though i have ketp a condtion that it should be installed > > only if the service is not installed "NOT Installed"
> > Please let me know if i am missing something.
> > Thanks in advance, > > Amar
> > "Amar" wrote:
> >> Hi Phil,
> >> Thank you for your response.
> >> So what i understand from below is
> >> In the InstallExecuteSequence table value for InstallServices should be > >> updated with the CONDITION "NOT INSTALLED"
> >> InstallServices NOT Installed 5800
> >> How to do this writing a query, for inserting the row i am using the > >> query > >> to write from the C++ code.
> >> "INSERT INTO > >> `ServiceControl`(`ServiceControl`,`Name`,`Event`,`Arguments`,`Wait`,`Compon ent_`) > >> VALUES ('NR Service > >> Control','NR',162,'',0,'C__8E79904005DE45829AB2CC2750DE30C0')"
> >> If i want to update the values for InstallServices how should i write the > >> query? > >> InstallServices VersionNT 5800 should be replaced with > >> InstallServices NOT Installed 5800
> >> thanks, > >> Amar
> >> "Wilson, Phil" wrote:
> >> > Add your condition to the InstallServices standard action, if this is > >> > the > >> > only service you're installing. > >> > -- > >> > Phil Wilson > >> > The Definitive Guide to Windows Installer > >> > http://www.apress.com/book/view/1590592972
> >> > > "Then > >> > >> you need a condition on the service executable and on the service > >> > >> install > >> > >> that they won't get get installed if the service already exists."
> >> > > I would search the registry for the name and will keep a condition on > >> > > service executable. How to keep the condition in the service install > >> > > table. > >> > > What is the attribute which should be updated to check this condition > >> > > in > >> > > the > >> > > following
> >> > > ServiceInstall,Name,DisplayName,ServiceType,StartType,ErrorControl,LoadOrde rGroup,Dependencies,StartName,Password,Arguments,Component_,Description > >> > > which are the column names for service install table.
> >> > > I am installing the service using service install table and service > >> > > control > >> > > table. So Please let me know how to keep this condition here.
> >> > > Amar.
> >> > > "Wilson, Phil" wrote:
> >> > >> I only mentioned patching because you used the word in your original > >> > >> post.
> >> > >> It doesn't seem to me that there is anything much here that MSI can > >> > >> do > >> > >> for > >> > >> you. Basically you need a custom action to check if a service is > >> > >> already > >> > >> installed or not (or maybe a registry search for the service entry). > >> > >> Then > >> > >> you need a condition on the service executable and on the service > >> > >> install > >> > >> that they won't get get installed if the service already exists.
> >> > >> I don't know you got to the point where you are (or might be) > >> > >> installing > >> > >> a > >> > >> 3rd party service. If they allow you to redistribute and install > >> > >> that > >> > >> service also, then they should supply a merge module that you (and > >> > >> everyone > >> > >> else) can use to install the service if necessary, and do the right > >> > >> thing > >> > >> with configuration etc. > >> > >> -- > >> > >> Phil Wilson > >> > >> The Definitive Guide to Windows Installer > >> > >> http://www.apress.com/book/view/1590592972
> >> > >> > For a patch you can condition the way you're installing the > >> > >> > service > >> > >> > with > >> > >> > a condition such as NOT PATCH. So the InstallServices and > >> > >> > DeleteServices > >> > >> > standard actions can be conditioned on NOT PATCH if you're using > >> > >> > the > >> > >> > ServiceInstall/Control tables
> >> > >> > I would prefer this answer. But here you are saying it applies > >> > >> > only for > >> > >> > a > >> > >> > patch. In my case there is no concept of patches. I mean here when > >> > >> > we > >> > >> > are > >> > >> > chaning to a new version there would be some few set of files > >> > >> > which are > >> > >> > changed.
> >> > >> > In my case when the user installs for the first time also it > >> > >> > should > >> > >> > check > >> > >> > whether the service is already installed ( Because this is a third > >> > >> > party > >> > >> > service which would have already been installed by the user and he > >> > >> > might > >> > >> > have > >> > >> > done some changes to the configuration also, So i dont want to > >> > >> > copy the > >> > >> > files > >> > >> > again ( files which are related to service, I can do this keeping > >> > >> > a > >> > >> > condition > >> > >> > in Launch Conditions or makiing it is permanent) and also i dont > >> > >> > want > >> > >> > to > >> > >> > install the service again). How to check this condition in the > >> > >> > Service > >> > >> > Install table? > >> > >> > And this process follows for every install.
> >> > >> > Thanks for you help and suggestions. It is quite useful for all > >> > >> > the > >> > >> > developers.
> >> > >> > REgards, > >> > >> > Amarnath Aitha.
> >> > >> > "Wilson, Phil" wrote:
> >> > >> >> There are some complications here.
> >> > >> >> 1) You can't install the same setup a second time, so you're > >> > >> >> talking > >> > >> >> about > >> > >> >> some kind of upgrade. If it's a major upgrade, then that's an > >> > >> >> uninstall > >> > >> >> and > >> > >> >> an install, so generally speaking you do want to uninstall the > >> > >> >> service.
> >> > >> >> 2) For a patch you can condition the way you're installing the > >> > >> >> service > >> > >> >> with > >> > >> >> a condition such as NOT PATCH. So the InstallServices and > >> > >> >> DeleteServices > >> > >> >> standard actions can be conditioned on NOT PATCH if you're using > >> > >> >> the > >> > >> >> ServiceInstall/Control tables.
> >> > >> >> 3) You're referring to PREVIOUSVERSIONSINSTALLED, so that > >> > >> >> probably > >> > >> >> means > >> > >> >> you're doing a major upgrade, so a patching scenario won't apply.
> >> > >> >> Generally speaking, if you're using the ServiceControl and > >> > >> >> ServiceInstall > >> > >> >> tables to install services then you don't need Visual Studio > >> > >> >> custom > >> > >> >> actions > >> > >> >> or any conditions at all, and RemovePreviousVersions should just > >> > >> >> work.
> >> > >> >> > Phil, as you suggested i have written the information in both > >> > >> >> > the > >> > >> >> > tables > >> > >> >> > Service Control and Service Install. It works fine.
> >> > >> >> > Now my question is i had to copy some files for installing the > >> > >> >> > service > >> > >> >> > in > >> > >> >> > the target manchine. So i want to avoid this when i do the > >> > >> >> > installation > >> > >> >> > second time, or adding a patch, When i install second time, my > >> > >> >> > msi > >> > >> >> > file > >> > >> >> > should check if service is already installed in the machine, if > >> > >> >> > yes, > >> > >> >> > it > >> > >> >> > should not copy the files and also it should not install the > >> > >> >> > service.
> >> > >> >> > One thing i want to do is i want to remove the values what i > >> > >> >> > have > >> > >> >> > entered > >> > >> >> > in