5.6.162 Compilation Issues

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 4 years and 10 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
DavidSunter
Posts: 7
Last visit: Tue Aug 15, 2023 3:05 am

5.6.162 Compilation Issues

Post by DavidSunter »

Product, version and build: PowerShell Studio 2019 5.6.162
32 or 64 bit version of product: 64 bit
Operating system: Windows 10 1709 16299.1087
32 or 64 bit OS: 64 bit

We have a compiled form that has a param block at the very start of the psf file, which allows us to call the executable and pass arguments on the command line. Some of these parameters are assigned default values, e.g. [string]$PatchWeek = "1"
Since moving from 5.6.160 to 5.6.162, (we skipped 161 so not sure if the issue was in that build also), the executable no longer works and we get this error:
  1. At line:742 char:23
  2. +     [string]$PatchWeek = "1",
  3. +                          ~~~
  4. The assignment expression is not valid. The input to an assignment operator must be an object that is able to accept assignments, such as a variable or a property.
For now, we have rolled back to 160 and are able to successfully compile/execute again but can this be looked in to as it prevents us from moving to newer PSS builds?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: 5.6.162 Compilation Issues

Post by Alexander Riedel »

It's likely caused by the injection of assigning the $ScriptRoot variable that was request.
Unfortunately, as code injection goes, there is always a case where it gets put in the wrong place.
Please send or post your exact param block so we can trace what happened and fix it.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
DavidSunter
Posts: 7
Last visit: Tue Aug 15, 2023 3:05 am

Re: 5.6.162 Compilation Issues

Post by DavidSunter »

Create a new form and add the following to the script:
  1. param
  2. (
  3.     [Parameter(Position = 0)]
  4.     [string]$TestString,
  5.     [string]$PatchWeek = "1",
  6.     [string]$TestString2 = "DefaultValue"
  7. )
  8.  
  9.  
  10. $form1_Load={
  11.     Write-Host $TestString2
  12.    
  13. }
Package the form using 'SAPIEN PowerShell V5 Host (Command line).
Open a PowerShell window and launch the compiled executable and you will hit the error:
  1. PS C:\Users\*******\Documents\SAPIEN\PowerShell Studio\Files\bin\x64> .\DemoFormParam.exe
  2. Line 38: At line:37 char:23
  3. +     [string]$PatchWeek = "1",
  4. +                          ~~~
  5. The assignment expression is not valid. The input to an assignment operator must be an object that is able to accept assignments, such as a variable or a property.
If you want me to upload a demo project, just let me know
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: 5.6.162 Compilation Issues

Post by Alexander Riedel »

I'll have someone look into it.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: 5.6.162 Compilation Issues

Post by Alexander Riedel »

Make a backup of the current PSBuild.exe in your PowerShell Studio install folder.
Replace with the file attached here and see if that helps.
Attachments
PSBuild.zip
(184.95 KiB) Downloaded 104 times
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
DavidSunter
Posts: 7
Last visit: Tue Aug 15, 2023 3:05 am

Re: 5.6.162 Compilation Issues

Post by DavidSunter »

Sorry for the delay in testing this, I've been tied up with other things.
I've just tested now and can confirm that our script is working again with the provided psbuild.exe. Do you know if this fix will be included in a future release?

Thanks
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: 5.6.162 Compilation Issues

Post by Alexander Riedel »

Of course. A new build containing the fix is currently in QA and scheduled to be released soon.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: 5.6.162 Compilation Issues

Post by davidc »

The v5.6.163 service build has been released. Please let us know if the issue persists.
David
SAPIEN Technologies, Inc.
This topic is 4 years and 10 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.