summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2019-09-11 14:35:18 -0700
committerJhon Honce <jhonce@redhat.com>2019-09-11 16:15:52 -0700
commitecb958e59851186630e946d7973d91f8d524ea17 (patch)
treebc476050109b042906b08b9bdb909fc26bee061d
parent79ebb5f254d6f3498500f823cf1b856fed2e6149 (diff)
downloadpodman-ecb958e59851186630e946d7973d91f8d524ea17.tar.gz
podman-ecb958e59851186630e946d7973d91f8d524ea17.tar.bz2
podman-ecb958e59851186630e946d7973d91f8d524ea17.zip
Support building Windows msi file
* Update Makefile to build msi * Add podman.wxs to define podman.msi * Version information provided by Makefile * Add podman.bat wrapper for podman-remote-windows.exe to ensure environment * Add wix xml schemas for reference Signed-off-by: Jhon Honce <jhonce@redhat.com>
-rw-r--r--Makefile5
-rw-r--r--contrib/msi/podman.bat43
-rw-r--r--contrib/msi/podman.wxs45
3 files changed, 93 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 840bfced7..b4f8020f2 100644
--- a/Makefile
+++ b/Makefile
@@ -84,6 +84,7 @@ GINKGOTIMEOUT ?= -timeout=90m
RELEASE_VERSION ?= $(shell hack/get_release_info.sh VERSION)
RELEASE_NUMBER ?= $(shell hack/get_release_info.sh NUMBER)
+RELEASE_NUMERIC = $(shell echo $(RELEASE_NUMBER) |sed -e 's/^v\(.*\)/\1/')
RELEASE_DIST ?= $(shell hack/get_release_info.sh DIST)
RELEASE_DIST_VER ?= $(shell hack/get_release_info.sh DIST_VER)
RELEASE_ARCH ?= $(shell hack/get_release_info.sh ARCH)
@@ -164,6 +165,10 @@ podman: .gopathok $(PODMAN_VARLINK_DEPENDENCIES) ## Build with podman
podman-remote: .gopathok $(PODMAN_VARLINK_DEPENDENCIES) ## Build with podman on remote environment
$(GO_BUILD) $(BUILDFLAGS) -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags "$(BUILDTAGS) remoteclient" -o bin/$@ $(PROJECT)/cmd/podman
+.PHONY: podman.msi
+podman.msi: podman-remote-windows ## Will always rebuild exe as there is no podman-remote-windows.exe target to verify timestamp
+ wixl -D VERSION=$(RELEASE_NUMERIC) -o bin/podman-$(RELEASE_NUMBER).msi contrib/msi/podman.wxs
+
podman-remote-%: .gopathok $(PODMAN_VARLINK_DEPENDENCIES) ## Build podman for a specific GOOS
$(eval BINSFX := $(shell test "$*" != "windows" || echo ".exe"))
CGO_ENABLED=0 GOOS=$* $(GO_BUILD) -gcflags '$(GCFLAGS)' -asmflags '$(ASMFLAGS)' -ldflags '$(LDFLAGS_PODMAN)' -tags "remoteclient containers_image_openpgp exclude_graphdriver_devicemapper" -o bin/$@$(BINSFX) $(PROJECT)/cmd/podman
diff --git a/contrib/msi/podman.bat b/contrib/msi/podman.bat
new file mode 100644
index 000000000..091c1c4c4
--- /dev/null
+++ b/contrib/msi/podman.bat
@@ -0,0 +1,43 @@
+@echo off
+setlocal enableextensions
+
+title Podman
+
+:: If remote-host is given on command line -- use it
+setlocal enabledelayedexpansion
+for %%a in (%*) do (
+ echo "%%a" |find "--remote-host" >NUL
+ if !errorlevel! == 0 (
+ goto run_podman
+ )
+)
+
+:: If PODMAN_VARLINK_BRIDGE is set -- use it
+if defined PODMAN_VARLINK_BRIDGE (
+ goto run_podman
+)
+
+:: If the configuration file exists -- use it
+set config_home=%USERPROFILE%\AppData\podman
+set config_file=%config_home%\podman-remote.conf
+if exist "%config_file%" (
+ goto run_podman
+)
+
+:: Get connection information from user and build configuration file
+md "%config_home%"
+set /p host="Please enter the remote hosts name or IP address: "
+set /p user="Please enter the remote user name: "
+(
+ echo [connections]
+ echo [connections."%host%"]
+ echo destination = "%host%"
+ echo username = "%user%"
+ echo default = true
+) >"%config_file%"
+
+:run_podman
+endlocal
+podman-remote-windows.exe %*
+
+:End
diff --git a/contrib/msi/podman.wxs b/contrib/msi/podman.wxs
new file mode 100644
index 000000000..165bb42b6
--- /dev/null
+++ b/contrib/msi/podman.wxs
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+
+ <?ifndef var.VERSION?>
+ <?error VERSION must be defined via command line argument?>
+ <?endif?>
+
+ <Product Name="Podman $(var.VERSION)" Id="*" UpgradeCode="696BAB5D-CA1F-4B05-B123-320F245B8D6D" Version="$(var.VERSION)" Language="1033" Manufacturer="Red Hat Inc.">
+
+ <Package Id="*" Keywords="Installer" Description="Red Hat's Podman $(var.VERSION) Installer" Comments="Apache 2.0 License" Manufacturer="Red Hat Inc." InstallScope="perMachine" InstallerVersion="100" Compressed="yes"/>
+ <Media Id="1" Cabinet="Podman.cab" EmbedCab="yes"/>
+ <Property Id="DiskPrompt" Value="Red Hat's Podman $(var.VERSION) Installation"/>
+
+ <Directory Id="TARGETDIR" Name="SourceDir">
+
+ <Directory Id="ProgramFilesFolder" Name="PFiles">
+ <Directory Id="RedHatPFiles" Name="RedHat">
+ <Directory Id="INSTALLDIR" Name="Podman">
+ <Component Id="INSTALLDIR_Component" Guid="14B310C4-9B5D-4DA5-ADF9-B9D008E4CD82">
+ <CreateFolder/>
+ </Component>
+ <Component Id="MainExecutable" Guid="73752F94-6589-4C7B-ABED-39D655A19714">
+ <File Id="520C6E17-77A2-4F41-9611-30FA763A0702" Name="podman-remote-windows.exe" Source="bin/podman-remote-windows.exe"/>
+ <File Id="A14218A0-4180-44AC-B109-7C63B3099DCA" Name="podman.bat" Source="podman.bat" KeyPath="yes"/>
+ </Component>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+
+ <Property Id="setx" Value="setx.exe"/>
+ <CustomAction Id="ChangePath" ExeCommand='PATH "%PATH%;[INSTALLDIR]"' Property="setx" Execute="deferred" Impersonate="yes" Return="check"/>
+
+ <Feature Id="Complete" Level="1">
+ <ComponentRef Id="INSTALLDIR_Component"/>
+ <ComponentRef Id="MainExecutable"/>
+ </Feature>
+
+ <InstallExecuteSequence>
+ <RemoveExistingProducts Before="InstallInitialize"/>
+ <Custom Action="ChangePath" After="InstallServices">NOT Installed</Custom>
+ </InstallExecuteSequence>
+
+ </Product>
+</Wix>