This repository was archived by the owner on Aug 18, 2020. It is now read-only.
File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,8 @@ executable cardano-launcher
222
222
, yaml
223
223
if !os(windows)
224
224
build-depends : unix
225
+ else
226
+ build-depends : Win32
225
227
default-language : Haskell2010
226
228
ghc-options : -threaded
227
229
-Wall
Original file line number Diff line number Diff line change 12
12
{-# LANGUAGE RecordWildCards #-}
13
13
{-# LANGUAGE TemplateHaskell #-}
14
14
{-# LANGUAGE TypeSynonymInstances #-}
15
+ {-# OPTIONS_GHC -Wno-type-defaults #-}
15
16
16
17
import qualified Prelude (show )
17
18
import Universum
@@ -57,6 +58,8 @@ import Text.PrettyPrint.ANSI.Leijen (Doc)
57
58
#ifndef mingw32_HOST_OS
58
59
import System.Posix.Signals (sigKILL , signalProcess )
59
60
import qualified System.Process.Internals as Process
61
+ #else
62
+ import qualified System.Win32.Process as Process
60
63
#endif
61
64
62
65
-- Modules needed for system'
@@ -586,8 +589,13 @@ writeWindowsUpdaterRunner :: FilePath -> M ()
586
589
writeWindowsUpdaterRunner runnerPath = liftIO $ do
587
590
exePath <- getExecutablePath
588
591
launcherArgs <- getArgs
592
+ #ifdef mingw32_HOST_OS
593
+ selfPid <- Process. getCurrentProcessId
594
+ #else
595
+ let selfPid = 0 -- This will never be run on non-Windows
596
+ #endif
589
597
writeFile (toString runnerPath) $ unlines
590
- [ " TaskKill /IM cardano-launcher.exe /F"
598
+ [ " TaskKill /PID " <> show selfPid <> " /F"
591
599
-- Run updater
592
600
, " %*"
593
601
-- Delete updater
You can’t perform that action at this time.
0 commit comments