I have a POS software running under Wine. At the end of the day, it asks if you want Shutdown or not the computer.
If I answer "no", the program simply terminates. If you answer "yes", he usually calls the program "shutdown.exe" from Windows.
Obviously, on Wine, answering "yes" has the same effect as "no", because Wine does not have "shutdown.exe" in the system.
Are there any plans to implement this feature in Wine?
How to make Wine to shutdown computer?
-
- Newbie
- Posts: 2
- Joined: Sat Sep 29, 2012 4:52 pm
Re: How to make Wine to shutdown computer?
In the past I believe its shutting down just reset the wine bottle. As restarting due to a Window's setup was unnecessary.
-
- Newbie
- Posts: 2
- Joined: Sat Sep 29, 2012 4:52 pm
Re: How to make Wine to shutdown computer?
So, there is a workaround for this?
Can i Shutdown my Linux computer from Wine, by a software that calls "shutdown.exe"?
Can i Shutdown my Linux computer from Wine, by a software that calls "shutdown.exe"?
Re: How to make Wine to shutdown computer?
I'm not sure if programs in Wine should be able to shutdown the computer at all. The equivalent to shutdown.exe is /sbin/shutdown and requires root priviledges.
You can without problem call Linux programs from within Wine (like Z:\usr\bin\gimp).
For shutdown, there are two problems:
a) it requires root (and you can't run Wine as root; also you wouldn't want an admin prompt when the computer is going to shutdown, but much earlier)
b) it requires a time (like "now"), but command line arguments can often cause problems between Windows and Unix notation (one can create a wrapper script like here: http://wiki.winehq.org/FAQ#head-a2e0e85 ... ebfefa7ce4)
Maybe someone else has a better solution, I tried using a Linux script to launch the Windows program and to shutdown after completion:
You can without problem call Linux programs from within Wine (like Z:\usr\bin\gimp).
For shutdown, there are two problems:
a) it requires root (and you can't run Wine as root; also you wouldn't want an admin prompt when the computer is going to shutdown, but much earlier)
b) it requires a time (like "now"), but command line arguments can often cause problems between Windows and Unix notation (one can create a wrapper script like here: http://wiki.winehq.org/FAQ#head-a2e0e85 ... ebfefa7ce4)
Maybe someone else has a better solution, I tried using a Linux script to launch the Windows program and to shutdown after completion:
Code: Select all
wine "C:/Program Files/.../program.exe" && gksudo shutdown now
-
- Newbie
- Posts: 1
- Joined: Tue Dec 03, 2013 6:36 am
Re: How to make Wine to shutdown computer?
Hello
Create in the directory windows under drive c: a linux bash file with the name "shutdown" and the right to run
And you must give normale users the privilege to halt linux
Create in the directory windows under drive c: a linux bash file with the name "shutdown" and the right to run
Code: Select all
#!/bin/sh
/sbin/halt