build: windows installer fixups

- make whitespace in build/*.{nsi,nsh} consistenly two spaces
- remove bootnode, disasm from alltools archives
- use whole-installer lzma compression
- add git commit to the displayed version string
- place installer .exe in the repository root
- never delete the -workdir
This commit is contained in:
Felix Lange 2016-11-08 19:30:35 +01:00
parent 5f3ae3e7f4
commit 8c2c9e207b
4 changed files with 113 additions and 114 deletions

View file

@ -69,8 +69,6 @@ var (
executablePath("evm"), executablePath("evm"),
executablePath("geth"), executablePath("geth"),
executablePath("rlpdump"), executablePath("rlpdump"),
executablePath("disasm"),
executablePath("bootnode"),
} }
// A debian package is created for all executables listed here. // A debian package is created for all executables listed here.
@ -579,22 +577,6 @@ func doWindowsInstaller(cmdline []string) {
env := build.Env() env := build.Env()
maybeSkipArchive(env) maybeSkipArchive(env)
defer os.RemoveAll(*workdir)
// Configure and run the NSIS installer maker. This assumes that all the needed
// files have been previously built (don't mix building and packaging to keep
// cross compilation complexity to a minimum).
var (
base = archiveBasename(*arch, env)
installerName = "geth-" + base
installFilename = "/DOUTPUTFILE=" + installerName
version = strings.Split(build.VERSION(), ".")
majorVersion = "/DMAJORVERSION=" + version[0]
minorVersion = "/DMINORVERSION=" + version[1]
buildId = "/DBUILDVERSION=" + version[2]
buildArch = "/DARCH=" + *arch
)
// Aggregate binaries that are included in the installer // Aggregate binaries that are included in the installer
var ( var (
devTools []string devTools []string
@ -612,26 +594,40 @@ func doWindowsInstaller(cmdline []string) {
devTools = append(devTools, file) devTools = append(devTools, file)
} }
} }
// Render NSIS scripts: Installer NSIS contains two installer sections, // Render NSIS scripts: Installer NSIS contains two installer sections,
// first section contains the geth binary, second section holds the dev tools. // first section contains the geth binary, second section holds the dev tools.
installer := map[string]interface{}{ templateData := map[string]interface{}{
"License": "COPYING", "License": "COPYING",
"Geth": gethTool, "Geth": gethTool,
"DevTools": devTools, "DevTools": devTools,
} }
build.Render("build/nsis.geth.nsi", filepath.Join(*workdir, "geth.nsi"), 0644, nil) build.Render("build/nsis.geth.nsi", filepath.Join(*workdir, "geth.nsi"), 0644, nil)
build.Render("build/nsis.install.nsh", filepath.Join(*workdir, "install.nsh"), 0644, installer) build.Render("build/nsis.install.nsh", filepath.Join(*workdir, "install.nsh"), 0644, templateData)
build.Render("build/nsis.uninstall.nsh", filepath.Join(*workdir, "uninstall.nsh"), 0644, allTools) build.Render("build/nsis.uninstall.nsh", filepath.Join(*workdir, "uninstall.nsh"), 0644, allTools)
build.Render("build/nsis.envvarupdate.nsh", filepath.Join(*workdir, "EnvVarUpdate.nsh"), 0644, nil) build.Render("build/nsis.envvarupdate.nsh", filepath.Join(*workdir, "EnvVarUpdate.nsh"), 0644, nil)
build.CopyFile(filepath.Join(*workdir, "SimpleFC.dll"), "build/nsis.simplefc.dll", 0755) build.CopyFile(filepath.Join(*workdir, "SimpleFC.dll"), "build/nsis.simplefc.dll", 0755)
build.CopyFile(filepath.Join(*workdir, "COPYING"), "COPYING", 0755) build.CopyFile(filepath.Join(*workdir, "COPYING"), "COPYING", 0755)
makensis := exec.Command("makensis.exe", installFilename, majorVersion, minorVersion, buildId, buildArch, filepath.Join(*workdir, "geth.nsi")) // Build the installer. This assumes that all the needed files have been previously
build.MustRun(makensis) // built (don't mix building and packaging to keep cross compilation complexity to a
// minimum).
version := strings.Split(build.VERSION(), ".")
if env.Commit != "" {
version[2] += "-" + env.Commit[:8]
}
installer, _ := filepath.Abs("geth-" + archiveBasename(*arch, env) + ".exe")
build.MustRunCommand("makensis.exe",
"/DOUTPUTFILE="+installer,
"/DMAJORVERSION="+version[0],
"/DMINORVERSION="+version[1],
"/DBUILDVERSION="+version[2],
"/DARCH="+*arch,
filepath.Join(*workdir, "geth.nsi"),
)
// Sign and publish installer. // Sign and publish installer.
if err := archiveUpload(filepath.Join(*workdir, installerName+".exe"), *upload, *signer); err != nil { if err := archiveUpload(installer, *upload, *signer); err != nil {
log.Fatal(err) log.Fatal(err)
} }
} }

View file

@ -33,6 +33,9 @@ CRCCheck on
# Require admin rights on NT6+ (When UAC is turned on) # Require admin rights on NT6+ (When UAC is turned on)
RequestExecutionLevel admin RequestExecutionLevel admin
# Use LZMA compression
SetCompressor /SOLID lzma
!include LogicLib.nsh !include LogicLib.nsh
!include EnvVarUpdate.nsh !include EnvVarUpdate.nsh

View file

@ -1,6 +1,6 @@
Name "geth ${MAJORVERSION}.${MINORVERSION}.${BUILDVERSION}" # VERSION variables set through command line arguments Name "geth ${MAJORVERSION}.${MINORVERSION}.${BUILDVERSION}" # VERSION variables set through command line arguments
InstallDir "$InstDir" InstallDir "$InstDir"
OutFile "${OUTPUTFILE}.exe" # OUTPUTFILE set through command line arguments OutFile "${OUTPUTFILE}" # set through command line arguments
# Links for "Add/Remove Programs" # Links for "Add/Remove Programs"
!define HELPURL "https://github.com/ethereum/go-ethereum/issues" !define HELPURL "https://github.com/ethereum/go-ethereum/issues"