Create exe: no output in richtextbox?

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

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 1 week 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.
Locked
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Create exe: no output in richtextbox?

Post by stevens »

Hi,

I'm looking for the right settings to export my project to an exectuable.
When I run the project, the form runs and output in the richtextbox of the form.

However, when it is an executable, it doesn't output anything in the richtextbox (though the result is there).

Could you advise what setting I need to look at (probably somewhere in the export to exe)?

S.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Create exe: no output in richtextbox?

Post by jvierra »

There is no reason for this other than STA/MTA setting. Be sure the EXE matches your design setting.
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Re: Create exe: no output in richtextbox?

Post by stevens »

Thanks, but I have no clue what you mean by that.
If it works in PS Studio (output in richtextbox) but not in the exe, where can I look/troubleshoot for the issue?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Create exe: no output in richtextbox?

Post by jvierra »

When you build the build settings (Use STA mode) can be different from the design settings. Also be sure you are building with the correct host.
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Re: Create exe: no output in richtextbox?

Post by stevens »

What do you mean by STA mode, where should I select it?
I run the exe on the same machine I'm building it, so that should work then, correct?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Create exe: no output in richtextbox?

Post by jvierra »

STA is a button on the tool panel "Home" and on the "Script Engine" tab of the build settings. They need to match.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Create exe: no output in richtextbox?

Post by DevinL »

In case you have difficulty finding the buttons Jvierra is referring to, here are some screenshots showing where the two are located:
STA-1.png
STA-1.png (16.56 KiB) Viewed 3806 times
STA-2.png
STA-2.png (57.18 KiB) Viewed 3806 times
DevinL
SAPIEN Technologies, Inc.
User avatar
stevens
Posts: 493
Last visit: Mon Sep 19, 2022 12:23 am
Has voted: 2 times

Re: Create exe: no output in richtextbox?

Post by stevens »

Thanks, that did the trick!
I'm wondering now how to deploy it to machines: via msi or a simple exe. I will do really frequent updates.

If I deploy an exe, I just put the shortcut in startmenu and an exe under program files, deploy it via sccm. If a newer exe, I just put it centrally on sccm and it will be deployed. If I use an msi, I need to uninstall the exising version each time which makes it less straight forward.
What do you think?
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: Create exe: no output in richtextbox?

Post by DevinL »

I don't have any experience with SCCM but with the MSI you can increase the version number then tell it to do a silent install and it'll remove/upgrade the previous installation in the background.
DevinL
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Create exe: no output in richtextbox?

Post by jvierra »

SCCM works the same way. Iy also has more ways to fine tune an install from an MSI.

We can also use Group Policy or DSC to deploy and upgrade.
This topic is 7 years and 1 week 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.
Locked