topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday October 9, 2024, 5:11 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Command-line option starts a new instance of SC  (Read 7925 times)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Command-line option starts a new instance of SC
« on: April 14, 2014, 07:23 AM »
i have a shortcut on my desktop with the following command, "<path>\ScreenshotCaptor.exe -scan". whenever i click this shortcut to initiate a scan, SC gets launched in a new instance and only then the scan command is carried out. in the end, i end up with two SC icons in the system tray. is there a setting to avoid this? thanks!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #1 on: April 14, 2014, 07:28 AM »
does that still happen even with the new beta?

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #2 on: April 14, 2014, 07:40 AM »
yes, it still happens with the new beta. sorry, forgot to mention that in the first post.

btw, i am using win7 pro 32-bit.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #3 on: April 14, 2014, 07:44 AM »
Assuming you are sure its launching the same ScreenshotCaptor.exe location as is already running (i.e. not two different versions of SC installed in different locations), then this is a bug, and I will look into it today and try to fix right away.
It shouldn't be launching a second instance.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #4 on: April 14, 2014, 07:52 AM »
i have only 1 ScreenshotCaptor.exe in the whole of the drive C:\ or "Everything" is lying.. :)

Spoiler


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #5 on: April 14, 2014, 08:00 AM »
Ok, I'm on it.

Oh, you could do a test for me -- can you make another shortcut to a second instance with NO commandline parameters -- and tell me if it launches a second instance in that case?

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #6 on: April 14, 2014, 08:27 AM »
ah, yes.. even without a command-line option, a new instance is launched..

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #7 on: April 14, 2014, 08:34 AM »
Ok that's a big clue.  That does *not* happen here (Win 7).
So it seems to me you are experiencing a generic non-specific failure of the single-instance behavior of SC.

Now the question is why.

1. Can anyone else test and see what behavior they see?
2. Lanux -- in your original post you say you end up with 2 instances in tray.  Can I ask you to elaborate? Do you end up with 2 separate copies of the program running? Or just 2 system tray icons?
3. Lanux, can you see if the same behavior happens if you EXIT all running instances, and then start them both up (let the first fully start before launching second) with your new shortcut?

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #8 on: April 14, 2014, 09:03 AM »
2. Lanux -- in your original post you say you end up with 2 instances in tray.  Can I ask you to elaborate? Do you end up with 2 separate copies of the program running? Or just 2 system tray icons?

i get two separate copies as can be seen in this screenshot below.
Spoiler



3. Lanux, can you see if the same behavior happens if you EXIT all running instances, and then start them both up (let the first fully start before launching second) with your new shortcut?

the behaviour persists even after exiting both instances and re-starting again.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #9 on: April 14, 2014, 09:09 AM »
How strange. Ok i'm looking into it now.

Can anyone else confirm that they get 2 instances or whether their installation properly limits it to a single instance?
My XP and Win7 installs both behave properly.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #10 on: April 14, 2014, 09:18 AM »
by any chance, does SC have any option like the one in the image below, which i may have inadvertently turned it off/on?

Spoiler



bob99

  • Supporting Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 345
    • View Profile
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #11 on: April 14, 2014, 09:30 AM »
With SC already running and using the run command I get the "Hello there! You've tried to launch a new copy..." popup. I got a UAC popup 1st asking if I wanted it to run.

I'm on Win 7 Pro, x64 machine. SC is installed in the x86 program files folder.

Edit
Should have told you I'm still running V4.8. Haven't installed the beta yet.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #12 on: April 14, 2014, 09:33 AM »
With SC already running and using the run command I get the "Hello there! You've tried to launch a new copy..." popup. I got a UAC popup 1st asking if I wanted it to run.

thanks bob -- so your single-instance detection is working correctly.
ps. the new beta does away with that "hello there" message.

bob99

  • Supporting Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 345
    • View Profile
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #13 on: April 14, 2014, 09:35 AM »
With SC already running and using the run command I get the "Hello there! You've tried to launch a new copy..." popup. I got a UAC popup 1st asking if I wanted it to run.

thanks bob -- so your single-instance detection is working correctly.
ps. the new beta does away with that "hello there" message.

Just tried it again. Same result. Single instance popup.

bob99

  • Supporting Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 345
    • View Profile
    • Donate to Member
Re: Command-line option starts a new instance of SC
« Reply #14 on: April 14, 2014, 09:47 AM »
thanks bob -- so your single-instance detection is working correctly.
ps. the new beta does away with that "hello there" message.

There's probably some other reason you are taking out the "Hello there" message. But it never bothered me. Actually I kind of liked the reminder I had it already running. Sometimes some of my tray icons disappear for seemingly no reason. In my case it kept me from having two instances running.