From 54ea3758cb7ff140cacab9f1e13914e97afa502f Mon Sep 17 00:00:00 2001 From: H2Sxxa Date: Sun, 28 Jul 2024 14:30:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20msiexec=20log=20early=20re?= =?UTF-8?q?ad?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/windows/msi.dart | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/windows/msi.dart b/lib/windows/msi.dart index d49dc14..f5b03e8 100644 --- a/lib/windows/msi.dart +++ b/lib/windows/msi.dart @@ -20,14 +20,14 @@ enum DisplayMode { qf, } -Future msiexec( +Future msiexec( String path, { Iterable arguments = const [], String? logPath, DisplayMode displayMode = DisplayMode.quiet, RestartMode restartMode = RestartMode.norestart, }) async { - return await Process.start( + return await Process.run( "msiexec", [ "/i", @@ -37,7 +37,6 @@ Future msiexec( ...arguments, ...logPath != null ? ["/log", logPath] : [] ], - mode: ProcessStartMode.detached, ); } @@ -73,17 +72,17 @@ void downloadMSIexec( onDone(); } - await msiexec( + msiexec( filePath, arguments: arguments, logPath: logPath, displayMode: displayMode, restartMode: restartMode, - ); - - if (afterInstall != null) { - afterInstall(); - } + ).then((_) { + if (afterInstall != null) { + afterInstall(); + } + }); }); }