SnapStream Forums

Go Back   SnapStream Forums > Archive > Beyond Media User-to-User Troubleshooting & Support Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-07-2009, 11:28 AM
scottlindner's Avatar
Registered User
 
Join Date: Jun 2005
Location: Colorado Springs
Posts: 720
On Exit Script?

Is it possible to run a script when I exit the BM application? I suspect I need to change or add something to the Exit option in the Menus.xml file but I'm not exactly sure how to do it. I still want BM to exit, I just want to do something else when it does.

For reference. I want to run a script that unmounts all Daemon Tools from network shares so the HTPC will hibernate.

Scott
__________________
Uneed X11 (black)
Seasonic S12-430
Foxconn A7GM-S
AMD Athlon 64 X2 5050e Brisbane 2.6GHz
SAPPHIRE 100252HDMI Radeon HD 4550
OCZ Platinum 4GB (2 x 2GB) DDR2 1066
BenQ DW1620 DL DVD-RW
Seagate Barracuda 7200.11 ST31500341AS 1.5TB
Harmony H688 (black)
2x HD HomeRun
Beyond Media 1.1.2
BeyondTV 4.9.1
Windows XP SP3
Sony 52XBR4

Last edited by scottlindner; 03-07-2009 at 11:34 AM.
Reply With Quote
  #2 (permalink)  
Old 03-09-2009, 03:53 PM
Registered User
 
Join Date: Aug 2007
Posts: 18
Re: On Exit Script?

I too would be interested in this. I always start Beyond Media with my Firefly remote. I was thinking about changeing the mapping of the firefly button in the default.xml, or whichever is the default profile for Firefly, so that the button starts a batch file that uploads the dvd library files to a network location. Then I would have a different batch file on my link machines, also running BM and have it download the dvd library files before launching BM. This seems possible, I just haven't looked into it.

I'm also interested in saving power so what you described above is also of interest to me.

Thanks
Reply With Quote
  #3 (permalink)  
Old 03-09-2009, 04:16 PM
TomXP411's Avatar
Registered User
 
Join Date: Jul 2006
Location: Southern California
Posts: 880
Send a message via Skype™ to TomXP411
Re: On Exit Script?

Quote:
Originally Posted by scottlindner View Post
Is it possible to run a script when I exit the BM application? I suspect I need to change or add something to the Exit option in the Menus.xml file but I'm not exactly sure how to do it. I still want BM to exit, I just want to do something else when it does.

For reference. I want to run a script that unmounts all Daemon Tools from network shares so the HTPC will hibernate.

Scott
If you can't figure out how to tie one in directly, you could do it with EventGhost. (there are several events related to tasks: created, destroyed, focus, etc.)

I use EG's focus event to auto-switch my receiver to the digital input when I start PowerDVD. When PowerDVD goes out of focus, it switches back to analog audio automatically.
__________________
HTPC
BTV ◦ Phenom x4 9850 ◦ Gigabyte GA-78GM Mobo ◦ 4 GB ◦ XP SP2 1TB SATA, 250GB SATA, 80GB EIDE ◦ HVR 2250 (QAM+Analog) ◦ 2x HVR-1950 ◦ SA 4250 cable box ◦ GeForce 9600 ◦ 32" LCD TV ◦ Lite-On SATA DVD-RW ◦ Gyration Media Remote & Mini Wireless KB ◦ Via 7.1 sound card w/SP-DIF
Reply With Quote
  #4 (permalink)  
Old 03-15-2009, 08:08 AM
scottlindner's Avatar
Registered User
 
Join Date: Jun 2005
Location: Colorado Springs
Posts: 720
Re: On Exit Script?

Quote:
Originally Posted by TomXP411 View Post
If you can't figure out how to tie one in directly, you could do it with EventGhost. (there are several events related to tasks: created, destroyed, focus, etc.)

