From Package to EXE File not work

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 11 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.
MIC-23145632
Posts: 14
Last visit: Tue Apr 28, 2020 11:25 pm

From Package to EXE File not work

Post by MIC-23145632 »

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your
Product: PowerShell Studio 2019 (64 Bit)
Build: v5.6.162
OS: Windows Server 2012 R2 Standard (64 Bit)
Build: v6.3.9600.0

*** Please add details and screenshots as needed below. ***
There is only one button, very simple.
EXE execution without any screen
Snipaste_2019-04-25_15-24-54.png
Snipaste_2019-04-25_15-24-54.png (10.94 KiB) Viewed 2945 times
  1. Line 61: At line:60 char:9
  2. +     $button¤¤¤åButton1 = New-Object 'System.Windows.Forms.Button'
  3. +            ~~~~~~~~~~~
  4. Unexpected token '¤¤¤åButton1' in expression or statement.
  5.  
  6. At line:105 char:29
  7. +     $form1.Controls.Add($button¤¤¤åButton1)
  8. +                                ~
  9. Missing ')' in method call.
  10.  
  11. At line:105 char:29
  12. +     $form1.Controls.Add($button¤¤¤åButton1)
  13. +                                ~~~~~~~~~~~
  14. Unexpected token '¤¤¤åButton1' in expression or statement.
  15.  
  16. At line:46 char:28
  17. + function Show-TestFrom_psf {
  18. +                            ~
  19. Missing closing '}' in statement block or type definition.
  20.  
  21. At line:105 char:40
  22. +     $form1.Controls.Add($button¤¤¤åButton1)
  23. +                                           ~
  24. Unexpected token ')' in expression or statement.
  25.  
  26. At line:115 char:9
  27. +     $button¤¤¤åButton1.Font = 'Microsoft Sans Serif, 15.75pt'
  28. +            ~~~~~~~~~~~~~~~~
  29. Unexpected token '¤¤¤åButton1.Font' in expression or statement.
  30.  
  31. At line:116 char:9
  32. +     $button¤¤¤åButton1.Location = '25, 40'
  33. +            ~~~~~~~~~~~~~~~~~~~~
  34. Unexpected token '¤¤¤åButton1.Location' in expression or statement.
  35.  
  36. At line:117 char:9
  37. +     $button¤¤¤åButton1.Name = 'button¤¤¤åButton1'
  38. +            ~~~~~~~~~~~~~~~~
  39. Unexpected token '¤¤¤åButton1.Name' in expression or statement.
  40.  
  41. At line:118 char:9
  42. +     $button¤¤¤åButton1.Size = '225, 117'
  43. +            ~~~~~~~~~~~~~~~~
  44. Unexpected token '¤¤¤åButton1.Size' in expression or statement.
  45.  
  46. At line:119 char:9
  47. +     $button¤¤¤åButton1.TabIndex = 0
  48. +            ~~~~~~~~~~~~~~~~~~~~
  49. Unexpected token '¤¤¤åButton1.TabIndex' in expression or statement.
  50.  
  51. Not all parse errors were reported.  Correct the reported errors and try again.
Attachments
TestFrom.psf.psbuild
(1.51 KiB) Downloaded 79 times
TestFrom.psf
(36.16 KiB) Downloaded 82 times
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: From Package to EXE File not work

Post by Alexander Riedel »

Please try switching your encoding to Unicode LE and see if that fixes the problem.
Alexander Riedel
SAPIEN Technologies, Inc.
MIC-23145632
Posts: 14
Last visit: Tue Apr 28, 2020 11:25 pm

Re: From Package to EXE File not work

Post by MIC-23145632 »

Alexander Riedel wrote: Thu Apr 25, 2019 6:58 am Please try switching your encoding to Unicode LE and see if that fixes the problem.
I tested unicode and used notepad++ to modify the encoding.
If it is unicode caused by why there is no error in the Run. Is there an error after the package is executed as an exe?
Snipaste_2019-04-25_22-21-01.png
Snipaste_2019-04-25_22-21-01.png (16.43 KiB) Viewed 2913 times
If you can't use the text directly, then this should be a big bug!
I have tried this version before. PowerShell Studio 2018 v5.5.152 has no problems.
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: From Package to EXE File not work

Post by Alexander Riedel »

You can switch the encoding in PowerShell Studio on the status bar.
The packager works internally with Unicode to add variable settings to your code for a recent feature request.
The round trip conversion in Windows from UTF-8 to Unicode to UTF-8 should work, but does not. So that's the bug you are seeing.
We are compensating and fixing it in the next service build.
There is however absolutely no harm in using Unicode files to begin with.
Alexander Riedel
SAPIEN Technologies, Inc.
MIC-23145632
Posts: 14
Last visit: Tue Apr 28, 2020 11:25 pm

Re: From Package to EXE File not work

Post by MIC-23145632 »

Alexander Riedel wrote: Thu Apr 25, 2019 7:26 am You can switch the encoding in PowerShell Studio on the status bar.
The packager works internally with Unicode to add variable settings to your code for a recent feature request.
The round trip conversion in Windows from UTF-8 to Unicode to UTF-8 should work, but does not. So that's the bug you are seeing.
We are compensating and fixing it in the next service build.
There is however absolutely no harm in using Unicode files to begin with.
How do I know the code I am using now?

I can't find the conversion code in the status column.
Snipaste_2019-04-25_22-34-44.png
Snipaste_2019-04-25_22-34-44.png (74.45 KiB) Viewed 2907 times
Snipaste_2019-04-25_22-36-14.png
Snipaste_2019-04-25_22-36-14.png (31.72 KiB) Viewed 2907 times
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Re: From Package to EXE File not work

Post by Alexander Riedel »

Here:
SPS Encoding.png
SPS Encoding.png (34.03 KiB) Viewed 2905 times
Unicode is UTF-16 LE, in case you are not familiar with encodings
Alexander Riedel
SAPIEN Technologies, Inc.
MIC-23145632
Posts: 14
Last visit: Tue Apr 28, 2020 11:25 pm

Re: From Package to EXE File not work

Post by MIC-23145632 »

Alexander Riedel wrote: Thu Apr 25, 2019 7:43 am Here:

SPS Encoding.png

Unicode is UTF-16 LE, in case you are not familiar with encodings

My default is UTF-8. The same file I copied to the v5.5.152 version environment package EXE. It can be executed smoothly.

Once again, I emphasized the problem I encountered. I just turned into an EXE file and then garbled or unable to execute the problem.
Snipaste_2019-04-25_22-45-59.png
Snipaste_2019-04-25_22-45-59.png (131.13 KiB) Viewed 2900 times
MIC-23145632
Posts: 14
Last visit: Tue Apr 28, 2020 11:25 pm

Re: From Package to EXE File not work

Post by MIC-23145632 »

Sorry, I changed to UTF16-LE. Correctly executed.
Snipaste_2019-04-25_22-51-27.png
Snipaste_2019-04-25_22-51-27.png (3.29 KiB) Viewed 2899 times
Curious why UTF-8 can't use the old version but it works.
This topic is 4 years and 11 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.