// Build package.
_, err = b.run(work, "candle",
"-nologo",
- "-dVersion="+version,
+ "-dGoVersion="+version,
+ "-dWixGoVersion="+wixVersion(version),
"-dArch="+b.Arch,
"-dSourceDir=go",
installer, appfiles)
return err
}
+var versionRe = regexp.MustCompile(`^go([0-9]+(\.[0-9]+)*)`)
+
+// The Microsoft installer requires version format major.minor.build
+// (http://msdn.microsoft.com/en-us/library/aa370859%28v=vs.85%29.aspx).
+// Where the major and minor field has a maximum value of 255 and build 65535.
+// The offical Go version format is goMAJOR.MINOR.PATCH at $GOROOT/VERSION.
+// It's based on the Mercurial tag. Remove prefix and suffix to make the
+// installer happy.
+func wixVersion(v string) string {
+ m := versionRe.FindStringSubmatch(v)
+ if m == nil {
+ return "0.0.0"
+ }
+ return m[1]
+}
+
// extras fetches the go.tools, go.blog, and go-tour repositories,
// builds them and copies the resulting binaries and static assets
// to the new GOROOT.
\r
<Product\r
Id="FF5B30B2-08C2-11E1-85A2-6ACA4824019B"\r
- Name="Go Programming Language $(var.Arch) $(var.Version)"\r
+ Name="Go Programming Language $(var.Arch) $(var.GoVersion)"\r
Language="1033"\r
Codepage="1252"\r
- Version="0.0.0.0"\r
+ Version="$(var.WixGoVersion)"\r
Manufacturer="http://golang.org"\r
UpgradeCode="$(var.UpgradeCode)" >\r
- <!-- Version="$(var.Version)" TODO: Version requires X.X.X.X format -->\r
\r
<Package\r
Id='*' \r