summaryrefslogtreecommitdiff
path: root/Build/NullSoftInstaller.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-09-11 12:51:29 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-09-11 13:18:21 -0400
commit9541fe9c04b79608add494f40fb99cbbc205b2f8 (patch)
tree123518d1ab1e6f76c2b66b8a8a7b20bc34e6c95f /Build/NullSoftInstaller.hs
parentaede78869b2d9daa0c5e5d3f01824824e8d28ae4 (diff)
now fully working even when git is not in path
The vbs launchers now are passed the path where git-annex was installed to, so they will work when it's not in path.
Diffstat (limited to 'Build/NullSoftInstaller.hs')
-rw-r--r--Build/NullSoftInstaller.hs18
1 files changed, 8 insertions, 10 deletions
diff --git a/Build/NullSoftInstaller.hs b/Build/NullSoftInstaller.hs
index c7cd44ea7..7af6babef 100644
--- a/Build/NullSoftInstaller.hs
+++ b/Build/NullSoftInstaller.hs
@@ -64,12 +64,13 @@ main = do
False -> error $ cmd ++ " failed"
{- Generates a .vbs launcher which runs a command without any visible DOS
- - box. -}
+ - box. It expects to be passed the directory where git-annex is installed. -}
vbsLauncher :: FilePath -> String -> String -> IO String
vbsLauncher tmpdir basename cmd = do
let f = tmpdir </> basename ++ ".vbs"
writeFile f $ unlines
[ "Set objshell=CreateObject(\"Wscript.Shell\")"
+ , "objShell.CurrentDirectory = Wscript.Arguments.item(0)"
, "objShell.Run(\"" ++ cmd ++ "\"), 0, False"
]
return f
@@ -131,7 +132,7 @@ makeInstaller gitannex gitannexcmd license htmlhelp extrabins launchers = nsis $
Development.NSIS.createDirectory "$SMPROGRAMS"
createShortcut startMenuItem
[ Target "wscript.exe"
- , Parameters "\"$INSTDIR/git-annex-webapp.vbs\""
+ , Parameters "\"$INSTDIR/cmd/git-annex-webapp.vbs\" \"$INSTDIR/cmd\""
, StartOptions "SW_SHOWNORMAL"
, IconFile "$INSTDIR/usr/bin/git-annex.exe"
, IconIndex 2
@@ -140,7 +141,7 @@ makeInstaller gitannex gitannexcmd license htmlhelp extrabins launchers = nsis $
delete [RebootOK] $ oldStartMenuItem
createShortcut autoStartItem
[ Target "wscript.exe"
- , Parameters "\"$INSTDIR/git-annex-autostart.vbs\""
+ , Parameters "\"$INSTDIR/cmd/git-annex-autostart.vbs\" \"$INSTDIR/cmd\""
, StartOptions "SW_SHOWNORMAL"
, IconFile "$INSTDIR/usr/bin/git-annex.exe"
, IconIndex 2
@@ -169,19 +170,16 @@ makeInstaller gitannex gitannexcmd license htmlhelp extrabins launchers = nsis $
addfile htmlhelp
setOutPath "$INSTDIR"
addfile license
+ setOutPath "$INSTDIR\\cmd"
mapM_ addfile launchers
writeUninstaller $ str uninstaller
uninstall $ do
delete [RebootOK] $ startMenuItem
delete [RebootOK] $ autoStartItem
removefilesFrom "$INSTDIR/usr/bin" (gitannex:extrabins)
- removefilesFrom "$INSTDIR/cmd" gitannexcmd
- removefilesFrom "$INSTDIR\\doc\\git\\html" [htmlhelp]
- removefilesFrom "$INSTDIR" $
- launchers ++
- [ license
- , uninstaller
- ]
+ removefilesFrom "$INSTDIR/cmd" (gitannexcmd:launchers)
+ removefilesFrom "$INSTDIR\\mingw32\\share\\doc\\git-doc" [htmlhelp]
+ removefilesFrom "$INSTDIR" [license, uninstaller]
where
addfile f = file [] (str f)
removefilesFrom d = mapM_ (\f -> delete [RebootOK] $ fromString $ d ++ "/" ++ takeFileName f)