This repository was archived by the owner on Aug 18, 2020. It is now read-only.
File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ import Text.PrettyPrint.ANSI.Leijen (Doc)
57
57
#ifndef mingw32_HOST_OS
58
58
import System.Posix.Signals (sigKILL , signalProcess )
59
59
import qualified System.Process.Internals as Process
60
+ #else
61
+ import qualified System.Win32.Process as Process
60
62
#endif
61
63
62
64
-- Modules needed for system'
@@ -551,7 +553,9 @@ runUpdater ndbp ud = do
551
553
Nothing -> runUpdaterProc path args'
552
554
Just rp -> do
553
555
-- Write the bat script and pass it the updater with all args
554
- writeWindowsUpdaterRunner rp
556
+ #ifdef mingw32_HOST_OS
557
+ writeWindowsUpdaterRunner rp =<< liftIO Process. getCurrentProcessId
558
+ #endif
555
559
-- The script will terminate this updater so this function shouldn't return
556
560
runUpdaterProc rp ((toText path): args')
557
561
case exitCode of
@@ -582,12 +586,12 @@ runUpdaterProc path args = do
582
586
phvar <- newEmptyMVar
583
587
system' phvar cr mempty EUpdater
584
588
585
- writeWindowsUpdaterRunner :: FilePath -> M ()
586
- writeWindowsUpdaterRunner runnerPath = liftIO $ do
589
+ writeWindowsUpdaterRunner :: FilePath -> Process. ProcessId -> M ()
590
+ writeWindowsUpdaterRunner runnerPath selfPid = liftIO $ do
587
591
exePath <- getExecutablePath
588
592
launcherArgs <- getArgs
589
593
writeFile (toString runnerPath) $ unlines
590
- [ " TaskKill /IM cardano-launcher.exe /F"
594
+ [ " TaskKill /PID " <> show selfPid <> " /F"
591
595
-- Run updater
592
596
, " %*"
593
597
-- Delete updater
You can’t perform that action at this time.
0 commit comments