Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4243250
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:33:12+00:00 2026-05-21T03:33:12+00:00

I want to deploy an application on Windows that needs to access the GHC

  • 0

I want to deploy an application on Windows that needs to access the GHC API. Using the first simple example from the Wiki:

http://www.haskell.org/haskellwiki/GHC/As_a_library

results in the following error (compiled on one machine with haskell platform and executed on another clean windows install):
test.exe: can’t find a package database at C:\haskell\lib\package.conf.d

I’d like to deploy my application as a simple zip file and not require the user to have anything installed. Is there a straightforward way to include the needed GHC things in that zip file so it will work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T03:33:13+00:00Added an answer on May 21, 2026 at 3:33 am

    This program will copy necessary files to the specified directory (will work only on windows):

    import Data.List (isSuffixOf)
    import System.Environment (getArgs)
    import GHC.Paths (libdir)
    import System.Directory
    import System.FilePath 
    import System.Cmd
    
    main = do
      [to] <- getArgs
      let libdir' = to </> "lib"
      createDirectoryIfMissing True libdir'
      copy libdir libdir'
      rawSystem "xcopy"
        [ "/e", "/q"
        , dropFileName libdir </> "mingw"
        , to </> "mingw\\"]
    
    
    -- | skip some files while copying
    uselessFile f
      = or $ map (`isSuffixOf` f)
        [ "."
        , "_debug.a"
        , "_p.a", ".p_hi"    -- libraries built with profiling
        , ".dyn_hi", ".dll"] -- dynamic libraries
    
    
    copy from to
      = getDirectoryContents from
      >>= mapM_ copy' . filter (not . uselessFile)
      where
        copy' f = do
          let (from', to') = (from </> f, to </> f)
          isDir <- doesDirectoryExist from'
          if isDir
              then createDirectory to' >> copy from' to'
              else copyFile from' to'
    

    After running it with destination directory as argument you will have a local copy of lib and mingw (about 300 Mb total).

    You can remove unused libraries from lib to save more space.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to deploy a Windows Forms application using ClickOnce deployment. (VS2008, .NET 3.5)
I want to deploy a C++ application that will run in enterprises where users
I have a clickonce application and i want to deploy 2 versions of the
I have 3 projects in my solution that I want to deploy. Is there
I have 3 projects in my solution that I want to deploy. Is there
I want to create a Java application bundle for Mac without using Mac. According
I have built software that I deploy on Windows 2003 server. The software runs
I'm trying to deploy an application to Tomcat 7 on a Windows server. I
I have created a SQL DB-based winforms application, and I want to deploy it
I have created an iPhone application which I want to deploy onto an iPhone.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.