bamse-0.9.3: templates/Greencard.hs
--------------------------------------------------------------------
-- |
-- Module : Greencard
-- Description : Specification/template for the Greencard installer builder.
-- Copyright : (c) Sigbjorn Finne, 2004-2009
-- License : BSD3
--
-- Maintainer : Sigbjorn Finne <sof@forkIO.com>
-- Stability : provisional
-- Portability : portable
--
-- To create your own installer, you need to supply a Haskell module
-- which exports functions and values that together define the
-- functionality (and contents) of your package;
-- see Base.hs just what those exports are.
--
--------------------------------------------------------------------
module Greencard where
import Util.Dir
import Util.Path
import Bamse.Package
import Bamse.PackageUtils
gcVersion = "gc-2.05"
versionNumber = "2.05"
defaultOutFile = toMsiFileName gcVersion
pkg :: Package
pkg = Package
{ name = "GreenCard"
, title = "GreenCard - Haskell FFI preprocessor"
, productVersion = "1.0.0.0"
, author = "Sigbjorn Finne"
, comment = "Version: " ++ versionNumber
}
webSite :: String
webSite = "http://haskell.org/greencard"
bannerBitmap :: InstallEnv -> Maybe FilePath
bannerBitmap ienv = Just (lFile (toolDir ienv) "art/banner.bmp")
bgroundBitmap :: InstallEnv -> Maybe FilePath
bgroundBitmap _ienv = Nothing
registry :: [RegEntry]
registry = haskellProject "GreenCard"
[ hugsPath "[TARGETDIR]\\lib\\hugs" ]
features :: [Tree Feature]
features = [ Leaf baseFeature ]
baseFeatureName :: String
baseFeatureName = "GreenCard"
baseFeature :: Feature
baseFeature = (baseFeatureName, "GreenCard")
startMenu :: InstallEnv -> (String, [Shortcut])
startMenu ienv = ("GreenCard", entries)
where
entries :: [Shortcut]
entries =
[ Shortcut "GreenCard Readme"
(lFile (srcDir ienv) "README.txt")
""
"GHC Readme"
(Just (lFile iconDir "txt.exe"))
1
"[TARGETDIR]"
, Shortcut "User guide"
(lFile (srcDir ienv) "doc\\green-card\\greencard.html")
""
"User guide"
(Just (lFile iconDir "html.exe"))
1
"[TARGETDIR]"
]
iconDir = toolDir ienv ++ "\\icons"
desktopShortcuts :: InstallEnv -> [Shortcut]
desktopShortcuts _ienv = []
extensions :: InstallEnv -> [ Extension ]
extensions _ienv = [ ]
verbs :: [ ( String -- extension
, String -- verb
, String -- label
, String -- arguments
)
]
verbs = [ ]
dirTree :: InstallEnv -> IO DirTree
dirTree ienv = findFiles ofInterest (srcDir ienv)
where
ofInterest file = not (last file == '~') &&
not (baseName file == gcVersion) &&
not (baseName file == "green-card.junk") &&
not (baseName file == "distrib") &&
not (baseName file == "CVS") &&
not (baseName file == "mk") &&
(not (fileSuffix file == "o") ||
(baseName file == "HSgreencard.o")) &&
(not (fileSuffix file == "hi") ||
(baseName file == "StdDIS.hi"))
distFileMap :: Maybe (FilePath -> Maybe FilePath)
distFileMap = Nothing
featureMap :: Maybe (FilePath -> FeatureName)
featureMap = Nothing
license :: InstallEnv -> Maybe FilePath
license _ienv = Nothing
userRegistration :: Bool
userRegistration = False
defaultInstallFolder :: Maybe String
defaultInstallFolder = Nothing
finalMessage :: Maybe String
finalMessage = Just "Please remember to add [TARGETDIR] to your PATH."
userInstall :: Bool
userInstall = False
services :: [Service]
services = []
ghcPackageInfo :: Maybe GhcPackage
ghcPackageInfo = Nothing
nestedInstalls = []