I use EG's focus event to auto-switch my receiver to the digital input when I start PowerDVD. When PowerDVD goes out of focus, it switches back to analog audio automatically.
I suspect it's possible to do it directly from the Menus.xml file. Here's what I'm looking at.
Quote:
<MenuItem Label="Exit" Command="Application.Exit" Image="SSBM_MainMenu_Exit" />
Where another familiar menu items runs a command line script
Quote:
<MenuItem Id="BeyondTV" Label="Beyond TV" Image="SSBM_MainMenu_TV">
<MenuItem.Action>
<LaunchApplication CommandLine="/beyondmedia /displaymode #DISPLAYMODE# /mode #DISPLAYMODE# /xpos #XPOSITION# /ypos #YPOSITION# /width #WIDTH# /height #HEIGHT# /border #BORDER#">
<LaunchApplication.Directory>
<RegistryStringValue BaseKey="LocalMachine" SubKey="SOFTWARE\SnapStream Media\Beyond TV" ValueName="InstallDir" />
</LaunchApplication.Directory>
<LaunchApplication.Executable>
<RegistryStringValue BaseKey="LocalMachine" SubKey="SOFTWARE\SnapStream Media\Beyond TV" ValueName="GUIExecutable" />
</LaunchApplication.Executable>
</LaunchApplication>
</MenuItem.Action>
</MenuItem>
The only difference that is causing me to ask the question is that I still want BM to exit where it appears in the example that uses the LaunchApplication tag that it choose either a BM action or break out to a command line. I'm wondering if it's possible to do both? I guess I could always try adding two different action tags under MenuItem.Action and see if BM can swing it. Let me do a little testing and I'll post back.

Scott
__________________
Uneed X11 (black)
Seasonic S12-430
Foxconn A7GM-S
AMD Athlon 64 X2 5050e Brisbane 2.6GHz
SAPPHIRE 100252HDMI Radeon HD 4550
OCZ Platinum 4GB (2 x 2GB) DDR2 1066
BenQ DW1620 DL DVD-RW
Seagate Barracuda 7200.11 ST31500341AS 1.5TB
Harmony H688 (black)
2x HD HomeRun
Beyond Media 1.1.2
BeyondTV 4.9.1
Windows XP SP3
Sony 52XBR4
Reply With Quote
  #5 (permalink)  
Old 03-25-2009, 05:33 PM
scottlindner's Avatar
Registered User
 
Join Date: Jun 2005
Location: Colorado Springs
Posts: 720
Re: On Exit Script?

This isn't elegant but I have a solution that works. I can now watch a network based ISO using Daemon Tools to mount it and when I exit Beyond Media the HTPC will hibernate as it is supposed to. This works because when I Exit BM it is first unmounting the ISO in Daemon Tools to release the network resource so XP will hibernate. Here's how I did it.

First thing is to create a simple command line script and save it into the BM program folder, C:\Program Files\SnapStream Media\Beyond Media\
existscript.cmd
Quote:
"C:\Program Files\D-Tools\daemon.exe" -unmount 0
tskill SSBeyondMedia
Next, it appears the Menus.xml file in BM requires all of the information to come from the registry so you need to add a key in the registry that tells us where to find this exit script.
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\SnapStream Media\Beyond Media add the key "ExitScript" as a string with the value of "exitscript.cmd". We can already get the BM program directory from the InstallDir key.

Finally, we need to modify the C:\Documents and Settings\All Users\Application Data\SnapStream\Beyond Media\Menus.xml file to use this new exist script to close BM and unmount the ISO instead of the built in programmatic function to close BM. Find the following tag
Quote:
<MenuItem Label="Exit" Command="Application.Exit" Image="SSBM_MainMenu_Exit" />
and replace it with
Quote:
<MenuItem Label="Exit" Command="Application.Exit" Image="SSBM_MainMenu_Exit">
<MenuItem.Action>
<LaunchApplication>
<LaunchApplication.Directory>
<RegistryStringValue BaseKey="LocalMachine" SubKey="SOFTWARE\SnapStream Media\Beyond Media" ValueName="InstallDir" />
</LaunchApplication.Directory>
<LaunchApplication.Executable>
<RegistryStringValue BaseKey="LocalMachine" SubKey="SOFTWARE\SnapStream Media\Beyond Media" ValueName="ExitScript" />
</LaunchApplication.Executable>
</LaunchApplication>
</MenuItem.Action>
</MenuItem>
This should do the trick. The only issue I see with it is it's killing the process rather than gracefully attempting to close BM. If you know of a better way to close BM please let me know.

Cheers,
Scott
__________________
Uneed X11 (black)
Seasonic S12-430
Foxconn A7GM-S
AMD Athlon 64 X2 5050e Brisbane 2.6GHz
SAPPHIRE 100252HDMI Radeon HD 4550
OCZ Platinum 4GB (2 x 2GB) DDR2 1066
BenQ DW1620 DL DVD-RW
Seagate Barracuda 7200.11 ST31500341AS 1.5TB
Harmony H688 (black)
2x HD HomeRun
Beyond Media 1.1.2
BeyondTV 4.9.1
Windows XP SP3
Sony 52XBR4

