Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Automatically Restarting a Front End  (Read 1908 times)

0 Members and 1 Guest are viewing this topic.

Bill Mote

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 202
  • Last login:May 29, 2010, 11:04:28 pm
  • Focus on making things better not bigger.
    • Things That Make Me Mad and How To Fix Them
Automatically Restarting a Front End
« on: April 21, 2008, 02:09:52 pm »
Does anyone know how to monitor the Front End and restart it if it stops?  I know "firedaemon" can do this if you launch your FE as a process and I've come up with a simple .bat file that launches mamewah:

Code: [Select]
:RUNFE

CD C:\MAMEWAH
@CALL MAMEWAH.EXE

GOTO RUNFE

This launches MAMEWah and returns control to the batch file if mamewah exits.  It relaunches mamewah automatically, but this feels more like a hack than anything respectable ;)  Firedaemon costs $40 for home use.  I'm not that ashamed of my batch file.  Just curious if anyone knows of a better and/or more sophisticated way to do this.

dot

fjl

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1152
  • Last login:March 04, 2017, 10:14:04 pm
  • Pixels Rule!
Re: Automatically Restarting a Front End
« Reply #1 on: April 21, 2008, 03:17:12 pm »
I'm by no means a coding pro. Everything I know I learned on my own. This is one thing I learned from playing around with DOS...


Code: [Select]
@echo off
:relaunch
start /wait Frontend.exe
goto :relaunch

Basically what it does is open a program and waits for it to close. If it closes it loops back to the command that opens it and again waits for it to close. It repeats this indefinitely until someone closes the DOS Batch Window. Which is the only problem, a DOS Window pops up when this is inserted into a batch file. But I suppose you can add it to a previous batch file or something.
« Last Edit: April 21, 2008, 03:21:45 pm by efjayel »

gonzo90017

  • Trade Count: (+5)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1034
  • Last login:June 23, 2019, 02:41:07 pm
  • I'm a llama!
Re: Automatically Restarting a Front End
« Reply #2 on: April 21, 2008, 04:22:04 pm »
You know how the old saying goes. If it works....

Bill Mote

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 202
  • Last login:May 29, 2010, 11:04:28 pm
  • Focus on making things better not bigger.
    • Things That Make Me Mad and How To Fix Them
Re: Automatically Restarting a Front End
« Reply #3 on: April 21, 2008, 04:23:01 pm »
If it works tweak it?  :P

dot

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
Re: Automatically Restarting a Front End
« Reply #4 on: April 21, 2008, 04:51:00 pm »
Not sure how well FE's would work as a service, but you could try getting one of those "run app as a service" programs and set it to run your FE as a service. Then go into the services "properties" dialog and set it to interact with desktop (otherwise you will never see the FE). Finally you can tell it to restart if the process terminates in that same dialog.

This is assuming you're using XP.
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

Bill Mote

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 202
  • Last login:May 29, 2010, 11:04:28 pm
  • Focus on making things better not bigger.
    • Things That Make Me Mad and How To Fix Them
Re: Automatically Restarting a Front End
« Reply #5 on: April 21, 2008, 04:53:30 pm »
M$ provides the SRVANY and I've used it many times in the past.  I guess I could give that a try ...

dot

Havok

  • Keeper of the __Blue_Stars___
  • Trade Count: (+17)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4530
  • Last login:August 03, 2025, 02:34:22 am
  • Insufficient facts always invite danger.
Re: Automatically Restarting a Front End
« Reply #6 on: April 21, 2008, 08:45:53 pm »
I think the bigger question is why? Does it crash? My frontend always runs and I don't have to resort to that...

fjl

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1152
  • Last login:March 04, 2017, 10:14:04 pm
  • Pixels Rule!
Re: Automatically Restarting a Front End
« Reply #7 on: April 22, 2008, 03:59:08 am »
So my DOS batch file doesn't cut it?  ??? :'(
Why not?

protokatie

  • I DO try to be insulting and horrible to my fellow Terran
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1396
  • Last login:March 27, 2012, 09:36:43 pm
  • Is anyone here a member of team retard?
Re: Automatically Restarting a Front End
« Reply #8 on: April 22, 2008, 04:09:54 am »
Quote
I think the bigger question is why? Does it crash? My frontend always runs and I don't have to resort to that...

You hit it where the sun dont shine. I was thinking "These are cool ways to make sure a program always runs" then I was like "Wait a minute, why do I need this?"

If your front end and or mame is failing regularly enough that you need an autorestart then you have more serious problems than scripting and batch files...

(Still interesting tho)
--- Yes I AM doing this on purpose, and yes I DO realize it is pissing you off.

---If my computers were cats, my place would look like an old widows house, with half of the cats having obvious health problems

protokatie

  • I DO try to be insulting and horrible to my fellow Terran
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1396
  • Last login:March 27, 2012, 09:36:43 pm
  • Is anyone here a member of team retard?
Re: Automatically Restarting a Front End
« Reply #9 on: April 22, 2008, 04:20:12 am »
Quote
So my DOS batch file doesn't cut it?

Another double post... By me.

Yes it works, but it shouldnt be needed. Also "So my DOS batch file doesn't cut it?" should be made to be your title by Saint. ;)

