# How to distribute programs that require Gregor?

**URL:** <https://racket.discourse.group/t/how-to-distribute-programs-that-require-gregor/1948>\
**Category:** Questions & Answers\
**Created:** [May 15, 2023, 7:21am UTC](https://racket.discourse.group/t/how-to-distribute-programs-that-require-gregor/1948 "2023-05-15T07:21:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dexter](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/dexter/32/1432_2.png) [@Dexter](https://racket.discourse.group/u/Dexter)\
**Post date:** [May 15, 2023, 7:21am UTC](https://racket.discourse.group/t/how-to-distribute-programs-that-require-gregor/1948/1 "2023-05-15T07:21:06Z")

</div>

Hello there,

I had asked a question related to Gregor, and the fact that it is not currently possible to run a Racket program compiled on one system with Gregor on another system, if Gregor and Racket haven't been installed on that system. There had been a discussion on the fact that Gregor requires something to be configured on the system before it can run correctly (something to do with localization...), but I never got a clear answer on how to do this manually so programs that require Gregor on a virgin system run without having it installed prior.

Steps to reproduce:

If you run the binary distribution of my small invoicing tool Invoicer:  
[GitHub - DexterLagan/invoicer: A dead-simple, easy-to-use minimalist billing application.](https://github.com/DexterLagan/invoicer)

...you'll get a quick error in a console window that closes instantly. If you install Racket, then install the Gregor package, magically the same binary runs fine.

Another way to reproduce the problem: download the Invoicer source, install Gregor, compile Invoicer, copy the resulting binary to a system without Racket or Gregor ever installed. Run the binary.

My question: what is it that Gregor does when installing its package that I could do myself on the target system to make sure my binaries run without having Racket/Gregor installed?

Thanks a bunch!

Dex

---

<div class="post-metadata">

**Author:** ![sschwarzer](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/sschwarzer/32/1940_2.png) [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Post date:** [May 15, 2023, 9:05am UTC](https://racket.discourse.group/t/how-to-distribute-programs-that-require-gregor/1948/2 "2023-05-15T09:05:13Z")

</div>

I can't say anything specifically about Gregor, but I have ideas.

I assume you're using [raco exe](https://docs.racket-lang.org/raco/exe.html) to create the binary. Are you using the command line option `--embed-dlls`?

It seems you don't have an `info.rkt` file in your repository, which should list the required packages. I don't know if `raco exe` relies on that or if it's enough to follow the `require`s in the "main file."

I see several different pages about `info.rkt` in the Racket documentation, but I think it's easiest to run `raco pkg new <dummy_project_directory>` on the command line and derive your `info.rkt` from the one in the generated dummy project, possibly _also_ consulting the Racket documentation.

---

<div class="post-metadata">

**Author:** ![Dexter](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/dexter/32/1432_2.png) [@Dexter](https://racket.discourse.group/u/Dexter)\
**Post date:** [May 16, 2023, 1:04pm UTC](https://racket.discourse.group/t/how-to-distribute-programs-that-require-gregor/1948/3 "2023-05-16T13:04:23Z")

</div>

Hi, I do use --embed-dlls, and gregor seems to be packaged up with everything else. The problem is that Gregor requires some settings to be 'installed' on a system before it can function. I did try creating a proper package, to no avail. I believe it's a matter of finding out which localization (registry?) settings are installed when Gregor is installed through the package manager, and replicating these settings before attempting to run the binary.

Dex

---

<div class="post-metadata">

**Author:** ![SamPhillips](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/samphillips/32/15_2.png) [@SamPhillips](https://racket.discourse.group/u/SamPhillips)\
**Post date:** [May 16, 2023, 5:19pm UTC](https://racket.discourse.group/t/how-to-distribute-programs-that-require-gregor/1948/4 "2023-05-16T17:19:38Z")

</div>

Is this the error you get?

```scheme
Unable to locate the zoneinfo database on this computer. We searched for it in the following places:
  - tzdata/zoneinfo
  - /usr/share/zoneinfo
  - /usr/share/lib/zoneinfo
  - /etc/zoneinfo

Most likely, you need to install a package for your operating system that contains the zoneinfo database. If the zoneinfo database is already installed on your computer, please file a bug report at https://github.com/97jaz/tzinfo/issues and mention where on your filesystem it is installed.

```

I'm not sure how this is solved on Windows or Macs, but on Ubuntu installing the `tzdata` Ubuntu package resolves the issue for me for this simple program:

```scheme
#lang racket/base

(require gregor)
(now)

```

---

<div class="post-metadata">

**Author:** ![alexh](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/alexh/32/315_2.png) [@alexh](https://racket.discourse.group/u/alexh)\
**Post date:** [May 16, 2023, 10:58pm UTC](https://racket.discourse.group/t/how-to-distribute-programs-that-require-gregor/1948/5 "2023-05-16T22:58:34Z")

</div>

On a Windows platform, the time zone database is installed from the `tzdata` Racket package, which is a dependency of `gregor`. You need to use `raco dist` to package these files with the distributed executable, the `--embed-dlls` option will not help here, since these files are not DLLs.

In general, you cannot skip the `raco dist` step when distributing stand-alone Racket applications, on any platform, since other libraries might contain files which are not Racket source files or shared libraries.

See also: [Bundling external libraries with Raco Distribute - #6 by alexh](https://racket.discourse.group/t/bundling-external-libraries-with-raco-distribute/632/6)

I find that a lot of people are confused by the `--embed-dlls` option, and they think they can ship just the executable file that it produces, but this only works in very limited cases.

Alex.

---

<div class="post-metadata">

**Author:** ![Dexter](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/dexter/32/1432_2.png) [@Dexter](https://racket.discourse.group/u/Dexter)\
**Post date:** [May 17, 2023, 6:42am UTC](https://racket.discourse.group/t/how-to-distribute-programs-that-require-gregor/1948/6 "2023-05-17T06:42:44Z")

</div>

Thanks Alex I'll give it another try. I could swear I had tried the distribute option (which is what I use by default to distribute executables).

Dex

---

<div class="post-metadata">

**Author:** ![Dexter](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/dexter/32/1432_2.png) [@Dexter](https://racket.discourse.group/u/Dexter)\
**Post date:** [May 17, 2023, 6:58am UTC](https://racket.discourse.group/t/how-to-distribute-programs-that-require-gregor/1948/7 "2023-05-17T06:58:14Z")

</div>

Alex, you were absolutely right, raco dist does work and it packages the tzdata. I had a doubt since I've been distributing another program through its .exe alone, yet it uses http-easy. Thanks again for your help, and my apologies for asking a question you had already answered ! I believe the confusion comes from the fact that many people (me included) mostly use the compilation option available inside DrRacket, which might not actually use dist, but only generates a .exe. I'll experiment and make a script to automate this.

Dex

---

<div class="post-metadata">

**Author:** ![robby](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/robby/32/7_2.png) [@robby](https://racket.discourse.group/u/robby)\
**Post date:** [May 21, 2023, 12:21pm UTC](https://racket.discourse.group/t/how-to-distribute-programs-that-require-gregor/1948/8 "2023-05-21T12:21:41Z")

</div>

> [@Dexter](#):
>
> I believe the confusion comes from the fact that many people (me included) mostly use the compilation option available inside DrRacket, which might not actually use dist, but only generates a .exe. I'll experiment and make a script to automate this.

Hi Dex-- did you find the "Racket|Create Executable..." menu option? It has some radio boxes and some commentary there. If your experience suggests an improvement, I'd be interested to hear it.

Thanks,  
Robby
