summaryrefslogtreecommitdiff
path: root/Build/NullSoftInstaller.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-09-10 18:43:31 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-09-10 19:16:30 -0400
commit624e2ec84e537a20301a0fda6ceb4151a5ec61e4 (patch)
treec456d3d259b037987b4689a71eb0044a17e0f28c /Build/NullSoftInstaller.hs
parent09fbe113717531a7bb5806dcf42bb833f14a0e59 (diff)
Switched to using git for Windows, rather than msysgit.
Using msysgit with git-annex is no longer supported. At the same time, I'm updating the rsync.exe in my downloads repository with the one from msys2. Note that rsync is currently still being ldded and installed in Git/cmd/ like the other cygwin programs. The ldd fails and this failure is ignored. It would be better to special case it to go in Git/usr/bin/, so that the user can't run rsync in a dos prompt window, which doesn't work, as it needs additional libs. However, as far as git-annex running rsync running ssh, it works ok in this location. Removed the ssh.cmd and ssh-keygen.cmd; these are not needed with git for windows. Keeping them would let ssh be run manually from a dos prompt window, but that's not really a goal.
Diffstat (limited to 'Build/NullSoftInstaller.hs')
-rw-r--r--Build/NullSoftInstaller.hs27
1 files changed, 12 insertions, 15 deletions
diff --git a/Build/NullSoftInstaller.hs b/Build/NullSoftInstaller.hs
index e300036e4..7726fdcbc 100644
--- a/Build/NullSoftInstaller.hs
+++ b/Build/NullSoftInstaller.hs
@@ -1,7 +1,7 @@
{- Generates a NullSoft installer program for git-annex on Windows.
-
- To build the installer, git-annex should already be built by cabal,
- - and ssh and rsync etc, as well as cygwin libraries, already installed
+ - and the necessary utility programs already installed
- from cygwin.
-
- This uses the Haskell nsis package (cabal install nsis)
@@ -9,8 +9,9 @@
- git-annex-installer.exe
-
- The installer includes git-annex, and utilities it uses, with the
- - exception of git. The user needs to install git separately,
- - and the installer checks for that.
+ - exception of git and some utilities that are bundled with git.
+ - The user needs to install git separately, and the installer checks
+ - for that.
-
- Copyright 2013-2015 Joey Hess <id@joeyh.name>
-
@@ -34,6 +35,7 @@ import Utility.Path
import Utility.CopyFile
import Utility.SafeCommand
import Utility.Process
+import Utility.Exception
import Build.BundledPrograms
main = do
@@ -42,7 +44,7 @@ main = do
mustSucceed "ln" [File "dist/build/git-annex/git-annex.exe", File gitannex]
let license = tmpdir </> licensefile
mustSucceed "sh" [Param "-c", Param $ "zcat standalone/licences.gz > '" ++ license ++ "'"]
- extrabins <- forM (cygwinPrograms) $ \f -> do
+ extrabins <- forM (winPrograms) $ \f -> do
p <- searchPath f
when (isNothing p) $
print ("unable to find in PATH", f)
@@ -54,7 +56,7 @@ main = do
let htmlhelp = tmpdir </> "git-annex.html"
writeFile htmlhelp htmlHelpText
writeFile nsifile $ makeInstaller gitannex license htmlhelp
- (wrappers ++ catMaybes (extrabins ++ dllpaths))
+ (catMaybes (extrabins ++ dllpaths))
[ webappscript, autostartscript ]
mustSucceed "makensis" [File nsifile]
removeFile nsifile -- left behind if makensis fails
@@ -173,10 +175,10 @@ makeInstaller gitannex license htmlhelp extrabins launchers = nsis $ do
addfile f = file [] (str f)
removefilesFrom d = mapM_ (\f -> delete [RebootOK] $ fromString $ d ++ "/" ++ takeFileName f)
-cygwinPrograms :: [FilePath]
-cygwinPrograms = map (\p -> p ++ ".exe") bundledPrograms
+winPrograms :: [FilePath]
+winPrograms = map (\p -> p ++ ".exe") bundledPrograms
--- msysgit opens Program Files/Git/doc/git/html/git-annex.html
+-- git opens Program Files/Git/doc/git/html/git-annex.html
-- when git annex --help is run.
htmlHelpText :: String
htmlHelpText = unlines
@@ -191,15 +193,10 @@ htmlHelpText = unlines
-- Find cygwin libraries used by the specified executable.
findCygLibs :: FilePath -> IO [FilePath]
-findCygLibs p = filter iscyg . mapMaybe parse . lines <$> readProcess "ldd" [p]
+findCygLibs p = filter iscyg . mapMaybe parse . lines
+ <$> catchDefaultIO "" (readProcess "ldd" [p])
where
parse l = case words (dropWhile isSpace l) of
(dll:"=>":_dllpath:_offset:[]) -> Just dll
_ -> Nothing
iscyg f = "cyg" `isPrefixOf` f || "lib" `isPrefixOf` f
-
-wrappers :: [FilePath]
-wrappers =
- [ "standalone\\windows\\ssh.cmd"
- , "standalone\\windows\\ssh-keygen.cmd"
- ]