Executable file does not work in the computer which is not installed PowerShell Studio

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 7 years and 8 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
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Executable file does not work in the computer which is not installed PowerShell Studio

Post by davidc »

For clarification, what versions of PowerShell are installed on your local machine and the test machine?

To create a Non-GUI package executable:

1. Open a new ps1 script.
2. Add the following line:
  1. Write-Host 'Hello World'
3. Save
4. Go to the packager settings.use the following engine:

SAPIEN PowerShell V5 Host (Command line) x64

if you have V3 installed use:

SAPIEN PowerShell V3 Host (Command line) x64

Do not enable any restrictions and use Run mode: Current user.

5. Package the script and run it on the test machine. Let us know if you still get an error.
David
SAPIEN Technologies, Inc.
User avatar
ynaka_1
Posts: 11
Last visit: Tue Apr 26, 2022 8:05 pm

Re: Executable file does not work in the computer which is not installed PowerShell Studio

Post by ynaka_1 »

Hello,

Thank you very much for your kind support !!

This is to inform you that my GUI executable tool works in my test computers. (I confirmed that it works several computers.)
The problem was the selected platform such as SAPIEN PowerShell V3/V5/V4 Host (Windows Firms) x64.

I thought about that the plat form is in mu computer which is installed PowerShell Studio, but is not.
The executable package has to build based on client computer power shell version... my test computer Power Shell version is version 2.

So I created an EXE file with platform "SAPIEN PowerShell V2 Host (Windows Firms) x64" then it work in testing computers like below.
PS2.png
PS2.png (23.45 KiB) Viewed 2463 times
*) Additional information, I did not create config file, and just copy generated EXE file to testing computer and it works.

I'm cleared my problem now to provide tool to my colleagues.

I would like to thank you again for your kind support !!

Let me ask last question?
What is the purpose of config file which will be created when an executable file and check "Generate .config file"?
Is it required if the creator want add some parameters of GUI tool?

Also is there any information somewhere(User Manual, Knowledgebase in Web, or movie) for explaining it?

Thank you!!
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Executable file does not work in the computer which is not installed PowerShell Studio

Post by davidc »

I'm happy to hear that the issue was resolved.

As for the configuration file, it allows legacy assemblies (.NET 2.0) to run in later versions of .NET. In other word, it allows modules and snapins that contain .NET 2.0 assemblies to work in newer hosts (.NET 4.0 and up). Without this configuration you get an error about mixed assemblies when loading the module or snapin.

We don't have a specific video on the subject, but you can find all our videos on our YouTube channel:

https://www.youtube.com/c/SAPIENTech
David
SAPIEN Technologies, Inc.
User avatar
ynaka_1
Posts: 11
Last visit: Tue Apr 26, 2022 8:05 pm

Re: Executable file does not work in the computer which is not installed PowerShell Studio

Post by ynaka_1 »

Hello,

Thank you very much for your kind support !!

I'm clear everything now what I had the issues and questions to generate executable file.
Also the URL of Video site which is very useful and will help me a lot !!

I would like to thank you again for your great support !! ;)
This topic is 7 years and 8 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.