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.
MIC-23145632
Posts: 14
Joined: Sat Apr 13, 2019 6:40 am

From Package to EXE File not work

Post by MIC-23145632 » Thu Apr 25, 2019 12:02 am

*** 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 1683 times
  1. Line 61: At line:60 char:9
  2.  
  3. +     $button¤¤¤åButton1 = New-Object 'System.Windows.Forms.Button'
  4.  
  5. +            ~~~~~~~~~~~
  6.  
  7. Unexpected token '¤¤¤åButton1' in expression or statement.
  8.  
  9.  
  10.  
  11. At line:105 char:29
  12.  
  13. +     $form1.Controls.Add($button¤¤¤åButton1)
  14.  
  15. +                                ~
  16.  
  17. Missing ')' in method call.
  18.  
  19.  
  20.  
  21. At line:105 char:29
  22.  
  23. +     $form1.Controls.Add($button¤¤¤åButton1)
  24.  
  25. +                                ~~~~~~~~~~~
  26.  
  27. Unexpected token '¤¤¤åButton1' in expression or statement.
  28.  
  29.  
  30.  
  31. At line:46 char:28
  32.  
  33. + function Show-TestFrom_psf {
  34.  
  35. +                            ~
  36.  
  37. Missing closing '}' in statement block or type definition.
  38.  
  39.  
  40.  
  41. At line:105 char:40
  42.  
  43. +     $form1.Controls.Add($button¤¤¤åButton1)
  44.  
  45. +                                           ~
  46.  
  47. Unexpected token ')' in expression or statement.
  48.  
  49.  
  50.  
  51. At line:115 char:9
  52.  
  53. +     $button¤¤¤åButton1.Font = 'Microsoft Sans Serif, 15.75pt'
  54.  
  55. +            ~~~~~~~~~~~~~~~~
  56.  
  57. Unexpected token '¤¤¤åButton1.Font' in expression or statement.
  58.  
  59.  
  60.  
  61. At line:116 char:9
  62.  
  63. +     $button¤¤¤åButton1.Location = '25, 40'
  64.  
  65. +            ~~~~~~~~~~~~~~~~~~~~
  66.  
  67. Unexpected token '¤¤¤åButton1.Location' in expression or statement.
  68.  
  69.  
  70.  
  71. At line:117 char:9
  72.  
  73. +     $button¤¤¤åButton1.Name = 'button¤¤¤åButton1'
  74.  
  75. +            ~~~~~~~~~~~~~~~~
  76.  
  77. Unexpected token '¤¤¤åButton1.Name' in expression or statement.
  78.  
  79.  
  80.  
  81. At line:118 char:9
  82.  
  83. +     $button¤¤¤åButton1.Size = '225, 117'
  84.  
  85. +            ~~~~~~~~~~~~~~~~
  86.  
  87. Unexpected token '¤¤¤åButton1.Size' in expression or statement.
  88.  
  89.  
  90.  
  91. At line:119 char:9
  92.  
  93. +     $button¤¤¤åButton1.TabIndex = 0
  94.  
  95. +            ~~~~~~~~~~~~~~~~~~~~
  96.  
  97. Unexpected token '¤¤¤åButton1.TabIndex' in expression or statement.
  98.  
  99.  
  100.  
  101. Not all parse errors were reported.  Correct the reported errors and try again.
Attachments
TestFrom.psf.psbuild
(1.51 KiB) Downloaded 26 times
TestFrom.psf
(36.16 KiB) Downloaded 28 times

User avatar
Alexander Riedel
Posts: 7210
Joined: Tue May 29, 2007 4:43 pm

Re: From Package to EXE File not work

Post by Alexander Riedel » Thu Apr 25, 2019 6:58 am

Please try switching your encoding to Unicode LE and see if that fixes the problem.
Alexander Riedel
SAPIEN Technologies, Inc.

MIC-23145632
Posts: 14
Joined: Sat Apr 13, 2019 6:40 am

Re: From Package to EXE File not work

Post by MIC-23145632 » Thu Apr 25, 2019 7:19 am

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 1651 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: 7210
Joined: Tue May 29, 2007 4:43 pm

Re: From Package to EXE File not work

Post by Alexander Riedel » 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.
Alexander Riedel
SAPIEN Technologies, Inc.

MIC-23145632
Posts: 14
Joined: Sat Apr 13, 2019 6:40 am

Re: From Package to EXE File not work

Post by MIC-23145632 » Thu Apr 25, 2019 7:37 am

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 1645 times
Snipaste_2019-04-25_22-36-14.png
Snipaste_2019-04-25_22-36-14.png (31.72 KiB) Viewed 1645 times

User avatar
Alexander Riedel
Posts: 7210
Joined: Tue May 29, 2007 4:43 pm

Re: From Package to EXE File not work

Post by Alexander Riedel » Thu Apr 25, 2019 7:43 am

Here:
SPS Encoding.png
SPS Encoding.png (34.03 KiB) Viewed 1643 times
Unicode is UTF-16 LE, in case you are not familiar with encodings
Alexander Riedel
SAPIEN Technologies, Inc.

MIC-23145632
Posts: 14
Joined: Sat Apr 13, 2019 6:40 am

Re: From Package to EXE File not work

Post by MIC-23145632 » Thu Apr 25, 2019 7:50 am

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 1638 times

MIC-23145632
Posts: 14
Joined: Sat Apr 13, 2019 6:40 am

Re: From Package to EXE File not work

Post by MIC-23145632 » Thu Apr 25, 2019 7:53 am

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 1637 times
Curious why UTF-8 can't use the old version but it works.