Skip to content

MSI Installer#334

Merged
ianlivingstone merged 17 commits intomanifoldco:masterfrom
morochena:windows-installer
Dec 19, 2017
Merged

MSI Installer#334
ianlivingstone merged 17 commits intomanifoldco:masterfrom
morochena:windows-installer

Conversation

@morochena
Copy link
Contributor

Uses go-msi to generate a .msi installer for windows, and allows for distribution via chocolately.

Copy link
Contributor

@ianlivingstone ianlivingstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good, the thing we need to think about is how this fits into the current build/package/upload process we take during a release.

Today, it's all done locally through the Makefile via the release-all target.

In future, I think this will probably need to be done separetely, on *nix for releasing the linux/macosx and then on a separate machine for windows.

Ideally, we can figure out how to do the releasing component securely via appveyor then this can just be done on build of a release tag by appveyor.

For now, I've left some comments throughout the PR to kick off a few discussions around how to get this into mergable shape. I think our best bet is to create a new target in the Makefile for bootstrapping locally (e.g. get go-msi and wix installed) on windows and another for actually building and packaging up the msi.

Thoughts?

appveyor.yml Outdated
install:
# wix setup
- set PATH=%WIX%\bin;%PATH%
# go-msi install - static link method
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if these should be in a bootstrap-windows component of the Makefile?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I'll add mingw32-make to appveyor so we're able to use the Makefile in appveyor.yml.

appveyor.yml Outdated

build_script:
- c:\gopath\bin\dep.exe ensure
- go build -o torus.exe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, we're probably going to have to separate out building the windows binary (and now the installer + uploading it) from the rest of the Makefile when we build a release through make release-all.

If you want to introduce a make msi that requires the os to be windows and for wix/go-msi to be available (if possible) then I think we can open another issue (or subsequent PR) that has the changes to actually separately build, package, and upload a windows release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I introduced an initial make msi that checks for go-msi, but I'll add os detection and hook it into the appveyor.yml.

<Component Id="ApplicationFiles" Guid="{{.Files.GUID}}">
{{range $i, $e := .Files.Items}}
<File Id="ApplicationFile{{$i}}" Source="{{$e}}"/>
<!--
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this right? Since we're not installing it as a service?


<Media Id="1" Cabinet="product.cab" EmbedCab="yes"/>

<Upgrade Id="{{.UpgradeCode}}">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a rule for forcing the upgrade of Torus right? Is there a way we can run a command at the same time?

When we upgrade an existing install we should also restart the daemon via torus daemon stop. Ideally we also tell them that after upgrading they will need to log into Torus again via the command prompt (or whichever shell they use).

wix.json Outdated
"product": "torus",
"company": "manifoldco",
"license": "LICENSE.md",
"version": "0.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the version of the binary right? Ideally this file can be tempalted like package.json inside packaging/npm which is then filled in prior to packaging.

This way we can pull the correct version in as well.

wix.json Outdated
"company": "manifoldco",
"license": "LICENSE.md",
"version": "0.0.1",
"upgrade-code": "8615055C-D8E0-404C-93BE-441C503BA6F0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What sets this upgrade code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ go-msi set-guid generates them

@@ -0,0 +1,9 @@
From: {{.Choco.LicenseURL}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking a bit about this, for now it's probably easiest just to get the wix support into the build pipeline so we're producing and uploading a real msi installer, then come back to thinking about Choco support.

Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I'll remove the Chocolatey artifacts for now.

added msi target to makefile
- msi make target
- bootstrap-windows make target
- removed chocolatey packaging
- updated appveyor.yml to use makefile
uncommented upgrade code
added msi target to makefile
- msi make target
- bootstrap-windows make target
- removed chocolatey packaging
- updated appveyor.yml to use makefile
@@ -0,0 +1,38 @@
<?xml version="1.0"?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need these templates for choco right?

Makefile Outdated
# Generate Windows .msi
#################################################

msi: binary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should depend on the release-binary-windows rule? This way it also gets put inside the builds/ directory. The subsequent msi should probably also be placed there as well, so it gets deleted on make clean.

Copy link
Contributor

@ianlivingstone ianlivingstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two changes:

  1. See if we can depend on binary-windows for building the binaries and having them populated into the builds/ folder.
  2. The templates for choco should probably be removed as nothing will be using them right now.

Otherwise this looks great! Once we've resolved those two points and we've rebased this onto master, this is ready for merge :)

- msi target now relies on release-binary
- msi target outputs to builds folder
- wix.json relies on torus.exe existing in builds folder
@AppVeyorBot
Copy link

Build torus-cli 400 failed (commit d7c612ed5e by @morochena)

@AppVeyorBot
Copy link

Build torus-cli 409 completed (commit 64ae3225fa by @morochena)

wix.json Outdated
@@ -0,0 +1,30 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be checked in right as it's a templated file?

@ianlivingstone ianlivingstone merged commit 21350a3 into manifoldco:master Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants