Data-Oriented-House / PortableBuildTools

Portable VS Build Tools installer
595 stars 19 forks source link

2.2: UI shows in console mode #17

Closed milnak closed 2 months ago

milnak commented 3 months ago

ensure c:\BuildTools exists. Run portablebuildtools.exe accept_license target=x64 host=x64 env=user path='C:\BuildTools'

you'll get a messagebox with

---------------------------
Error
---------------------------
Destination folder is not empty
---------------------------
OK   
---------------------------

which blocks the console. console mode should never show UI

milnak commented 3 months ago

In addition, when install completes, another message box shows:

---------------------------
Success!
---------------------------
Please log out and back in to finish installation.
---------------------------
OK   
---------------------------
munohikari commented 3 months ago

@milnak

The installer launches a subprocess console and exists, if no message box is to be shown, the user wouldn't receive any of the messages, neither about failure nor about success, since the window would just close. I do not know what is the desirable behavior for CLI people, but there are several ways i could make it work:

  1. Just display messages in the console as you suggested, which means nobody will see it
  2. Display the message in the console and wait for user input
  3. Never launch a subprocess to begin with, do the installation in the same process. This also means that if you want to install into admin-access-only directory, you would need to launch the script as admin.

Which behavior do you like more?

milnak commented 3 months ago

3 is standard console behavior

munohikari commented 3 months ago

@milnak please see if this version works properly, and if it does, i'll make a 2.4 release soon (with a new PS script that you will send me). https://github.com/Data-Oriented-House/PortableBuildTools/releases/tag/v2.4-pre

milnak commented 2 months ago

Tested v2.4-pre. Works fine.