Write stdout stderr

This commit is contained in:
Sander Declerck 2026-01-19 16:03:51 +01:00
parent 38888813cf
commit a7315d29c4
No known key found for this signature in database

View file

@ -31,29 +31,30 @@ export async function installOnWindows() {
ui.writeVerbose(`Destination: ${msiPath}`); ui.writeVerbose(`Destination: ${msiPath}`);
await downloadFile(downloadUrl, msiPath); await downloadFile(downloadUrl, msiPath);
// try { try {
ui.emptyLine(); ui.emptyLine();
await stopServiceIfRunning(); await stopServiceIfRunning();
await uninstallIfInstalled(); await uninstallIfInstalled();
// Wait a moment for uninstall to complete // Wait a moment for uninstall to complete
await new Promise((resolve) => setTimeout(resolve, 2000)); await new Promise((resolve) => setTimeout(resolve, 2000));
ui.writeInformation("⚙️ Installing SafeChain Agent..."); ui.writeInformation("⚙️ Installing SafeChain Agent...");
await runMsiInstaller(msiPath); await runMsiInstaller(msiPath);
ui.emptyLine(); ui.emptyLine();
ui.writeInformation("🚀 Starting SafeChain Agent service..."); ui.writeInformation("🚀 Starting SafeChain Agent service...");
await startService(); await startService();
ui.emptyLine(); ui.emptyLine();
ui.writeInformation("✅ SafeChain Agent installed and started successfully!"); ui.writeInformation(
ui.emptyLine(); "✅ SafeChain Agent installed and started successfully!",
// } );
// finally { ui.emptyLine();
// ui.writeVerbose(`Cleaning up temporary file: ${msiPath}`); } finally {
// cleanup(msiPath); ui.writeVerbose(`Cleaning up temporary file: ${msiPath}`);
// } cleanup(msiPath);
}
} }
async function isRunningAsAdmin() { async function isRunningAsAdmin() {
@ -85,7 +86,9 @@ async function uninstallIfInstalled() {
}); });
if (result.status !== 0) { if (result.status !== 0) {
ui.writeVerbose("No existing installation found (fresh install)."); ui.writeVerbose(
`No existing installation found (fresh install). Output: ${result.stdout} ${result.stderr}`,
);
return; return;
} }