diff --git a/scripts/install.ps1 b/scripts/install.ps1 index ee3356d3..abf6ec93 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -428,7 +428,7 @@ Write-Output "${BoldPurple}++${ResetColor} If you face any issues while verifyin Write-Output "${BoldPurple}++${ResetColor} ${BoldLightBlue}https://github.com/SteamClientHomebrew/Millennium/issues/new/choose${ResetColor}`n" # sleep 5 seconds to allow the user to read the message -Start-Sleep -Seconds 5 +# Start-Sleep -Seconds 5 Start-Steam -steamPath $steamPath @@ -439,11 +439,11 @@ while ($pipeServer.IsConnected) { $bytesRead = $pipeServer.Read($buffer, 0, $bufferSize) if ($bytesRead -gt 0) { $message = [System.Text.Encoding]::UTF8.GetString($buffer, 0, $bytesRead) - [Console]::Write($message) + # [Console]::Write($message) # Check if the message contains "SteamUI successfully loaded" if ($message -match "SteamUI successfully loaded!") { - Write-Host "`n${BoldGreen}++${ResetColor} Millennium has successfully loaded. Installation complete!" + Write-Host "${BoldGreen}++${ResetColor} Millennium has successfully loaded. Installation complete!" Start-Sleep -Seconds 2 exit } diff --git a/src/pipes/terminal_pipe.h b/src/pipes/terminal_pipe.h index 1f2fa4ad..c3315001 100644 --- a/src/pipes/terminal_pipe.h +++ b/src/pipes/terminal_pipe.h @@ -15,14 +15,14 @@ extern "C" { if (hPipe == INVALID_HANDLE_VALUE) { - std::cerr << "Failed to connect to pipe." << std::endl; + std::cerr << "Failed to connect to pipe. Error: " << GetLastError() << std::endl; return 1; } int pipeDescriptor = _open_osfhandle((intptr_t)hPipe, _O_WRONLY); if (pipeDescriptor == -1) { - std::cerr << "Failed to get pipe file descriptor." << std::endl; + std::cerr << "Failed to get pipe file descriptor. Error: " << errno << std::endl; CloseHandle(hPipe); return 1; } @@ -30,23 +30,21 @@ extern "C" { FILE* pipeFile = _fdopen(pipeDescriptor, "w"); if (!pipeFile) { - std::cerr << "Failed to open pipe file descriptor as FILE*." << std::endl; + std::cerr << "Failed to open pipe file descriptor as FILE*. Error: " << errno << std::endl; CloseHandle(hPipe); return 1; } - // Redirect stdout to the named pipe - if (dup2(_fileno(pipeFile), _fileno(stdout)) == -1) + if (_dup2(_fileno(pipeFile), _fileno(stdout)) == -1) { - std::cerr << "Failed to redirect stdout to pipe." << std::endl; + std::cerr << "Failed to redirect stdout to pipe. Error: " << errno << std::endl; + fclose(pipeFile); CloseHandle(hPipe); - fclose(pipeFile); // Close the FILE* on failure return 1; } - setvbuf(stdout, NULL, _IONBF, 0); - std::shared_ptr pipePtr = std::make_shared(pipeFile); + setvbuf(stdout, NULL, _IONBF, 0); return 0; } } -#endif \ No newline at end of file +#endif