473,657 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to reboot at end of deployment

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
May 18 '06 #1
14 1921
You will have to restort to WinApi and pinvoke.

There is an example in MSDN at :

ms-help://MS.MSDNQTR.2005 APR.1033/sysinfo/base/how_to_shut_dow n_the_system.ht m

Regards,
Tasos

May 18 '06 #2
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.2005 APR.1033/sysinfo/base/how_to_shut_dow n_the_system.ht m

Regards,
Tasos

May 18 '06 #3
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.2005 APR.1033/sysinfo/base/how_to_shut_dow n_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
May 18 '06 #4
> 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.

May 18 '06 #5
Wow. But perhaps "Displaying the Shutdown Dialog Box" (two subjects lower) is
more user-friendly?
May 18 '06 #6
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?

May 18 '06 #7
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.

May 18 '06 #8
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
May 18 '06 #9
> 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.ServiceP rocess.ServiceC ontroller svc = new
System.ServiceP rocess.ServiceC ontroller
(
"ServiceNam e"
) ;

if ( ( svc.Status != System.ServiceP rocess.ServiceC ontrollerStatus .Running )
&&
( svc.Status != System.ServiceP rocess.ServiceC ontrollerStatus .StartPending ) )
{
svc.Start() ;
svc.WaitForStat us (
System.ServiceP rocess.ServiceC ontrollerStatus .Running ) ;
}

You could probably write a simple program that simply does that and have the
custom action run it.
May 18 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
4446
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 reboot, therefore my %ages are very low. Cheers, Ben
5
1287
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,
4
1875
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 property) in the setup project (VS 2003)? Any hints are appreciated. Thanks, Urs
1
1568
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 system and then say I need to install some prerequisite stuff. So I click on the link that says that and then I get a message the that some application is already requesting a reboot. This is a brand new Compaq laptop purchased yesterday. I have...
1
1269
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 the system once installation has completed. I would prefer to simply set a property rather than create a small application that I run at the end of the install. Does anyone know if this is possible?
3
4008
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 advance Siju Maliakkal
3
1347
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 uninstall process?
2
4690
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 then the reboot happens and when the system comes back it says it cant find the setup1.msi file (my setup) and so wont continue and install my app. So how do I make it find setup1.msi and continue the setup after reboot (to setup my app) or even...
3
1693
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 AM with an unhandled exception on the screen. As best I can tell this exception occurs while it's trying to reboot the pc. This has me thinking it might be nice to have it do a reboot whenever it has an unhandled exception but then again I'm...
0
8425
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8326
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8845
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8522
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8622
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2745
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.