Last edited by scottlindner; 03-25-2009 at 05:36 PM.
Reply With Quote
  #6 (permalink)  
Old 03-25-2009, 08:23 PM
scottlindner's Avatar
Registered User
 
Join Date: Jun 2005
Location: Colorado Springs
Posts: 720
Re: On Exit Script?

Using tskill to shut down BM isn't a good idea. I need to find another way. Any changes you make.. as in *any* changes you make will not be kept if you exit it this way. Obviously BM doesn't save changes until on exit. I will keep digging for a solution to this. Seems like I'm so close.

Scott
__________________
Uneed X11 (black)
Seasonic S12-430
Foxconn A7GM-S
AMD Athlon 64 X2 5050e Brisbane 2.6GHz
SAPPHIRE 100252HDMI Radeon HD 4550
OCZ Platinum 4GB (2 x 2GB) DDR2 1066
BenQ DW1620 DL DVD-RW
Seagate Barracuda 7200.11 ST31500341AS 1.5TB
Harmony H688 (black)
2x HD HomeRun
Beyond Media 1.1.2
BeyondTV 4.9.1
Windows XP SP3
Sony 52XBR4
Reply With Quote
  #7 (permalink)  
Old 03-26-2009, 04:08 PM
scottlindner's Avatar
Registered User
 
Join Date: Jun 2005
Location: Colorado Springs
Posts: 720
Re: On Exit Script?

I found that "taskkill" does gracefully shutdown BeyondMedia so settings are preserved. I have a fully working solution now. My exit script that works is
Quote:
"C:\Program Files\D-Tools\daemon.exe" -unmount 0
taskkill /IM SSBeyondMedia.exe
Everything else in my above post remains unchanged.
__________________
Uneed X11 (black)
Seasonic S12-430
Foxconn A7GM-S
AMD Athlon 64 X2 5050e Brisbane 2.6GHz
SAPPHIRE 100252HDMI Radeon HD 4550
OCZ Platinum 4GB (2 x 2GB) DDR2 1066
BenQ DW1620 DL DVD-RW
Seagate Barracuda 7200.11 ST31500341AS 1.5TB
Harmony H688 (black)
2x HD HomeRun
Beyond Media 1.1.2
BeyondTV 4.9.1
Windows XP SP3
Sony 52XBR4
Reply With Quote
  #8 (permalink)  
Old 03-27-2009, 10:55 AM
Registered User
 
Join Date: Aug 2007
Posts: 18
Re: On Exit Script?

Thanks, this looks great. I run Beyond Media on 3 BTV Link stations. I also use the DVD Library. I have a script that copies the content of the DVD Library Plugin folder to a central server location so I can sync all my libraries. I can use what you have done and modify the .cmd file to upload the library also. Since BM commits the changes to the database after it closes, I'm going to see if I can run the DVD library update after shutting down BM. I'll post my results.
__________________
HTPC Setup: Dell GX270 P42.66 | 2.0Gig memory | RocketRaid 1820a with 4 WD 500 SATA RAID 1 | WD 500 gig SATA system drive | Windows XP SP3 | Integrated sound | Radeon x1050 | Hauppauge HVR-950 USB hybrid tuners | Hauppauge HVR-1600 PCI tuner | BeyondTV 4.9 | Beyond Media w/ DVD Library | Roof Antenna | 22' Dell Monitor via DVI |
2 Link Machines: Both with Nvidia GeForce 6200 Low Profile | 1 Dell GX260 and 1 Dell GX270 both small form factor |
Reply With Quote
  #9 (permalink)  
Old 03-27-2009, 11:36 AM
scottlindner's Avatar
Registered User
 
Join Date: Jun 2005
Location: Colorado Springs
Posts: 720
Re: On Exit Script?

A trivial nit to add. You may want to change the properties for the CMD file so it runs minimized. Mine is currently popping up in front of BM for a second or two before it finishes.

It sounds like you have an entirely different purpose. For me, I needed to unmount all network resources so the machine would hibernate.

Keeping multiple BM's synchronized is another good reason. Are you using one as the master and this is the machine that you want to copy the files to another location after it shuts down? Then the other machines will copy from that location before they start up? I like it and might do the same myself.

Scott
__________________
Uneed X11 (black)
Seasonic S12-430
Foxconn A7GM-S
AMD Athlon 64 X2 5050e Brisbane 2.6GHz
SAPPHIRE 100252HDMI Radeon HD 4550
OCZ Platinum 4GB (2 x 2GB) DDR2 1066
BenQ DW1620 DL DVD-RW
Seagate Barracuda 7200.11 ST31500341AS 1.5TB
Harmony H688 (black)
2x HD HomeRun
Beyond Media 1.1.2
BeyondTV 4.9.1
Windows XP SP3
Sony 52XBR4
Reply With Quote
  #10 (permalink)  
Old 03-31-2009, 03:12 PM
Registered User
 
Join Date: Aug 2007
Posts: 18
Re: On Exit Script?

I too want to save power and have set up my machines hibernate. I actually have a shortcut on my bm menu that forces my 2 btv link machines to go into hibernate from the menu. I use one machine as the main machine which also runs btv. The motherboard has wake on lan capability so I would only want that one to standby, but I'd need to implement the script you put together to get it to go into standby automatically. I also use DaemonTools and I store the .iso files on a network drive. I know it can't standby while that disc is still mounted so I definately plan on impementing an on exit script for that. While I'm at it I will upload the dvd library info to a network location. On the other machines it would make sense to have it copy down the dvd library info on startup. I only used the shortcut to force the machines to hibernate because I coundn't figure out how to kill the daemon tools network connection. Now that you've come up with a solution, I might not even use the hibernate shortcut on my bm menu, instead, I'll just close the app and the machine should hibernate on it's own in a few minutes. The only missing piece is that you can't wake the machines with the Firefly remote. I've tried just about all the different posted solutions to make this work, and it just won't. In fact, I don't think anyone has actually made this work. So, I just have to walk across the room and hit the power button to start the machines and then I can use the remote for everything else.

thanks again for coming up with a method to implement this.
__________________
HTPC Setup: Dell GX270 P42.66 | 2.0Gig memory | RocketRaid 1820a with 4 WD 500 SATA RAID 1 | WD 500 gig SATA system drive | Windows XP SP3 | Integrated sound | Radeon x1050 | Hauppauge HVR-950 USB hybrid tuners | Hauppauge HVR-1600 PCI tuner | BeyondTV 4.9 | Beyond Media w/ DVD Library | Roof Antenna | 22' Dell Monitor via DVI |
2 Link Machines: Both with Nvidia GeForce 6200 Low Profile | 1 Dell GX260 and 1 Dell GX270 both small form factor |
Reply With Quote
  #11 (permalink)  
Old 04-01-2009, 05:12 PM
scottlindner's Avatar
Registered User
 
Join Date: Jun 2005
Location: Colorado Springs
Posts: 720
Re: On Exit Script?

Quote:
Originally Posted by AmandaPlaywythe View Post
I too want to save power and have set up my machines hibernate. I actually have a shortcut on my bm menu that forces my 2 btv link machines to go into hibernate from the menu. I use one machine as the main machine which also runs btv. The motherboard has wake on lan capability so I would only want that one to standby, but I'd need to implement the script you put together to get it to go into standby automatically. I also use DaemonTools and I store the .iso files on a network drive. I know it can't standby while that disc is still mounted so I definately plan on impementing an on exit script for that. While I'm at it I will upload the dvd library info to a network location. On the other machines it would make sense to have it copy down the dvd library info on startup. I only used the shortcut to force the machines to hibernate because I coundn't figure out how to kill the daemon tools network connection. Now that you've come up with a solution, I might not even use the hibernate shortcut on my bm menu, instead, I'll just close the app and the machine should hibernate on it's own in a few minutes. The only missing piece is that you can't wake the machines with the Firefly remote. I've tried just about all the different posted solutions to make this work, and it just won't. In fact, I don't think anyone has actually made this work. So, I just have to walk across the room and hit the power button to start the machines and then I can use the remote for everything else.

thanks again for coming up with a method to implement this.
My machine will wake from my remote, but I'm not using a FireFly. I'm using an IR Harmony remote. Is the FireFly IR or RF? The only way it can work on my machine is due to the IrDA module. It has a power tap and I even had to do my own hack into the power block connector to make it work. If you have an IrDA module that has the ability to power on a motherboard that is off, I can show you how to make it work.

