Prevent error message when opening second instance of Yawcam
-
- Posts: 57
- Joined: Mon Dec 29, 2008 6:24 pm
Prevent error message when opening second instance of Yawcam
Is there any way of suppressing the error message "Another instance of Yawcam is already running. Do you want to start a second instance?"?
I am using 2 webcams streaming images to 2 different webpages and want them both to start automatically with windows startup without me having to press "OK" to start the second instance of Yawcam.
I am using 2 webcams streaming images to 2 different webpages and want them both to start automatically with windows startup without me having to press "OK" to start the second instance of Yawcam.
I made a small hack for this in a beta version:
Yawcam_BETA_2010-01-01.exe
Use this version and create a text file named "disablerunningcheck.txt". Place the text file in the directory ".yawcam" located at your home directory.
In windows vista or windows 7 this could typically be:
C:\Users\username\.yawcam
and in windows 2000 or windows xp:
C:\Documents and Settings\username\.yawcam
where username is the name of the account you are using.
If this is done, Yawcam will not check if other instances of Yawcam is running...
/malun
Yawcam_BETA_2010-01-01.exe
Use this version and create a text file named "disablerunningcheck.txt". Place the text file in the directory ".yawcam" located at your home directory.
In windows vista or windows 7 this could typically be:
C:\Users\username\.yawcam
and in windows 2000 or windows xp:
C:\Documents and Settings\username\.yawcam
where username is the name of the account you are using.
If this is done, Yawcam will not check if other instances of Yawcam is running...
/malun
-
- Posts: 57
- Joined: Mon Dec 29, 2008 6:24 pm
Thanks, malun - it works OK without the error message but I've found a couple of problems:
I open the first instance of Yawcam & I've set it up with camera #1 and all the appropriate settings for streaming port, text overlay, ftp upload etc. but when I open the second instance I get an error message saying "Yawcam cannot connect to the webcam. Please check that no other application is using it....." I then change the camera to #2 which is OK but I notice that all the settings for the first instance of Yawcam (camera, streaming port, text overlay, ftp upload etc.) are being used for the second instance hence the error message as the second instance is trying to use the same camera & settings as the first instance. It looks as if there is only one set of settings which is being used by both instances of Yawcam
The second problem is that I can't display any of the extra variables I've set up in the extravars folder, except for {temperature} whereas when using the old version I can show them OK in my text overlay
Any suggestions?
I open the first instance of Yawcam & I've set it up with camera #1 and all the appropriate settings for streaming port, text overlay, ftp upload etc. but when I open the second instance I get an error message saying "Yawcam cannot connect to the webcam. Please check that no other application is using it....." I then change the camera to #2 which is OK but I notice that all the settings for the first instance of Yawcam (camera, streaming port, text overlay, ftp upload etc.) are being used for the second instance hence the error message as the second instance is trying to use the same camera & settings as the first instance. It looks as if there is only one set of settings which is being used by both instances of Yawcam
The second problem is that I can't display any of the extra variables I've set up in the extravars folder, except for {temperature} whereas when using the old version I can show them OK in my text overlay
Any suggestions?
-
- Posts: 57
- Joined: Mon Dec 29, 2008 6:24 pm
Ah! I've discovered the problem - in the new version the extravars and the settings are now stored in the .Yawcam directory in Documents and Settings\Users directory not in the Program Files as before. As there's only one .Yawcam directory both instances have to use the same settings file whereas before each directory in Program Files had its own settings file. Any way round this malun? I suppose I could run my first instance as an earlier version of Yawcam with the settings in the Program Files and the second instance as the latest version which wouldn't give the warning message?
Yes, you are right, didn't think of that. Yawcam uses the settings located in the home directory for the user running Yawcam. There is however a workaround...
1) Install the first yawcam instance as usual and run it like usual.
2) Make a copy of the yawcam program directory (typically: C:\Program Files\Yawcam) and name the copy Yawcam2. You will now have two program directories for Yawcam:
C:\Program Files\Yawcam
and
C:\Program Files\Yawcam2
3) Create a new directory c:\yawcamsettings
4) Create a new directory c:\yawcamsettings\yawcam2
Now it's time to edit two files in here:
C:\Program Files\Yawcam2
If you are using windows xp or 2000 you can edit the files with notepad as usual, so jump to step 8 below.
If you are using windows vista or 7 you have to run the editor as an administrator, so continue at step 5.
5) Click on the windows start button and type "notepad" in the search field.
6) In the result list, right click on Notepad and choose "Run as administrator"
7) Now open the file in Notepad by clicking "File -> Open..." and browse to the file.
8) Edit the file C:\Program Files\Yawcam2\service_profile.cfg to contain one line like this:
C:\yawcamsettings\yawcam2
9) Edit the file C:\Program Files\Yawcam2\launcher.cfg
Add the word service on the last line. If it's correct the last line will end with: yawcam.Main service
10) Start the second instance of Yawcam by running:
C:\Program Files\Yawcam2\Yawcam.exe
This version will now use settings located here:
c:\yawcamsettings\yawcam2\.yawcam
Browse to this path and see that the .yawcam directry has been created.
11) You now want to create a text file disablerunningcheck.txt here:
c:\yawcamsettings\yawcam2\.yawcam\disablerunningcheck.txt
to get rid of the question when starting the second instance of Yawcam.
I hope the explanation was clear enough...
/malun
1) Install the first yawcam instance as usual and run it like usual.
2) Make a copy of the yawcam program directory (typically: C:\Program Files\Yawcam) and name the copy Yawcam2. You will now have two program directories for Yawcam:
C:\Program Files\Yawcam
and
C:\Program Files\Yawcam2
3) Create a new directory c:\yawcamsettings
4) Create a new directory c:\yawcamsettings\yawcam2
Now it's time to edit two files in here:
C:\Program Files\Yawcam2
If you are using windows xp or 2000 you can edit the files with notepad as usual, so jump to step 8 below.
If you are using windows vista or 7 you have to run the editor as an administrator, so continue at step 5.
5) Click on the windows start button and type "notepad" in the search field.
6) In the result list, right click on Notepad and choose "Run as administrator"
7) Now open the file in Notepad by clicking "File -> Open..." and browse to the file.
8) Edit the file C:\Program Files\Yawcam2\service_profile.cfg to contain one line like this:
C:\yawcamsettings\yawcam2
9) Edit the file C:\Program Files\Yawcam2\launcher.cfg
Add the word service on the last line. If it's correct the last line will end with: yawcam.Main service
10) Start the second instance of Yawcam by running:
C:\Program Files\Yawcam2\Yawcam.exe
This version will now use settings located here:
c:\yawcamsettings\yawcam2\.yawcam
Browse to this path and see that the .yawcam directry has been created.
11) You now want to create a text file disablerunningcheck.txt here:
c:\yawcamsettings\yawcam2\.yawcam\disablerunningcheck.txt
to get rid of the question when starting the second instance of Yawcam.
I hope the explanation was clear enough...
/malun
-
- Posts: 57
- Joined: Mon Dec 29, 2008 6:24 pm
Yes, that works fine thanks.
I've changed the location of the new yawcamsettings directory to the C:\Documents and Settings\User directory and modified the service_profile.cfg file appropriately rather than have it in the root directory just to "hide" it for my personal preference and it works just as well there.
I've also edited the tray icon file by putting a number 1 in it so I can see which icon relates to which running.
An excellent program!!
I've changed the location of the new yawcamsettings directory to the C:\Documents and Settings\User directory and modified the service_profile.cfg file appropriately rather than have it in the root directory just to "hide" it for my personal preference and it works just as well there.
I've also edited the tray icon file by putting a number 1 in it so I can see which icon relates to which running.
An excellent program!!
I have 2 cameras.malun wrote:Only one software can connect to the camera at the same time. (At least if it is a vfw or wdm device like a usb webcam)
Are you trying to connect multiple instances of yawcam to the same device?
What kind of camera is it?
/malun
Sweex NightCam 1,3M.
Works great with software like webcamxp.
Only when i run two. Its the first one that complains.malun wrote:So you are running two instances, and only one gives you the error message?
What happens if you only start instance nr. 2 and don't start instance nr. 1? Do you still get the error message, or does it only occur when you are running two instances simultaneously?
/malun
Do i need to add the "service"-stuff to the first instance?
Start 2 first and then 1: err msg at start.
Start 1 first and then 2: no err. msg.
If i go into settings and press OK i get the msg regardless of how i started the instances.
I need to change camera (same camera as always) every time to make it work again.