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 »

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: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Post by doublemax »

Use the source, Luke!
tbreina
Moderator
Moderator
Posts: 1289
Joined: Thu Nov 25, 2004 7:38 pm
Location: Coronado, CA

Post by tbreina »

How could I have missed that!

Thanks.
-Tony
:oops:
Everybody's got something to hide except for me and my monkey.
User avatar
Parduz
I live to help wx-kind
I live to help wx-kind
Posts: 193
Joined: Fri Jan 30, 2015 1:48 pm
Location: Bologna, Italy

Re: Command to force system reboot

Post by Parduz »

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: 4254
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Command to force system reboot

Post by DavidHart »

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