• Stars
    star
    425
  • Rank 102,094 (Top 3 %)
  • Language
    Go
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Easy way to generate msi package for a Go project

Sponsor

go-msi

Appveyor Status

Package go-msi helps to generate msi package for a Go project.

This tool is part of the go-github-release workflow

Find a demo program here

TOC

Install

Check the release page!

Go

go get github.com/mh-cbon/go-msi

Bintray

choco source add -n=mh-cbon -s="https://api.bintray.com/nuget/mh-cbon/choco"
choco install go-msi

Chocolatey

choco install go-msi

linux rpm/deb repository

wget -O - https://raw.githubusercontent.com/mh-cbon/latest/master/bintray.sh \
| GH=mh-cbon/go-msi sh -xe
# or
curl -L https://raw.githubusercontent.com/mh-cbon/latest/master/bintray.sh \
| GH=mh-cbon/go-msi sh -xe

linux rpm/deb standalone package

curl -L https://raw.githubusercontent.com/mh-cbon/latest/master/install.sh \
| GH=mh-cbon/go-msi sh -xe
# or
wget -q -O - --no-check-certificate \
https://raw.githubusercontent.com/mh-cbon/latest/master/install.sh \
| GH=mh-cbon/go-msi sh -xe

Usage

Requirements

  • A windows machine (see here for an appveyor file, see here for unix friendly users)
  • wix >= 3.10 (may work on older release, but it is untested, feel free to report)
  • you must add wix bin to your PATH
  • use check-env sub command to get a report.

Workflow

For simple cases,

  • Create a wix.json file like this one
  • Apply it guids with go-msi set-guid, you must do it once only for each app.
  • Run go-msi make --msi your_program.msi --version 0.0.2

configuration file

wix.json file describe the desired packaging rules between your sources and the resulting msi file.

Check the demo json file

Post an issue if it is not self-explanatory.

Always double check the documentation and SO when you face a difficulty with heat, candle, light

If you wonder why INSTALLDIR, [INSTALLDIR], this is part of wix rules, please check their documentation.

License file

Take care to the license file, it must be an rtf file, it must be encoded with Windows1252 charset.

I have provided some tools to help with that matter.

Personnalization

wix templates

For simplicity a default install flow is provided, which you can find here

You can create a new one for your own personalization, you should only take care to reproduce the go templating already defined for files, directories, environment variables, license and shortcuts.

I guess most of your changes will be about the WixUI_HK.wxs file.

Cli

$ go-msi -h
NAME:
   go-msi - Easy msi pakage for Go

USAGE:
   go-msi <cmd> <options>

VERSION:
   0.0.0

COMMANDS:
     check-json          Check the JSON wix manifest
     check-env           Provide a report about your environment setup
     set-guid            Sets appropriate guids in your wix manifest
     generate-templates  Generate wix templates
     to-windows          Write Windows1252 encoded file
     to-rtf              Write RTF formatted file
     gen-wix-cmd         Generate a batch file of Wix commands to run
     run-wix-cmd         Run the batch file of Wix commands
     make                All-in-one command to make MSI files
     choco               Generate a chocolatey package of your msi files
     help, h             Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version
$ go-msi check-env -h
NAME:
   go-msi check-env - Provide a report about your environment setup

USAGE:
   go-msi check-env [arguments...]
$ go-msi check-json -h
NAME:
   go-msi check-json - Check the JSON wix manifest

USAGE:
   go-msi check-json [command options] [arguments...]

OPTIONS:
   --path value, -p value  Path to the wix manifest file (default: "wix.json")
$ go-msi set-guid -h
NAME:
   go-msi set-guid - Sets appropriate guids in your wix manifest

USAGE:
   go-msi set-guid [command options] [arguments...]

OPTIONS:
   --path value, -p value  Path to the wix manifest file (default: "wix.json")
   --force, -f             Force update the guids
$ go-msi make -h
NAME:
   go-msi make - All-in-one command to make MSI files

USAGE:
   go-msi make [command options] [arguments...]

OPTIONS:
   --path value, -p value     Path to the wix manifest file (default: "wix.json")
   --src value, -s value      Directory path to the wix templates files (default: "/home/mh-cbon/gow/bin/templates")
   --out value, -o value      Directory path to the generated wix cmd file (default: "/tmp/go-msi645264968")
   --arch value, -a value     A target architecture, amd64 or 386 (ia64 is not handled)
   --msi value, -m value      Path to write resulting msi file to
   --version value            The version of your program
   --license value, -l value  Path to the license file
   --keep, -k                 Keep output directory containing build files (useful for debug)
$ go-msi choco -h
NAME:
   go-msi choco - Generate a chocolatey package of your msi files

USAGE:
   go-msi choco [command options] [arguments...]

OPTIONS:
   --path value, -p value           Path to the wix manifest file (default: "wix.json")
   --src value, -s value            Directory path to the wix templates files (default: "/home/mh-cbon/gow/bin/templates/choco")
   --version value                  The version of your program
   --out value, -o value            Directory path to the generated chocolatey build file (default: "/tmp/go-msi697894350")
   --input value, -i value          Path to the msi file to package into the chocolatey package
   --changelog-cmd value, -c value  A command to generate the content of the changlog in the package
   --keep, -k                       Keep output directory containing build files (useful for debug)
$ go-msi generate-templates -h
NAME:
   go-msi generate-templates - Generate wix templates

USAGE:
   go-msi generate-templates [command options] [arguments...]

OPTIONS:
   --path value, -p value     Path to the wix manifest file (default: "wix.json")
   --src value, -s value      Directory path to the wix templates files (default: "/home/mh-cbon/gow/bin/templates")
   --out value, -o value      Directory path to the generated wix templates files (default: "/tmp/go-msi522345138")
   --version value            The version of your program
   --license value, -l value  Path to the license file
$ go-msi to-windows -h
NAME:
   go-msi to-windows - Write Windows1252 encoded file

USAGE:
   go-msi to-windows [command options] [arguments...]

OPTIONS:
   --src value, -s value  Path to an UTF-8 encoded file
   --out value, -o value  Path to the ANSI generated file
$ go-msi to-rtf -h
NAME:
   go-msi to-rtf - Write RTF formatted file

USAGE:
   go-msi to-rtf [command options] [arguments...]

OPTIONS:
   --src value, -s value  Path to a text file
   --out value, -o value  Path to the RTF generated file
   --reencode, -e         Also re encode UTF-8 to Windows1252 charset
$ go-msi gen-wix-cmd -h
NAME:
   go-msi gen-wix-cmd - Generate a batch file of Wix commands to run

USAGE:
   go-msi gen-wix-cmd [command options] [arguments...]

OPTIONS:
   --path value, -p value  Path to the wix manifest file (default: "wix.json")
   --src value, -s value   Directory path to the wix templates files (default: "/home/mh-cbon/gow/bin/templates")
   --out value, -o value   Directory path to the generated wix cmd file (default: "/tmp/go-msi844736928")
   --arch value, -a value  A target architecture, amd64 or 386 (ia64 is not handled)
   --msi value, -m value   Path to write resulting msi file to
$ go-msi run-wix-cmd -h
NAME:
   go-msi run-wix-cmd - Run the batch file of Wix commands

USAGE:
   go-msi run-wix-cmd [command options] [arguments...]

OPTIONS:
   --out value, -o value  Directory path to the generated wix cmd file (default: "/tmp/go-msi773158361")

Recipes

Appveyor

Please check this

Unix like

Please check this

Release the project

gump patch -d # check
gump patch # bump

History

CHANGELOG

Credits

A big big thanks to

More Repositories

1

template-compiler

Compile text/template / html/template to regular go code
Go
121
star
2

go-bin-rpm

Create binary rpm package with ease
Go
88
star
3

go-github-release

Guide to release automation
Shell
74
star
4

go-bin-deb

Create binary package for debian system
Go
41
star
5

dht

golang dht / Kademlia
Go
24
star
6

emd

Enhanced Markdown template processor
Go
14
star
7

changelog

Maintain a changelog easily
Go
8
star
8

gssc

Easily starts an HTTPS server with self-signed certificates
Go
7
star
9

gump

Bin util to bump your package using semver
Go
7
star
10

astutil

Package astutil provides useful methods to work with ast when you intend to make a generator.
Go
6
star
11

dht-store

dht fun bep44
Go
5
star
12

lister

generates typed slice
Go
5
star
13

http-file-store

HTTP server to store files
JavaScript
4
star
14

jedi

database golang generator: dbr additions
Go
4
star
15

gh-api-cli

Command line client for github api
Go
4
star
16

plumber

builds pipes to transform a data stream
Go
4
star
17

ignore-file

Parse and test an ignore file, such as .gitignore
Go
3
star
18

gigo

go generate on steroids
Go
3
star
19

webtorrent-http-api

json http api for webtorrent
JavaScript
3
star
20

the-busy-man

initialize a project
Go
3
star
21

goriller

goriller generate gorilla routers
Go
3
star
22

testndoc

generate API documentation by listening to your tests.
Go
3
star
23

go-get-started

get started with go
Go
3
star
24

extract-imports

A program to extract import directives of given go files.
Go
3
star
25

mdl-go-components

MDL for go
Go
3
star
26

youtube-dl

Python
3
star
27

state-lexer

A state Lexer similar to Rob Pike's presentation
Go
3
star
28

sudo-fs

Like fs module. To use with sudo / elevate. Works on linux, mac, windows.
JavaScript
3
star
29

rm-glob

Rm globed files
Go
2
star
30

dhtest

dht bep44 upt http
Go
2
star
31

latest

A centralized and publicly hosted sh script to install latest debian or rpm package
Go
2
star
32

netlisten

listen a net address and copy to a destination
Go
2
star
33

aze

a proxy to reduce bandwidth
Go
2
star
34

go-repo-utils

Go tool to speak with repositories
Go
2
star
35

html-parser-lexer

Parse html content
Go
2
star
36

cct

concurrently run cli commands
Go
2
star
37

report-panic

Automatically report your programs panic to their github repository
Go
2
star
38