BTW, when I was an Amiga fan, I was big on AREXX, so I feel your pain.
--- Yes I AM doing this on purpose, and yes I DO realize it is pissing you off.

---If my computers were cats, my place would look like an old widows house, with half of the cats having obvious health problems

Ginsu Victim

  • Yeah, owning a MAME cab only leads to owning real ones. MAME just isn't good enough. It's a gateway drug.
  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 10092
  • Last login:June 28, 2025, 10:45:55 pm
  • Comanche, OK -- USA
Re: Automatically Restarting a Front End
« Reply #10 on: April 22, 2008, 08:15:57 am »
this would've been nice to know when mamewah was always crashing me on, but I found the bug and squashed it.

Still, it's a good temporary fix.

Better than nothing.

Here's my question: Say I load a game in MAME that doesn't work and freezes when I load it (there are a few). Is there a way to set a program to automatically close if it's not responding? (Using FastMAME .84)

Bill Mote

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 202
  • Last login:May 29, 2010, 11:04:28 pm
  • Focus on making things better not bigger.
    • Things That Make Me Mad and How To Fix Them
Re: Automatically Restarting a Front End
« Reply #11 on: April 22, 2008, 10:38:19 am »
Why you ask?  :)  I have lots of kids using my cab.  They *always* hit the EXIT button too many times and end up at a blank black screen because MAMEWah is my OS shell.  Then I either have to open the coin door and pull out the keyboard or I have to VNC into the cab.  Both ruin the magic for those standing around ;)

MAMEWah has never crashed on my cab that I'm aware of.  It's just kids aged 3-14 that are causing the exits!  LOL

dot

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
Re: Automatically Restarting a Front End
« Reply #12 on: April 22, 2008, 11:20:57 am »
Surely you can disable exiting via the keyboard in mamewah? You can in mala, so for me that is a non-issue.
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

Stub

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 155
  • Last login:July 08, 2024, 10:48:14 am
  • Sensory Overload
Re: Automatically Restarting a Front End
« Reply #13 on: April 22, 2008, 11:45:58 am »
GameEx works nicely. I can configure what it allows. I can set up no exit, and power down only with a confirmation.

Ginsu Victim

  • Yeah, owning a MAME cab only leads to owning real ones. MAME just isn't good enough. It's a gateway drug.
  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 10092
  • Last login:June 28, 2025, 10:45:55 pm
  • Comanche, OK -- USA
Re: Automatically Restarting a Front End
« Reply #14 on: April 22, 2008, 11:52:56 am »
You can easily remap MAMEWAH to exit with a different method. I use a shifted button, which takes me to the options menu. I exit to windows from there.
The only other exit method I have is a hidden button on top of the cabinet that shuts down everything.

fjl

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1152
  • Last login:March 04, 2017, 10:14:04 pm
  • Pixels Rule!
Re: Automatically Restarting a Front End
« Reply #15 on: April 23, 2008, 03:11:20 am »
Surely you can disable exiting via the keyboard in mamewah? You can in mala, so for me that is a non-issue.

I completely disabled the "Exit Frontend" option.
No wait, let me rephrase that. It's remapped so it can only be done with the keyboard. Pressing Escape only has an effect on the current game being played which displays the Exit confirmation screen. On the Frontend, its not mapped so it does nothing. To exit they'd have to access the keyboard which only I can.

Bill Mote

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 202
  • Last login:May 29, 2010, 11:04:28 pm
  • Focus on making things better not bigger.
    • Things That Make Me Mad and How To Fix Them
Re: Automatically Restarting a Front End
« Reply #16 on: April 23, 2008, 07:24:03 am »
Thanks for the suggestions.  I'll look at my config and adjust ;)

dot

Havok

  • Keeper of the __Blue_Stars___
  • Trade Count: (+17)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4530
  • Last login:August 03, 2025, 02:34:22 am
  • Insufficient facts always invite danger.
Re: Automatically Restarting a Front End
« Reply #17 on: April 23, 2008, 08:08:07 am »
There you go - it's always good to ask why. Now you will have a better setup, avoid the kludge!

(+_+)

  • Let me splain.
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 652
  • Last login:July 27, 2012, 09:00:32 pm
  • For I am ]{eyser Soze
Re: Automatically Restarting a Front End
« Reply #18 on: April 23, 2008, 01:59:32 pm »
The easy way, although not always evident, is the best way. Leading down the track you were going with firedaemon, you would have to ask what's going to watch firedaemon to make sure it doesn't crash and so on...

This plan is so perfect, it's retarded. -- Peter Family Guy