Command to force system reboot Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Command to force system reboot

Post by tbreina » Fri Sep 25, 2009 3:25 am

I'm writing an installer program and need to force a system reboot. I suppose I could do this through wxExecute, but wanted to know if there was a better (cross-platform?) method to restart the computer from my program.

Thanks.
-Tony
Everybody's got something to hide except for me and my monkey.

User avatar
doublemax
Moderator
Moderator
Posts: 15174
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax » Fri Sep 25, 2009 7:46 am

Use the source, Luke!

tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina » Fri Sep 25, 2009 1:42 pm

How could I have missed that!

Thanks.
-Tony
:oops:
Everybody's got something to hide except for me and my monkey.

User avatar
Parduz
Experienced Solver
Experienced Solver
Posts: 79
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Re: Command to force system reboot

Post by Parduz » Thu Jan 09, 2020 3:59 pm

I would like to update the given link (which is dead):
https://docs.wxwidgets.org/3.0/group__g ... 8fefa7e5c8

...then ask: there's an example about how to get the access rights under Linux to use this function to reboot?
(sorry for the necrothreading but i think this one is still relevant)

DavidHart
Site Admin
Site Admin
Posts: 4005
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Command to force system reboot

Post by DavidHart » Thu Jan 09, 2020 5:30 pm

I would like to update the given link (which is dead):
https://docs.wxwidgets.org/3.0/group__g ... 8fefa7e5c8
Safer to write 'stable' rather than specifying '3.0', which won't be stable forever:
https://docs.wxwidgets.org/stable/group ... 8fefa7e5c8
how to get the access rights under Linux to use this function to reboot?
There used to be lots of helper programs to do that: gksu, gnomesu, kdesu... For some reason they are now unfashionable and tend to disappear without notice. However this post should help.

Or see this wxForum thread.

Post Reply