mutexer

generator to generate mutexed version of a type
Go
2
star
39

httper

implement http interface of a type
Go
2
star
40

channeler

generate channel version of a type
Go
2
star
41

go-fmt-fail

go fmt fails when a file is formatted.
Go
2
star
42

philea

Apply commands on globbed files
Go
2
star
43

foreach

bin util to iterate over a list of separated things and call for an external command `foreach` thing found
Go
2
star
44

launchd-simple-api

Simple api for node to manage services via macosx launchd
JavaScript
2
star
45

sc-simple-api

Simple api for node to manage services via windows sc/NSSM
JavaScript
2
star
46

http-multidir

Serve multiple static directories under the same prefix
Go
2
star
47

systemd-simple-api

Simple api for node to manage services via systemd
JavaScript
2
star
48

aghfabsowecwn

A more complete support of windows elevated commands with Node
JavaScript
2
star
49

dht-hook

push dht announces to http remotes
Go
1
star
50

which-service-manager

Tells which service manager the system is running
JavaScript
1
star
51

yasudo

yet another sudo command helper
JavaScript
1
star
52

go-async

Helper for // execution
Go
1
star
53

node-rp-php

For The Fun ! Using node to reverse proxy php servers. Less than 200 lines of code !
JavaScript
1
star
54

rclone-json

Stream an rclone sync activity as a json object stream.
Go
1
star
55

template-tree-simplifier

simplify a template AST via a serie of transformations
Go
1
star
56

pkg-source-to-pkg-json

Transforms a downloadable package source string into its package.json equivalent
JavaScript
1
star
57

archive

bin to create / extract zip, tgz archives
Go
1
star
58

make-that-ssl-cert

node binary to generate an SSL certificate w/o openssl
JavaScript
1
star
59

http-clienter

generate http client of a type
Go
1
star
60

sp-nsi-sc

Parse service file used by nsi to consume windows sc
JavaScript
1
star
61

ggt

ggt's generator toolbox
Go
1
star
62

c-aghfabsowecwn

Singleton server for aghfabsowecwn
JavaScript
1
star
63

fork

fork a repository in your GOPATH
Go
1
star
64

has-systemd

tells if a system runs systemd service manager
JavaScript
1
star
65

traductions

Translating english papers to my native language (fr)
1
star
66

stringexec

cross platform go lib to execute a command string
Go
1
star
67

vagrant-pack

Tool to pack your local vagrant boxes to a tar.gz file
JavaScript
1
star
68

gen-version-file

Generate a version file
Go
1
star
69

666

Visually display success or failure of a command
Go
1
star
70

boltgrpc

gRPC interface for boltdb
Go
1
star
71

build-them-all

Bin util to build go programs to multiple targets
Go
1
star
72

service-finder

Register a concrete service, then locate it by an interface or its concrete type
Go
1
star
73

guess-path

Guess the path containing the desired packaged resources
Go
1
star
74

ghost

per directory dns delcaration for multi environment work related
1
star
75

tail-fs-readable

A readable stream to tail a file
JavaScript
1
star
76

is-consenting

Tells if consent.exe (uac) is running
JavaScript
1
star
77

which-win

Tells which windows system version is being run
JavaScript
1
star
78

vlc-invoke

Ease vlc invokation accross multiple platforms, extracted from peerflix
JavaScript
1
star
79

uri-to-stream

Transforms an uri string to a stream
JavaScript
1
star
80

sp-systemd-unit

Stream parser for systemd unit files
JavaScript
1
star
81

nssm-prebuilt

Node package for prebuilt nssm
JavaScript
1
star
82

has-sc

tells if a system runs windows sc service manager
JavaScript
1
star
83

sp-nsi-sysv

Parse service file used by nsi to consume sysv
Shell
1
star
84

bonjour-over-http

Http server to find / announce bonjour services
JavaScript
1
star
85

getent

getent to json
JavaScript
1
star
86

windows-net

Execute windows net commands and get JSON responses
JavaScript
1
star
87

upstart-simple-api

Simple api for node to manage services via upstart
JavaScript
1
star
88

monitor-power

A golang daemon to graph the computer power usage into prometheus or expvar.
Go
1
star
89

catf

just cat files
JavaScript
1
star
90

cors-proxy

A proxy to handle CORS on non-compatible CORS websites
JavaScript
1
star
91

write

binary to write a file
JavaScript
1
star
92

npm-pkg-dl

Download a package like npm and make it available into a temporary folder
JavaScript
1
star
93

dscl-users

Macos helper to help manage user and group
JavaScript
1
star
94

vagrant-box-list

List local vagrant boxes
JavaScript
1
star
95

win-uac

Enable / Disable UAC on windows
JavaScript
1
star
96

dscacheutil

dscacheutil to json
JavaScript
1
star
97

nsi

Install a node package as a service
JavaScript
1
star
98

disksinfo

get the list of partitions
Go
1
star
99

http-file-store-webapp

webapp to manage files over http
JavaScript
1
star
100

chkconfig-simple-api

Simple api to manage services via chkconfig sysvinit helper
JavaScript
1
star