My deployment contains sevral projects, one of which is a service. The
installation does not automatically carry out a reboot at the end of the
installation process, which is required to start the service. Is there any
way I can put something into the deplyment project to make the target system
reboot at the end of the setup?
--
Dave 14 1903
You will have to restort to WinApi and pinvoke.
There is an example in MSDN at :
ms-help://MS.MSDNQTR.2005APR.1033/sysinfo/base/how_to_shut_down_the_system.htm
Regards,
Tasos
Thanks Tasos, but your link didn't work. Perhaps I should have mentioned that
I am using VS2003.
--
Dave
"Tasos Vogiatzoglou" wrote: You will have to restort to WinApi and pinvoke.
There is an example in MSDN at :
ms-help://MS.MSDNQTR.2005APR.1033/sysinfo/base/how_to_shut_down_the_system.htm
Regards, Tasos
Hello Dave,
Here http://msdn.microsoft.com/library/de...the_system.asp
D> Thanks Tasos, but your link didn't work. Perhaps I should have
D> mentioned that I am using VS2003.
D>
D> "Tasos Vogiatzoglou" wrote:
D> You will have to restort to WinApi and pinvoke.
There is an example in MSDN at :
ms-help://MS.MSDNQTR.2005APR.1033/sysinfo/base/how_to_shut_down_the_s ystem.htm
Regards, Tasos
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
> My deployment contains sevral projects, one of which is a service. The installation does not automatically carry out a reboot at the end of the installation process, which is required to start the service. Is there any way I can put something into the deplyment project to make the target system reboot at the end of the setup?
Pop up a dialog that says "You need to reboot" :)
I would have the service start without the reboot.
Wow. But perhaps "Displaying the Shutdown Dialog Box" (two subjects lower) is
more user-friendly?
Thanks Michael and Piebald for both those references , however they are not
exactly easy to pop into my deployment project. I presume I have to write a
program to do it, and then call it as a Custom Action in the deployment
project, is that the idea?
--
Dave
"PIEBALD" wrote: Wow. But perhaps "Displaying the Shutdown Dialog Box" (two subjects lower) is more user-friendly?
So would I. Do you know how to make the deployment project do that?
--
Dave
"PIEBALD" wrote: My deployment contains sevral projects, one of which is a service. The installation does not automatically carry out a reboot at the end of the installation process, which is required to start the service. Is there any way I can put something into the deplyment project to make the target system reboot at the end of the setup?
Pop up a dialog that says "You need to reboot" :)
I would have the service start without the reboot.
Hello PIEBALD,
P> Wow. But perhaps "Displaying the Shutdown Dialog Box" (two subjects
P> lower) is more user-friendly?
Sure. Because user, not you decided when restart system :)
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
> So would I. Do you know how to make the deployment project do that?
Well, I've never done it, I haven't fiddled with custom actions yet either.
But I _have_ written a service, which resides in an EXE which can take
command-line parameters to do such things. The code I have is pretty
convoluted, but look into:
System.ServiceProcess.ServiceController svc = new
System.ServiceProcess.ServiceController
(
"ServiceName"
) ;
if ( ( svc.Status != System.ServiceProcess.ServiceControllerStatus.Runn ing )
&&
( svc.Status != System.ServiceProcess.ServiceControllerStatus.Star tPending ) )
{
svc.Start() ;
svc.WaitForStatus (
System.ServiceProcess.ServiceControllerStatus.Runn ing ) ;
}
You could probably write a simple program that simply does that and have the
custom action run it.
You don't need to force a reboot to start the service. You can use WMI
to start the service programmatically via a custom action.
Well, I'll try that. I was hoping Visual Studio might be a bit more helpful.
You don't have any more details do you?
--
Dave
"Andy" wrote: You don't need to force a reboot to start the service. You can use WMI to start the service programmatically via a custom action.
Oh, it dosen't use WMI, I was mistaken about that part.
You'd put that code inside an installer class, which is part of your
appilcation assembly.
See InstallerBase for some details on that.
You then add a custom action; the custom action should be the primary
output of your application.
Ha. It is so easy when you know how. That article gave me the clue. Thanks.
Just override the Commit method in the Installer derived class, instantiate a
ServiceController with the name of the service and call Start(). Works like a
charm (which is more than can be said for these newsgroups - am I the only
one that has to click the "read the response" link 20 times before I get it?)
--
Dave
"Andy" wrote: Oh, it dosen't use WMI, I was mistaken about that part.
You'd put that code inside an installer class, which is part of your appilcation assembly.
See InstallerBase for some details on that.
You then add a custom action; the custom action should be the primary output of your application.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ben Allen |
last post by:
Is there a way (through a variable) to show the date of the last server
reboot i.e. when PHP last started running? As I am trying to show the
server uptime, which of course only works from the last...
|
by: ray well |
last post by:
hi,
are reboots needed after installing mdac ?
are reboots needed after installing .net framework?
i'm planning out an install, and need to know what to expect.
thanks,
|
by: Urs Vogel |
last post by:
Hi
I deploy a Windows Service which requires a reboot after setup. The setup
project, however, does not automatically recognize this requirement.How do I
force a reboot (or set a reboot...
|
by: Aaron |
last post by:
Not sure if this is the best spot to post this question, but I am not going
to pay money to ask an installation question.... Anyways
I am trying to install C# standard 2003 and it analyzes the...
|
by: PhilBray |
last post by:
Hi,
I am currently adding a deployment project to my C# solution which
installs a windows service and I have been trying to find a property
that will make the installer prompt the user to reboot...
|
by: iamsiju |
last post by:
Hi,
I am facing a problem with the Perl Telnet Object. My Telnet Object hangs just after issueing reboot command on the remote host.
Please help me who faced this problem !!!
Thanks in...
|
by: gnih |
last post by:
Hi,
I'm using VS2005 and .net 2.0, my project using Windows Installer
deployment to make setup package.
the question is how can i invoke a dialog let user choose reboot or
not at the end of...
|
by: =?Utf-8?B?VHJhY2tz?= |
last post by:
When I run my setup of a vb.net app made in VS2005 and setup made with the
setup wizard and then modified in the ide, The .net 2 setup runs and installs
and then asks to reboot. If you answer ok...
|
by: cj |
last post by:
My program shuts itself down and reboots the pc it's running on at
2:00am twice a week and has been doing so without fail for over a year.
But twice in the past month it's been found running in the...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |