{"id":28615555,"url":"https://github.com/ocamlpro/opam-wix","last_synced_at":"2025-06-12T02:09:22.933Z","repository":{"id":173658999,"uuid":"651068857","full_name":"OCamlPro/opam-wix","owner":"OCamlPro","description":"opam-wix is opam plugin that creates msi installation file to install packages and binaries on Windows.","archived":false,"fork":false,"pushed_at":"2024-03-27T18:24:46.000Z","size":436,"stargazers_count":6,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-21T00:32:58.185Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OCamlPro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-06-08T12:26:28.000Z","updated_at":"2023-07-24T12:19:37.000Z","dependencies_parsed_at":"2024-02-20T15:58:15.649Z","dependency_job_id":"0ffb18e7-a54e-48f6-bff5-f0eb9f5968be","html_url":"https://github.com/OCamlPro/opam-wix","commit_stats":null,"previous_names":["hernoufm/owix","ocamlpro/opam-wix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OCamlPro/opam-wix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fopam-wix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fopam-wix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fopam-wix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fopam-wix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OCamlPro","download_url":"https://codeload.github.com/OCamlPro/opam-wix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCamlPro%2Fopam-wix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259382322,"owners_count":22848842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-12T02:09:22.069Z","updated_at":"2025-06-12T02:09:22.911Z","avatar_url":"https://github.com/OCamlPro.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# opam-wix\n\n[opam-wix](https://github.com/OCamlPro/opam-wix) is a Cygwin plugin for [opam](https://opam.ocaml.org/), the OCaml package manager. This plugin provides integration with the [WiX Toolset](https://wixtoolset.org/), allowing you to create Windows Installer packages (MSI) for your OCaml applications and packages.\n\nThe resulting MSI package generated by opam-wix is a portable installer that can be used on any Windows machine. This means you can distribute the generated MSI package to users or deploy it on different machines without restrictions.\n\n## Features\n\n- Generate Windows Installer packages (MSI) for OCaml applications from your environement.\n- Define installation directories, shortcuts, and registry keys.\n- Integration with opam, leveraging its package metadata and dependency resolution.\n\n## Installation\n\nTo install the opam-wix plugin, follow these steps:\n\n#### 1. Install opam\nFirst, check if you have opam installed. If not, the easiest way is to install it via Cygwin: package `ocaml`, `opam` and `gcc-g++`\nfor mccs. In the next version of opam, there will be cygwin depexts handling, you will no\nmore need to install it manually.\nYou can install `ocaml`, `opam`, and `gcc-g++` Cygwin packages, or run this command,\ndon't forget to replace `C:\\\\cygwin64` by your Cygwin root:\n```bash\npath/to/setupx86-64 --root C:\\\\cygwin64 --quite-mode --no-desktop --no-adminmenu --no-startmenu --packages=ocaml,opam,gcc-g++\n```\nThen you can initialise your opam with the default repository.\n```bash\nopam init\n```\n\n#### 2. Install Wix toolset\n* Install [Wix toolset](https://wixtoolset.org) (stable version =\u003c 3.11) and set installation path (often in Program Files) in variable:\n```bash\nexport WIXPATH='/cygdrive/c/Program Files (x86)/\u003cpath to the WiX binaries\u003e'\n```\n\n* You could also avoid graphical installation of Wix and download just [archive with binaries](https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311-binaries.zip), extract it and set variable:\n\n```bash\nexport WIXPATH='\u003cpath-to-extracted-directory\u003e'\n```\n\n* Check that you have the tool `uuidgen`, otherwise install `util-linux` Cygwin package.\n\n#### 3. Install the plugin\n```bash\nopam pin https://github.com/OCamlPro/opam-wix.git\n```\n\n## Usage\n\n\u003e If you are using the MinGW compiler, please specify Windows paths with the backslash ('\\') delimiter everywhere, except for the path to Wix, which should be in the form `/cygdrive/...`.\"  \n\nTo generate MSI file for the executable installed by `pkg` run:\n\n```bash\nopam wix pkg\n```\n\nTo generate MSI file for an executable `bin` within package `pkg` run:\n\n```bash\nopam wix pkg --binary bin --wix-path $WIXPATH\n```\n\nTo generate MSI file for an executable from the file system `bin-path` boxed in `pkg`, run:\n\n```bash\nopam wix pkg --binary-path bin-path --wix-path $WIXPATH\n```\n\nFor customize interface purpose you can override some default graphic components like main icon :\n```bash\nopam wix pkg --binary bin --wix-path $WIXPATH --ico new/path/to/icon\n```\n\n**Note**:\n- Chosen executable shouldn't be a script!\n- Since `WIXPATH` often contains spaces, it is fine if program prints the warning about it.\n\nFor more information :\n\n```\nSYNOPSIS\n       opam-wix PACKAGE [-b NAME|--bp PATH] [OTHER OPTION]…\n\nDESCRIPTION\n       This utility is an opam plugin that generates a standalone MSI file.\n       This file is used by Windows Installer to make available a chosen\n       executable from an opam package throughout the entire system.\n\n       Generated MSI indicates to system to create an installation directory\n       named 'Package Version.Executable' under \"Program Files\" folder and to\n       store there the following items:\n\n       executable.exe\n           The selected executable file from package 'PACK'. There are two\n           options how to indicate where to find this binary. First, is to let\n           opam find binary with the same name for you with -b option. Second,\n           is to use the path to binary with --bp option. In this case binary\n           will be considered as a part of package and its metadata.\n\n       *.dll\n           All executable's dependencies libriries found with cygcheck.\n\n       icon and *.bmp\n           Additional files used by installer to customise GUI. Options --ico,\n           --dlg-bmp and --ban-bmp could be used to bundle custom files.\n\n       Additionnaly, installer gives to user a possibility to create a\n       shortcut on Desktop and Start menu as well as adding installation\n       folder to the PATH.\n\nPACKAGE ARGUMENT\n       PACKAGE (required)\n           The package to create an installer\n\nBINARY ARGUMENT\n       -b NAME, --binary=NAME\n           The binary name to handle. Specified package should contain the\n           binary with the same name.\n\n       --bp=PATH, --binary-path=PATH\n           The path to the binary file to handle\n\nOTHER OPTIONS\n       --ban-bmp=FILE\n           BMP file that is used as background for banner for installer.\n\n       --dlg-bmp=FILE\n           BMP file that is used as background for dialog window for\n           installer.\n\n       --ico=FILE\n           Logo icon that will be used for application.\n\n       -o DIR, --output=DIR (absent=~/OPAM/opam-wix)\n           The output directory where bundle will be stored\n\n       --pkg-guid=UID\n           The package GUID that will be used to update the same package with\n           different version without processing throught Windows Apps \u0026\n           features panel\n\n       --conf=PATH\n           Configuration file for the binary to install.\n```\n### Config file\n\n```\nConfiguration\n       Despite arguments allowing partial configuration of the utility, for\n       complete support of installing complex programs and non self-contained\n       binaries, it is necessary to provide a config file with opam-format\n       syntax (See https://opam.ocaml.org/doc/Manual.html). Such a file allows\n       opam-wix to determine which additional files and directories should be\n       installed along with the program, as well as which environment\n       variables need to be set in the Windows Terminal.\n\n       To specify paths to specific files, you can use variables defined by\n       opam, for example, %{share}%/path, which adds the necessary prefix. For\n       more information about variables, refer to\n       https://opam.ocaml.org/doc/Manual.html#Variables. The config file can\n       contain the following fields:\n\n       opamwix-version\n           The version of the config file. The current version is 0.1.\n\n       ico, bng, ban\n           These are the same as their respective arguments.\n\n       binary-path, binary\n           These are the same as their respective arguments.\n\n       wix_version, version\n           The  version  to use to generate the MSI, in a dot separated number\n           format.\n\n       embedded\n           A list of files or directories paths to include in the installation\n           directory. There are 3 different ways to specify the paths, each of\n           them implies its own installation place in the target directory:\n           \n           First way to install files is by giving a list of two elements: the\n           first being the destination basename (the name of the file in the\n           installation directory), and the second being the path to the file\n           itself. For example: [\"file.txt\" \"path/to/file\"]. \n           \n           The second way is to include any file/directory under opam prefix. \n           In this case, variables like %{share}% or %{lib}% could be very usefull. \n           You should just give a list with one string that represents path which\n           prefix is the same with your current switch prefix. For example,\n           [\"/%{odoc:lib}%/odoc.cmi\"]. Those files would be installed in the\n           directory \"opam\" at the root of installation directory conserving\n           entire path (it would be INSTALLDIR/opam/lib/odoc/odoc.cmi for\n           previous example). \n           \n           The last way to specify path is very similar with previous, but it \n           takes into account only external to opam files. The paths to thoses \n           files should be relative and implicit. For example, [\"dir1/dir2/file.txt\"]. \n           The file (or directory) will be installed in \"external\" directory under \n           the root of target installation directory the same way as for opam files \n           (it would be INSTALLDIR/external/dir1/dir2/file.txt for previous example).\n\n       envvar\n           A list of environment variables to set/unset in the Windows\n           Terminal during install/uninstall. Each element in this list should\n           be a list of two elements: the name and the value of the variable.\n           Basenames defined with \"embedded\" field could be used as variables, to\n           reference absolute installed path. For example:\n           embedded: [ \"mydoc\" \"%{package:doc}%\"]\n           envvar: [ \"DOC\" \"%{mydoc}%\"]\n           will install directory referenced by package:doc opam variable in\n           \u003cinstall-dir\u003e/mydoc and set DOC environment variable to the\n           \u003cinstall-dir\u003e/mydoc absolute path\n```\n\n### Config file example\n\n```\nopamwix-version : \"0.1\"\nembedded : [\n    [ \"dune\" \"%{bin}%/dune\"]\n    [ \"opamACL.ml\" \"%{lib}%/opam-core/opamACL.ml\"]\n    [ \"dune-project\" \"./dune-project\"]\n    [ \"share\" \"%{share}%/dune\"]\n    [ \"data\" \"./data\"]\n]\nenvvar : [\n    [ \"FOO_VAR\" \"foo\"]\n    [ \"OPAM_ACL_PATH\" \"%{opamACL.ml}%\"]\n    [ \"FOO_SHARE\" \"%{share}%\"]\n]\n\n```\n\n\n## Installer\n\nFinal installer GUI consists of three component :\n\n**The Welcome page** serves as the initial step when running the installer. It provides essential information about the package-executable pair that you are about to install.\n\n\u003cimg src=\"etc/images/WelcomePage.png\" alt=\"drawing\" style=\"width:400px;\"/\u003e\n\n**Installation Options.** During the installation process, you will be presented with various options to customize the installation according to your preferences. The Installation Options section allows you to make the following choices:\n\n1. **Path Selection:** You have the flexibility to choose the desired path on your Windows system where you want to install the executable.\n\n2. **Shortcut Creation:** You can decide whether you want shortcuts to be created for the installed software. You have two choices:\n\n   - **Desktop:** Selecting this option will create a shortcut icon on your desktop.\n\n   - **Start Menu:** By choosing this option, a shortcut to the software will be added to the Start Menu.\n\n3. **`PATH` Environment Variable:** You can choose whether or not to add the path to the installed binary in the `PATH` environment variable. On uninstall, the installer will remove the path to the installed binary from the `PATH` variable.\n\n\u003cimg src=\"etc/images/InstallSettings.png\" alt=\"drawing\" style=\"width:400px\"/\u003e\n\nAfter installation is done, you would like to remove it one day. For this purpose you should relaunch msi package and to click on **Remove**.\n\n\u003cimg src=\"etc/images/Remove.png\" alt=\"drawing\" style=\"width:400px\"/\u003e\n\n## Licence\n\nCopyright 2023 OCamlPro\n\nAll rights reserved. This file is distributed under the terms of the\nGNU Lesser General Public License version 2.1, with the special\nexception on linking described in the file LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focamlpro%2Fopam-wix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focamlpro%2Fopam-wix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focamlpro%2Fopam-wix/lists"}