Issues with Sapien Script Packager

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 3 years and 9 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
odd@espedalen.me
Posts: 6
Last visit: Thu Nov 23, 2023 3:12 am

Issues with Sapien Script Packager

Post by odd@espedalen.me »

Product, version and build: PowerShell Studio 2020 V.5.7.179
32 or 64 bit version of product: 64 bit
Operating system: Windows 10 V.1809
32 or 64 bit OS:64 bit

HI,
I came a cross some issues With the Sapien Script Packager in PowerShell Studio 2020 V.5.7.179.

1. Files and Folder.
In the Create Shortcuts to: if you are using a long path, and you have multiple files, you can't se to the end of the path, to verify whitch file you want to make a shortcut for. See Picture.
I would also like to have a larger Files and Foldet DataGridView Controlbox.

2. Custom Actions/Argumants
In Arguments when you change any charakters in the filed, sometimes it will ignore the change. You have to do it 2 times to the change to be Applied.

3. Custom Actions/Argumants
Argumants don't Accept any white spaces in parameter og in path.
/FilePath "C:\Test\Test Ing\Test.file"
The white Space between Test and Ing is not allowed. Is this by design? If so, it should be changed.

Regards.
Odd,
Attachments
ShortCutTo.png
ShortCutTo.png (65.84 KiB) Viewed 2394 times
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Issues with Sapien Script Packager

Post by Alexander Riedel »

Thank you for your feedback. There is no provision for prohibiting space characters in any of these fields.
I was easily able to enter path names and arguments containing spaces for custom actions.
I was also not able to verify that a change to an argument would need to be applied twice. I will forward this to QA and see if they can find out more.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
odd@espedalen.me
Posts: 6
Last visit: Thu Nov 23, 2023 3:12 am

Re: Issues with Sapien Script Packager

Post by odd@espedalen.me »

HI Alexander,

Thank you for reply.
In the newest build of PSS 2020 I see you have change the DataGridView for Files and Folders and the ComboBox for ShortCut To. Very Good.

To correct my selfe, I didn't experiance any problem with space characters in the path it selv, but I did get problem with space characters in the filename.
My file name was like: *\Test-File - June-2020.ps1.... Now, the Custom Action didn't run. When I removed the Space, it run just fine.


I often have multiple instance of PowerShell studio open, I don't know if the have anything to do with argument would need to be applied twice, but it happens from time to time. Espessualy if I have had PSS 2020 open for a long time.
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Issues with Sapien Script Packager

Post by Alexander Riedel »

Because custom actions are executed in an external shell, quotes must generally be doubled up or any script receiving a file name parameter with a space in it must re-quote it.
If you pass a file name with a space to a custom action script, the shell removes quotes around arguments, but add the quoted sting as a single argument.
If then any part of your script must pass that file name to something else, it must be placed in quotes again.
It's a bit complicated, but shells have always worked like that. As a general rule it is always best to use file and folder names without spaces for any internal processes.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
odd@espedalen.me
Posts: 6
Last visit: Thu Nov 23, 2023 3:12 am

Re: Issues with Sapien Script Packager

Post by odd@espedalen.me »

HI,

OK I understand.
Another issue I forgot to mention, is that when I use a PowerShell script with PS1 extention as a Custom Action, the Custom Action will not run on computer with default ExecutionPolisy (Restricted). And I will not change the ExecutionPolisy on computers.
I understand that ExecutionPolisy must be change for PS script to run, but when I read some web sites, several claims that a PS1 script as a Custom Action will run without changing the ExecutionPolisy in. I had to package the PS1 to EXE to get them to run without problems. I tryed to use arguments to set a session ExecutionPolisy, but that didn't work. Isn't it possible to add or set ExecutionPolisy exclusion in a Custom Action?

This is what the default argument in a Custom Ation is:
“C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe” -NoLogo -NonInteractive -InputFormat None -NoProfile –File “<yourcustomactionscript>.ps1”
Can't you add -ExecutionPolicy RemoteSigned?

Regards
Odd,
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Re: Issues with Sapien Script Packager

Post by Alexander Riedel »

No, doing so by default would open a backdoor for malicious scripts. The script execution policy at any system has to be determined by whoever administrates the system, not by us overriding it.
It would be far too easy to manipulate a script embedded in an MSI file.
You can execute a script with that by adding your own override. If your script policy is set by group policy you may not be able to do so.
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 3 years and 9 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.