executable-hash-0.1.1.1: Provides the SHA1 hash of the program executable

Safe HaskellNone
LanguageHaskell2010

System.Executable.Hash.Internal

Description

Internals related to reading and writing an injected executable hash.

Synopsis

Documentation

injectedExecutableHash :: Maybe ByteString Source

Yields a Just value of a hash which has been injected into the executable via injectExecutableHash.

injectExecutableHash :: FilePath -> IO () Source

Given the path to an executable, computes its hash and injects it into the binary, such that when that program demands the value of injectedExecutableHash, it yields a Just value.

See the documentation in System.Executable.Hash for an example of how to use this with a cabal postBuild hook

maybeInjectExecutableHash :: FilePath -> IO () Source

Injects an executable hash into the specified binary. If it doesn't exist, then this prints a message to stdout indicating that it failed to inject the hash.