PrimalScript hangs on any edit

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 1 year 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
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

Re: PrimalScript hangs on any edit

Post by Alexander Riedel »

I’d like to chime in here too. You indicated that you get crashes when attempting to sign a script. That is not something normal (is a crash ever?). While there are certificates which are not compatible with the authenticode API, it is rare.
A failure to sign is usually caught and reported as such, not a crash.
There is also an option to use an external signing tool in such cases so this should not have kept you from signing your scripts.
If you have the file browser active, which parses files and also checks digital signatures, this could be the root problem.
While we look into other options, please let us know:
Who issued your certificate?
What time stamp server to you use?
How do you sign your scripts now?
Is this certificate and scripts signed with it present on all three computers?
And would you be able to sign some simple nonsense script and send that to us?

Thanks.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
DiZzyDmon
Posts: 73
Last visit: Thu Feb 29, 2024 8:01 am
Has voted: 1 time

Re: PrimalScript hangs on any edit

Post by DiZzyDmon »

(1) Who issued your certificate?
Entrust (Entrust Code Signing CA - OVCS2)
The certificate is embedded on a USB token, processed through "SafeNet Authentication Client" software when invoked (screenshot "SafeNet Authentication Client script signing dialog.png" attached).
This is the only method that Entrust allows - they no longer allow use of a file-based certificate.

(2) What time stamp server to you use?
http://timestamp.globalsign.com/scripts ... ature=sha2

(3) How do you sign your scripts now?
Using PrimalScript's "Sign script" feature (screenshot "PrimalScript Script Signing settings.png" attached).

(4) Is this certificate and scripts signed with it present on all three computers?
The certificate is present on my two corporate-owned computers, installed as a computer (not user) certificate, in the "Personal" store.
I only installed PrimalScript on my personally-owned computer for a few minutes to test.

(5) And would you be able to sign some simple nonsense script and send that to us?
File "blerft.ps1" attached.
I was able to sign this script on my first attempt - program did not crash.

The program doesn't always crash on script signing.
It only happens for the first script I sign during the first launch of PrimalScript in a new Windows logon session.
Once I get past one or two program crashes, if I leave PrimalScript open after successfully signing one file, I can sign as many scripts thereafter as I like without any problem (until I close PrimalScript or log off my computer).

I've lived with this for several years, ever since Entrust forced us to move to USB token certificates.
I doubt it's anything you can solve.
Attachments
SafeNet Authentication Client script signing dialog.png
SafeNet Authentication Client script signing dialog.png (13.89 KiB) Viewed 24655 times
PrimalScript Script Signing settings.png
PrimalScript Script Signing settings.png (48.64 KiB) Viewed 24655 times
blerft.ps1
(34.85 KiB) Downloaded 644 times
User avatar
DiZzyDmon
Posts: 73
Last visit: Thu Feb 29, 2024 8:01 am
Has voted: 1 time

Re: PrimalScript hangs on any edit

Post by DiZzyDmon »

At your request I uninstalled version 8.0.173, installed 8.0.168.
I opened a bunch of scripts, tried my best to put in garbage code that would confuse the program.
So far I the program is not hanging ever.
I went ahead and re-enabled Options > Text Editor > PrimalSense > Enable live syntax check.
Did some more editing in PrimalScript, no problems so far.
I will keep at it for a week or so, see how it goes.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

Re: PrimalScript hangs on any edit

Post by Alexander Riedel »

Ok, thank you for the detailed information. Once I get back I will see what changed in the builds in between code wise and I will try to see what I can find out about entrust. Maybe I can talk them into giving us a certificate for testing.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

Re: PrimalScript hangs on any edit

Post by Alexander Riedel »

I have contacted Entrust and, as you may have expected, got nowhere. They have expressed that they do not work with other vendors in not so many words and suggested you should contact THEIR support in this matter.
I will look further into it as soon as I can, since at the very least you should not experience any crash. On the freezing issue I am still not sure what could cause that on your side.
I will be back in office after the 21st, hopefully we can find out what’s going on then.
That is assuming you are willing to do some experiments as we cannot replicate this here.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
DiZzyDmon
Posts: 73
Last visit: Thu Feb 29, 2024 8:01 am
Has voted: 1 time

Re: PrimalScript hangs on any edit

Post by DiZzyDmon »

Regarding the delays in entered text:
I have been busy on other things today, have not done any work in PrimalScript. But after downgrading both of my corporate-owned computers to version 8.0.168, I now only get very brief (and acceptable) delays editing my largest scripts when they're sitting on a network share. If I type a bunch of garbage really fast, the whole program crashes - I think it's because the syntax checker gets overloaded. None of this is worth worrying about. 8.0.168 was released June 23 this year. It felt like I've been experiencing this problem for more than a year, but maybe it's just been a long year ;)

Regarding the program crashes on first use of Entrust code signing certificate:
I appreciate your diligence and am willing to try (almost) anything you want, but I don't think this is worth much effort. Entrust has made sure that it's really complicated to use their code signing certificate. That along with all the security and management tools constantly monitoring our company computers makes it easy to understand why confusion can set in along the way. I don't find this to be a particularly worrisome issue (I had never opened a topic on it).
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

Re: PrimalScript hangs on any edit

Post by Alexander Riedel »

There should be no delay when typing, specially when it is not PowerShell. The live syntax checker is on a separate thread should have zero influence. If this was normal, a lot of people would scream. We will find out what it is, eventually :D
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

Re: PrimalScript hangs on any edit

Post by Alexander Riedel »

I went through builds 168 to 173 today to see if there is anything that was changed that might affect this.
The one thing that *could* have had an impact was the UI lib but I verified that this has not changed between these versions.
There were two PowerShell parser changes, but as you implied this affects other file types as well, this cannot possibly be the cause.
I found no machine here, ranging from Windows 7 (Don't ask) to Windows 11 that would exhibit such a behavior.
That leads me to believe there is an interaction with something else in your environment.
This could be another software that forced a Visual Studio runtime update, something that logs keystrokes (don't laugh, with remote working this is surprisingly common)
keyboard drivers and a bunch of other things I probably cannot even think of.

So, the first test would be to install the new 2023 version due out soon. It has a new UI lib version, uses an updated Visual Studio runtime, was built with a newer compiler
and has some other improvements that may or may not impact this.

If all these changes have no discernible effect, and you are willing, I would ask that you provide us with a list of installed software and their versions as well as running processes
that exist on both your machines. I also have some other tests we can perform, all of them quick, so they should not occupy your time too much.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
DiZzyDmon
Posts: 73
Last visit: Thu Feb 29, 2024 8:01 am
Has voted: 1 time

Re: PrimalScript hangs on any edit

Post by DiZzyDmon »

On Monday (2023-01-09) I upgraded all the SAPIEN software I use on my laptop to version 2023, including PrimalScript 8.1.174.0. I've been using the software for a week, have had no lags or crashes with this new version.

One downside, though - right-clicking a file and clicking "Edit with Primal Script" no longer works. SendToPS.exe appears in Task Manager, but the file doesn't open in PrimalScript. This occurs whether or not I already have PrimalScript open. I can drag files into an open PrimalScript window and use PrimalScript's File > Open dialog just fine. Should I open a separate topic for this new issue?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 20
Been upvoted: 37 times

Re: PrimalScript hangs on any edit

Post by Alexander Riedel »

Probably someone (and that is likely me) forgot to change one location where it should now say 2023 instead of 2022 :D
Or something like that. I will ask QA to file a bug
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 1 year 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.