Scott
__________________
Uneed X11 (black)
Seasonic S12-430
Foxconn A7GM-S
AMD Athlon 64 X2 5050e Brisbane 2.6GHz
SAPPHIRE 100252HDMI Radeon HD 4550
OCZ Platinum 4GB (2 x 2GB) DDR2 1066
BenQ DW1620 DL DVD-RW
Seagate Barracuda 7200.11 ST31500341AS 1.5TB
Harmony H688 (black)
2x HD HomeRun
Beyond Media 1.1.2
BeyondTV 4.9.1
Windows XP SP3
Sony 52XBR4
Reply With Quote
  #12 (permalink)  
Old 04-03-2009, 10:56 AM
Registered User
 
Join Date: Aug 2007
Posts: 18
Re: On Exit Script?

I implemented the exit script and edited it so it uploaded the dvd library. I was concerned about exiting bm from a script not updating the dvd library database, but it works fine. I did several tests last night. So now my BTV Server running BM uploads the dvd library to a network location on exit, as well as unmounting Daemon tools. I've configured the BTV Link stations to just unmount Daemon tools to ensure they will hibernate.

If anyone is interested, I'll post the batch files I created.

Next is to create a batch file to use when starting bm from my remote. This I will use on the BTV Link stations to the dvd library is updated prior to BM Startup. I'm going to experiment and I'll start a new thread for Startup Script with my results.

BTW Scottlindner, I'm very interested in starting my pc's from hibernate or standby with a remote. I have the RF firefly on my BTV Server and IR fireflys on my Link boxes.
__________________
HTPC Setup: Dell GX270 P42.66 | 2.0Gig memory | RocketRaid 1820a with 4 WD 500 SATA RAID 1 | WD 500 gig SATA system drive | Windows XP SP3 | Integrated sound | Radeon x1050 | Hauppauge HVR-950 USB hybrid tuners | Hauppauge HVR-1600 PCI tuner | BeyondTV 4.9 | Beyond Media w/ DVD Library | Roof Antenna | 22' Dell Monitor via DVI |
2 Link Machines: Both with Nvidia GeForce 6200 Low Profile | 1 Dell GX260 and 1 Dell GX270 both small form factor |
Reply With Quote
  #13 (permalink)  
Old 04-04-2009, 03:16 PM
scottlindner's Avatar
Registered User
 
Join Date: Jun 2005
Location: Colorado Springs
Posts: 720
Re: On Exit Script?

I'm glad it's working for you. I'm surprised I was the first to spend the time to figure this out.

As for waking a machine from hibernation from a remote control, the magic is in the IR or RF device connected to the PC. In my case, my IR device has a special power connectors built into it. The first is to tap power off the 24pin power block so it remains powered even when the motherboard is off. The second is to insert itself into the power switch so it can turn the PC on. How it works is you configure the IR code to power on the machine. If your IR devices don't have all of this, you either can't do it, or you'll need to buy an IR device that does have it.

Scott
__________________
Uneed X11 (black)
Seasonic S12-430
Foxconn A7GM-S
AMD Athlon 64 X2 5050e Brisbane 2.6GHz
SAPPHIRE 100252HDMI Radeon HD 4550
OCZ Platinum 4GB (2 x 2GB) DDR2 1066
BenQ DW1620 DL DVD-RW
Seagate Barracuda 7200.11 ST31500341AS 1.5TB
Harmony H688 (black)
2x HD HomeRun
Beyond Media 1.1.2
BeyondTV 4.9.1
Windows XP SP3
Sony 52XBR4
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically cut commercials! Cutads script posted here. Soundman SnapStream Discussion 23 10-08-2009 10:36 AM
Step by Step: Video fixing, Commercial Detection, and Removal. cmcquistion Beyond TV and Beyond TV Link 245 01-21-2009 04:24 PM
Hauppauge WinTV HVR 950 HELP!!!! Wont play if I EXIT BTV sbflinn Beyond TV and Beyond TV Link 1 09-27-2007 10:22 AM
ViewScape Exit confirmation popup jeeman Beyond TV and Beyond TV Link 2 06-15-2006 04:59 AM
script keyword recording questions about problems erichammer Development Discussion 4 12-26-2005 10:04 PM


All times are GMT -6. The time now is 03:54 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0 RC1
©2004-2006 Snapstream Media