windows no-DOS-box and autostart, at last
Using the crazy but apparently best approach of a VB Script that runs git-annex, in a hidden DOS window. Note that currently the git-annex messages are not directed to daemon.log. Would probably need another layer of script. Also problimatic since the repository may not exist yet.
This commit is contained in:
parent
ba952aca3c
commit
883aa84209
2 changed files with 35 additions and 5 deletions
|
@ -42,8 +42,12 @@ main = do
|
||||||
when (isNothing p) $
|
when (isNothing p) $
|
||||||
print ("unable to find in PATH", f)
|
print ("unable to find in PATH", f)
|
||||||
return p
|
return p
|
||||||
|
let webappscript = tmpdir </> "git-annex-webapp.vbs"
|
||||||
|
webappscript <- vbsLauncher tmpdir "git-annex-webapp" "git-annex webapp"
|
||||||
|
autostartscript <- vbsLauncher tmpdir "git-annex-autostart" "git annex assistant --autostart"
|
||||||
writeFile nsifile $ makeInstaller gitannex license $
|
writeFile nsifile $ makeInstaller gitannex license $
|
||||||
catMaybes extrafiles
|
catMaybes extrafiles ++
|
||||||
|
[ webappscript, autostartscript ]
|
||||||
mustSucceed "makensis" [File nsifile]
|
mustSucceed "makensis" [File nsifile]
|
||||||
removeFile nsifile -- left behind if makensis fails
|
removeFile nsifile -- left behind if makensis fails
|
||||||
where
|
where
|
||||||
|
@ -54,6 +58,17 @@ main = do
|
||||||
True -> return ()
|
True -> return ()
|
||||||
False -> error $ cmd ++ " failed"
|
False -> error $ cmd ++ " failed"
|
||||||
|
|
||||||
|
{- Generates a .vbs launcher which runs a command without any visible DOS
|
||||||
|
- box. -}
|
||||||
|
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.Run(\"" ++ cmd ++ "\"), 0, False"
|
||||||
|
]
|
||||||
|
return f
|
||||||
|
|
||||||
gitannexprogram :: FilePath
|
gitannexprogram :: FilePath
|
||||||
gitannexprogram = "git-annex.exe"
|
gitannexprogram = "git-annex.exe"
|
||||||
|
|
||||||
|
@ -72,6 +87,9 @@ gitInstallDir = fromString "$PROGRAMFILES\\Git\\bin"
|
||||||
startMenuItem :: Exp FilePath
|
startMenuItem :: Exp FilePath
|
||||||
startMenuItem = "$SMPROGRAMS/git-annex.lnk"
|
startMenuItem = "$SMPROGRAMS/git-annex.lnk"
|
||||||
|
|
||||||
|
autoStartItem :: Exp FilePath
|
||||||
|
autoStartItem = "$SMSTARTUP/git-annex-autostart.lnk"
|
||||||
|
|
||||||
needGit :: Exp String
|
needGit :: Exp String
|
||||||
needGit = strConcat
|
needGit = strConcat
|
||||||
[ fromString "You need git installed to use git-annex. Looking at "
|
[ fromString "You need git installed to use git-annex. Looking at "
|
||||||
|
@ -101,14 +119,22 @@ makeInstaller gitannex license extrafiles = nsis $ do
|
||||||
-- Start menu shortcut
|
-- Start menu shortcut
|
||||||
Development.NSIS.createDirectory "$SMPROGRAMS"
|
Development.NSIS.createDirectory "$SMPROGRAMS"
|
||||||
createShortcut startMenuItem
|
createShortcut startMenuItem
|
||||||
[ Target "$INSTDIR/git-annex.exe"
|
[ Target "wscript.exe"
|
||||||
, Parameters "webapp"
|
, Parameters "$INSTDIR/git-annex-webapp.vbs"
|
||||||
|
, StartOptions "SW_SHOWMINIMIZED"
|
||||||
, IconFile "$INSTDIR/git-annex.exe"
|
, IconFile "$INSTDIR/git-annex.exe"
|
||||||
, IconIndex 2
|
, IconIndex 2
|
||||||
, StartOptions "SW_SHOWMINIMIZED"
|
|
||||||
, KeyboardShortcut "ALT|CONTROL|a"
|
, KeyboardShortcut "ALT|CONTROL|a"
|
||||||
, Description "git-annex webapp"
|
, Description "git-annex webapp"
|
||||||
]
|
]
|
||||||
|
createShortcut autoStartItem
|
||||||
|
[ Target "wscript.exe"
|
||||||
|
, Parameters "$INSTDIR/git-annex-autostart.vbs"
|
||||||
|
, StartOptions "SW_SHOWMINIMIZED"
|
||||||
|
, IconFile "$INSTDIR/git-annex.exe"
|
||||||
|
, IconIndex 2
|
||||||
|
, Description "git-annex autostart"
|
||||||
|
]
|
||||||
-- Groups of files to install
|
-- Groups of files to install
|
||||||
section "main" [] $ do
|
section "main" [] $ do
|
||||||
setOutPath "$INSTDIR"
|
setOutPath "$INSTDIR"
|
||||||
|
@ -118,11 +144,12 @@ makeInstaller gitannex license extrafiles = nsis $ do
|
||||||
writeUninstaller $ str uninstaller
|
writeUninstaller $ str uninstaller
|
||||||
uninstall $ do
|
uninstall $ do
|
||||||
delete [RebootOK] $ startMenuItem
|
delete [RebootOK] $ startMenuItem
|
||||||
|
delete [RebootOK] $ autoStartItem
|
||||||
mapM_ (\f -> delete [RebootOK] $ fromString $ "$INSTDIR/" ++ f) $
|
mapM_ (\f -> delete [RebootOK] $ fromString $ "$INSTDIR/" ++ f) $
|
||||||
[ gitannexprogram
|
[ gitannexprogram
|
||||||
, licensefile
|
, licensefile
|
||||||
, uninstaller
|
, uninstaller
|
||||||
] ++ cygwinPrograms ++ cygwinDlls
|
] ++ cygwinPrograms ++ cygwinDlls ++ extrafiles
|
||||||
where
|
where
|
||||||
addfile f = file [] (str f)
|
addfile f = file [] (str f)
|
||||||
|
|
||||||
|
|
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -1,6 +1,9 @@
|
||||||
git-annex (5.20140614) UNRELEASED; urgency=medium
|
git-annex (5.20140614) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
* assistant: Fix one-way assistant->assistant sync in direct mode.
|
* assistant: Fix one-way assistant->assistant sync in direct mode.
|
||||||
|
* Windows: Got rid of that pesky DOS box when starting the webapp.
|
||||||
|
* Windows: Added Startup menu item so assistant starts automatically
|
||||||
|
on login.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Mon, 16 Jun 2014 11:28:42 -0400
|
-- Joey Hess <joeyh@debian.org> Mon, 16 Jun 2014 11:28:42 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue