PowerShell Studio opens multiple instances with "Allow Multiple Instances" option un-checked

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 11 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
shawnwestin
Posts: 59
Last visit: Mon Aug 14, 2023 7:21 am

PowerShell Studio opens multiple instances with "Allow Multiple Instances" option un-checked

Post by shawnwestin »

- Open PSStudio
- Home (tab) -> Windows -> Options -> General
-- Un-check "Allow Multiple Instances" option
- Close PSStudio
- Open PSStudio
- Open PSStudio

expected: 1 instance of PSStudio
actual: 2 instances of PSStudio

v3.1.13
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

PowerShell Studio opens multiple instances with "Allow Multiple Instances" option un-checked

Post by davidc »

The first application must be loaded before it takes affect. We will look at resolving this in the next service release.

David
David
SAPIEN Technologies, Inc.
User avatar
shawnwestin
Posts: 59
Last visit: Mon Aug 14, 2023 7:21 am

PowerShell Studio opens multiple instances with "Allow Multiple Instances" option un-checked

Post by shawnwestin »

Thanks.

Also note: the same behavior presents when opening a PS file from Windows Explorer where PSStudio is the default application.

A new instance of PSStudio opens with all the tabs that are open in the first instance plus the newly opened file. This is expected due to "Restore Open files on Startup" option, but magnifies the problem of having multiple instances.

Ex.
- Instance 1 has N tabs open
- Wait for Instance 1 to load
- Open fileX.ps1 in Windows Explorer (where PSStudio is default application)
- Instance 2 opens with N + 1 tabs
User avatar
shawnwestin
Posts: 59
Last visit: Mon Aug 14, 2023 7:21 am

PowerShell Studio opens multiple instances with "Allow Multiple Instances" option un-checked

Post by shawnwestin »

Update:
I have been using the file browser within Perforce, not Windows Explorer.

After two days PSStudio now behaves as expected (from Perforce file browser, PS files open in a single instance of PSStudio). I'm not sure what cuased the behavior to change.

After the behavior resolved from Perforce, I tested in Windows Explorer-
1) running the PSStudio executable directly, multiple times, results in only a single instance.
2) targeting a psm1 file to open with PSStudio prompted for admin credentials two times and referenced the installer file (first with C:pathtoinstaller /extractlzma, then with C:pathtoinstaller /deletelzma
- entering admin credential twice allowed PSStudio to open the file.
- repeating with a second PS file, entering admin credentials, then opened the file in the single instance of PSStudio
3) I resolved #2 by entering admin credentials to separately browse to a folder under the admin user that initially ran the PSStudio installer (C:UsersAdminUserDocumentsSAPIENPowerShell Studio 2012)
- multiple PS files now open in a single instance of PSStudio from Windows Explorer

v3.1.13 on Windows 7
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

PowerShell Studio opens multiple instances with "Allow Multiple Instances" option un-checked

Post by davidc »

It has to do with timing and if the application is already open. The next service release will mitigate duplicate instances issue.

David
David
SAPIEN Technologies, Inc.
User avatar
shawnwestin
Posts: 59
Last visit: Mon Aug 14, 2023 7:21 am

PowerShell Studio opens multiple instances with "Allow Multiple Instances" option un-checked

Post by shawnwestin »

I verified this is fixed in v3.1.15.

Thanks David!
This topic is 11 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.