fix uninstall of some files

This commit is contained in:
Joey Hess 2013-05-16 20:41:20 -04:00
parent 34b8f4f5fd
commit db05bfbe9d

View file

@ -31,9 +31,9 @@ import Build.BundledPrograms
main = do main = do
withTmpDir "nsis-build" $ \tmpdir -> do withTmpDir "nsis-build" $ \tmpdir -> do
let gitannex = tmpdir </> "git-annex.exe" let gitannex = tmpdir </> gitannexprogram
mustSucceed "ln" [File "dist/build/git-annex/git-annex.exe", File gitannex] mustSucceed "ln" [File "dist/build/git-annex/git-annex.exe", File gitannex]
let license = tmpdir </> "git-annex-licenses.txt" let license = tmpdir </> licensefile
mustSucceed "sh" [Param "-c", Param $ "zcat standalone/licences.gz > '" ++ license ++ "'"] mustSucceed "sh" [Param "-c", Param $ "zcat standalone/licences.gz > '" ++ license ++ "'"]
writeFile nsifile $ makeInstaller gitannex license writeFile nsifile $ makeInstaller gitannex license
mustSucceed "C:\\Program Files\\NSIS\\makensis" [File nsifile] mustSucceed "C:\\Program Files\\NSIS\\makensis" [File nsifile]
@ -46,9 +46,18 @@ main = do
True -> return () True -> return ()
False -> error $ cmd ++ " failed" False -> error $ cmd ++ " failed"
gitannexprogram :: FilePath
gitannexprogram = "git-annex.exe"
licensefile :: FilePath
licensefile = "git-annex-licenses.txt"
installer :: FilePath installer :: FilePath
installer = "git-annex-installer.exe" installer = "git-annex-installer.exe"
uninstaller :: FilePath
uninstaller = "git-annex-uninstall.exe"
gitInstallDir :: Exp FilePath gitInstallDir :: Exp FilePath
gitInstallDir = fromString "$PROGRAMFILES\\Git\\cmd" gitInstallDir = fromString "$PROGRAMFILES\\Git\\cmd"
@ -84,14 +93,15 @@ makeInstaller gitannex license = nsis $ do
addfile gitannex addfile gitannex
addfile license addfile license
mapM_ addcygfile cygwinPrograms mapM_ addcygfile cygwinPrograms
writeUninstaller "git-annex-uninstall.exe" writeUninstaller $ str uninstaller
section "libraries" [] $ do section "libraries" [] $ do
setOutPath "$INSTDIR" setOutPath "$INSTDIR"
mapM_ addcygfile cygwinDlls mapM_ addcygfile cygwinDlls
uninstall $ uninstall $
mapM_ (\f -> delete [RebootOK] $ fromString $ "$INSTDIR/" ++ f) mapM_ (\f -> delete [RebootOK] $ fromString $ "$INSTDIR/" ++ f) $
[ gitannex [ gitannexprogram
, license , licensefile
, uninstaller
] ++ cygwinPrograms ++ cygwinDlls ] ++ cygwinPrograms ++ cygwinDlls
where where
addfile f = file [] (str f) addfile f = file [] (str f)