diff options
-rw-r--r-- | Build/NullSoftInstaller.hs | 8 | ||||
-rw-r--r-- | doc/bugs/ssh_fails_in_windows_nightly_build.mdwn | 2 | ||||
-rw-r--r-- | standalone/windows/ssh.cmd | 31 |
3 files changed, 37 insertions, 4 deletions
diff --git a/Build/NullSoftInstaller.hs b/Build/NullSoftInstaller.hs index e9a22d843..41cf360a2 100644 --- a/Build/NullSoftInstaller.hs +++ b/Build/NullSoftInstaller.hs @@ -54,7 +54,7 @@ main = do let htmlhelp = tmpdir </> "git-annex.html"
writeFile htmlhelp htmlHelpText
writeFile nsifile $ makeInstaller gitannex license htmlhelp
- (catMaybes (extrabins ++ dllpaths))
+ (wrappers ++ catMaybes (extrabins ++ dllpaths))
[ webappscript, autostartscript ]
mustSucceed "makensis" [File nsifile]
removeFile nsifile -- left behind if makensis fails
@@ -152,9 +152,6 @@ makeInstaller gitannex license htmlhelp extrabins launchers = nsis $ do section "cmd" [] $ do
setOutPath "$INSTDIR\\cmd"
mapM_ addfile (gitannex:extrabins)
- -- copy msysgit's ssh into cmd so it's always in PATH
- -- (bin is only in PATH from git bash)
- copyFiles [] "$INSTDIR\\bin\\ssh.exe" "$INSTDIR\\cmd\\ssh.exe"
section "meta" [] $ do
setOutPath "$INSTDIR\\doc\\git\\html"
addfile htmlhelp
@@ -200,3 +197,6 @@ findCygLibs p = filter iscyg . mapMaybe parse . lines <$> readProcess "ldd" [p] (dll:"=>":_dllpath:_offset:[]) -> Just dll
_ -> Nothing
iscyg f = "cyg" `isPrefixOf` f || "lib" `isPrefixOf` f
+
+wrappers :: [FilePath]
+wrappers = ["standalone\\windows\\ssh.cmd"]
diff --git a/doc/bugs/ssh_fails_in_windows_nightly_build.mdwn b/doc/bugs/ssh_fails_in_windows_nightly_build.mdwn index eb9ade6d0..a40e3ea71 100644 --- a/doc/bugs/ssh_fails_in_windows_nightly_build.mdwn +++ b/doc/bugs/ssh_fails_in_windows_nightly_build.mdwn @@ -6,3 +6,5 @@ After installing a nightly build from https://qa.nest-initiative.org/view/msysGi Version: 5.20150508-g8e96a31 Build flags: Assistant Webapp Webapp-secure Pairing Testsuite S3 WebDAV DNS Feeds Quvi TDFA TorrentParser """]] + +> sigh.. [[fixed|done]] now.. --[[Joey]] diff --git a/standalone/windows/ssh.cmd b/standalone/windows/ssh.cmd new file mode 100644 index 000000000..32aa60a4d --- /dev/null +++ b/standalone/windows/ssh.cmd @@ -0,0 +1,31 @@ +@rem Do not use "echo off" to not affect any child calls.
+
+@rem Enable extensions, the `verify other 2>nul` is a trick from the setlocal help
+@verify other 2>nul
+@setlocal enableDelayedExpansion
+@if errorlevel 1 (
+ @echo Unable to enable delayed expansion. Immediate expansion will be used.
+ @goto fallback
+)
+
+@rem Get the absolute path to the parent directory, which is assumed to be the
+@rem Git installation root.
+@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
+@set PATH=!git_install_root!\bin;!git_install_root!\mingw\bin;!PATH!
+
+ssh %*
+@goto end
+
+:fallback
+@rem The above script again with immediate expansion, in case delayed expansion
+@rem is unavailable.
+@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
+@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
+
+@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
+@if not exist "%HOME%" @set HOME=%USERPROFILE%
+
+ssh %*
+
+:end
+@rem End of script
|