Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Add script to generate Windows installers (.msi) #58

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ build:

install:
go install ${BUILD_FLAGS} ./cmd/secrethub

msi:
Copy link
Member

Choose a reason for hiding this comment

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

Consider adding the make msi command to the goreleaser config as a pre or post build hook (not sure which would be preferred here, I think post). Then we can include the resulting .msi files in the release.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried that at first, but those hooks very limited. Can have another look later.

./msi.sh
11 changes: 11 additions & 0 deletions msi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
NAME="SecretHub CLI"
EXE=bin/secrethub.exe
VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))
MANUFACTURER=SecretHub
UPGRADE_CODE=7178CB18-B431-4A9D-B29E-D31E63A1CF77
Copy link
Member

Choose a reason for hiding this comment

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

Is this a static value?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes this is an arbitrary GUID to identify our app, so Windows knows it's same app across potential name changes.

Copy link
Member

Choose a reason for hiding this comment

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

Ah ok, got it 👍 Consider adding a comment as this is some weird arcane MSI knowledge.

ICON="/dist/secrethub.png"

curl -s -o dist/secrethub.png https://secrethub.io/img/secrethub-logo-rgb-shield-square.png
mkdir -p dist/msi
docker run -v $(pwd)/dist:/dist msi-packager /dist/windows_amd64 /dist/msi/secrethub_windows_amd64.msi -n $NAME -e $EXE -v $VERSION -m $MANUFACTURER -u $UPGRADE_CODE -i $ICON --local
docker run -v $(pwd)/dist:/dist msi-packager /dist/windows_386 /dist/msi/secrethub_windows_386.msi -n $NAME -e $EXE -v $VERSION -m $MANUFACTURER -u $UPGRADE_CODE -i $ICON --local