Go Back   PackageDeploy Application Packaging Forums > Package Development > Application Packaging > Platformsdk MSI

Reply
 
LinkBack Thread Tools Display Modes
Old 03-15-2010, 06:54 PM   #1 (permalink)
Sujata
Guest
 
Posts: n/a
Default How to install windows service conditionally using MSI

Hi,

I have a product that includes ATL service. The deployment is done through
MSI using VS setup and deployment project and i use ORCA to edit the db.
I want to install the service depending upon the condition provided by user
during install. For that purpose i have written a custom dll in C++. This dll
exposes two function. One is called after InstallInitialize and another one
is called after InstallFinalize. IN the second function, I check the user
condition and then register the service. For this I have used ShellExecuteEx
API (servicename.exe -service). This api returns success but the service is
not getting registered.
What is the recommended way to the register and start the service and that
too in C++ custom dll?

Thanks & regards,
Sujata.
  Reply With Quote
Old 03-15-2010, 06:54 PM   #2 (permalink)
Sujata
Guest
 
Posts: n/a
Default Re: How to install windows service conditionally using MSI

Hi Phil,

I am using the same MSI for the upgrade purpose. So I thought I have to use
dll for custom action where I will check if the application is installed as
service, then upgrade it as a service and then there I will not have to
display message box to asking whether to install application as service or
not.

Could you please explain me (or point to any tutorials) in steps how can I
have this checkboxes using VS setup project?

Thanks,
Sujata.

"Wilson, Phil" wrote:

> I'm not sure why you're using ShellExecute here - you're installing the
> program, and VS setups will let you make an install custom action that
> points to the exe and has -service as arguments. There's no need for Orca
> as far as I can tell from what you're doing, or for Dll calls.
>
> The usual way to deal with choices in VS setups is to use one of the canned
> dialogs like Checkboxes. Then you use the property name in a condition
> (something like CHECKBOXESA=1) on the custom action (and on the service exe
> too in the file system view if you like).
> --
> Phil Wilson
> The Definitive Guide to Windows Installer
> http://www.apress.com/book/view/1590592972
>
>
> "Sujata" <Sujata@discussions.microsoft.com> wrote in message
> news:BAB01527-9F67-484A-81D1-8F72D93DC744@microsoft.com...
> > Hi,
> >
> > I have a product that includes ATL service. The deployment is done through
> > MSI using VS setup and deployment project and i use ORCA to edit the db.
> > I want to install the service depending upon the condition provided by
> > user
> > during install. For that purpose i have written a custom dll in C++. This
> > dll
> > exposes two function. One is called after InstallInitialize and another
> > one
> > is called after InstallFinalize. IN the second function, I check the user
> > condition and then register the service. For this I have used
> > ShellExecuteEx
> > API (servicename.exe -service). This api returns success but the service
> > is
> > not getting registered.
> > What is the recommended way to the register and start the service and that
> > too in C++ custom dll?
> >
> > Thanks & regards,
> > Sujata.

>

  Reply With Quote
Old 03-15-2010, 06:54 PM   #3 (permalink)
Wilson, Phil
Guest
 
Posts: n/a
Default Re: How to install windows service conditionally using MSI

I'm not sure why you're using ShellExecute here - you're installing the
program, and VS setups will let you make an install custom action that
points to the exe and has -service as arguments. There's no need for Orca
as far as I can tell from what you're doing, or for Dll calls.

The usual way to deal with choices in VS setups is to use one of the canned
dialogs like Checkboxes. Then you use the property name in a condition
(something like CHECKBOXESA=1) on the custom action (and on the service exe
too in the file system view if you like).
--
Phil Wilson
The Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972


"Sujata" <Sujata@discussions.microsoft.com> wrote in message
news:BAB01527-9F67-484A-81D1-8F72D93DC744@microsoft.com...
> Hi,
>
> I have a product that includes ATL service. The deployment is done through
> MSI using VS setup and deployment project and i use ORCA to edit the db.
> I want to install the service depending upon the condition provided by
> user
> during install. For that purpose i have written a custom dll in C++. This
> dll
> exposes two function. One is called after InstallInitialize and another
> one
> is called after InstallFinalize. IN the second function, I check the user
> condition and then register the service. For this I have used
> ShellExecuteEx
> API (servicename.exe -service). This api returns success but the service
> is
> not getting registered.
> What is the recommended way to the register and start the service and that
> too in C++ custom dll?
>
> Thanks & regards,
> Sujata.


  Reply With Quote
Old 03-15-2010, 06:54 PM   #4 (permalink)
Wilson, Phil
Guest
 
Posts: n/a
Default Re: How to install windows service conditionally using MSI

There's a walkthrough here that uses the VS checkboxes dialog.

http://msdn.microsoft.com/en-us/libr...fd(VS.80).aspx

--
Phil Wilson
The Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972


"Sujata" <Sujata@discussions.microsoft.com> wrote in message
news:7C9037DF-42E6-419A-B19A-177017ACAFF0@microsoft.com...
> Hi Phil,
>
> I am using the same MSI for the upgrade purpose. So I thought I have to
> use
> dll for custom action where I will check if the application is installed
> as
> service, then upgrade it as a service and then there I will not have to
> display message box to asking whether to install application as service or
> not.
>
> Could you please explain me (or point to any tutorials) in steps how can I
> have this checkboxes using VS setup project?
>
> Thanks,
> Sujata.
>
> "Wilson, Phil" wrote:
>
>> I'm not sure why you're using ShellExecute here - you're installing the
>> program, and VS setups will let you make an install custom action that
>> points to the exe and has -service as arguments. There's no need for
>> Orca
>> as far as I can tell from what you're doing, or for Dll calls.
>>
>> The usual way to deal with choices in VS setups is to use one of the
>> canned
>> dialogs like Checkboxes. Then you use the property name in a condition
>> (something like CHECKBOXESA=1) on the custom action (and on the service
>> exe
>> too in the file system view if you like).
>> --
>> Phil Wilson
>> The Definitive Guide to Windows Installer
>> http://www.apress.com/book/view/1590592972
>>
>>
>> "Sujata" <Sujata@discussions.microsoft.com> wrote in message
>> news:BAB01527-9F67-484A-81D1-8F72D93DC744@microsoft.com...
>> > Hi,
>> >
>> > I have a product that includes ATL service. The deployment is done
>> > through
>> > MSI using VS setup and deployment project and i use ORCA to edit the
>> > db.
>> > I want to install the service depending upon the condition provided by
>> > user
>> > during install. For that purpose i have written a custom dll in C++.
>> > This
>> > dll
>> > exposes two function. One is called after InstallInitialize and another
>> > one
>> > is called after InstallFinalize. IN the second function, I check the
>> > user
>> > condition and then register the service. For this I have used
>> > ShellExecuteEx
>> > API (servicename.exe -service). This api returns success but the
>> > service
>> > is
>> > not getting registered.
>> > What is the recommended way to the register and start the service and
>> > that
>> > too in C++ custom dll?
>> >
>> > Thanks & regards,
>> > Sujata.

>>


  Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:40 PM.


vBulletin, Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
2007 - 2012 PackageDeploy.com