Help with GUI

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 8 years and 1 month 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
WSUsoftware
Posts: 30
Last visit: Thu Feb 17, 2022 2:52 pm

Re: Help with GUI

Post by WSUsoftware »

jvierra wrote:Here is yours as an example:
That ended up working well, thank you!

As a last piece of refinement, I wanted to include a cancel/abort type button since if a user selects a whole bunch and then wants to cancel them, they would have to kill the form as well as any installers that are currently running. Obviously they could open up task manager and manually kill them, but not everyone would know how to do that. I thought about having the Click event for the abort button be "Exit" to kill the form, and then "Stop-Process" msiexec/cscript/wscript, but once they start installing, even if I tab to the original form, the button is unclickable because the msi is running (during a "Windows is Preparing to Install xxx") which takes a long time for some of the applications. Am I stuck until at least the first program is installed before I can kill anything?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Help with GUI

Post by jvierra »

You need to run the scripts and installers as a job. You will not be able to kill most MSI installers as they are handed to the system and are executed blindly to you.

This is a design issue which come up frequently. To solve the issue you need to learn to automate the installer. This is very advanced and requires deep system knowledge. I know few experienced developers who understand the MSI system.

If you want to give it a try the installer is documented in the Windows Platform SDK.
This topic is 8 years and 1 month 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