<commit_before>#!/usr/bin/env bash
# Copyright 2011 The Go Authors.  All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
set -e

PROGS="
	candle
	light
	heat
"

echo "%%%%% Checking for WiX executables %%%%%" 1>&2
for i in $PROGS; do
	if ! which -a $1 >/dev/null; then
		echo "Cannot find '$i' on search path." 1>$2
		exit 1
	fi
done

echo "%%%%% Checking the packager's path %%%%%" 1>&2
if ! test -f ../../src/env.bash; then
	echo "package.bash must be run from $GOROOT/misc/windows" 1>&2
fi

echo "%%%%% Setting the go package version info %%%%%" 1>&2
ver="$(bash ../../src/version.bash | sed 's/ .*//')"

rm -rf go
mkdir go

echo "%%%%% Cloning the go tree %%%%%" 1>&2
hg clone -r $(hg id -n | sed 's/+//') $(hg root) go

rm -rf ./go/.hg ./go/.hgignore ./go/.hgtags

echo "%%%%% Copying pkg and bin %%%%%" 1>&2
cp -a ../../pkg go/pkg
cp -a ../../bin go/bin

echo "%%%%% Starting zip packaging %%%%%" 1>&2
7za a -tzip -mx=9 gowin$GOARCH"_"$ver.zip "go/" >/dev/null

echo "%%%%% Starting Go directory file harvesting %%%%%" 1>&2
heat dir go -nologo -cg AppFiles -gg -g1 -srd -sfrag -template fragment -dr INSTALLDIR -var var.SourceDir -out AppFiles.wxs

echo "%%%%% Starting installer packaging %%%%%" 1>&2
candle -nologo -dVersion=$ver -dArch=$GOARCH -dSourceDir=go installer.wxs AppFiles.wxs
light -nologo -ext WixUIExtension -ext WixUtilExtension installer.wixobj AppFiles.wixobj -o gowin$GOARCH"_"$ver.msi

rm -f *.wixobj AppFiles.wxs *.wixpdb
<commit_msg>misc/windows: add src/pkg/runtime/z* files to installation script<commit_after>#!/usr/bin/env bash
# Copyright 2011 The Go Authors.  All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
set -e

PROGS="
	candle
	light
	heat
"

echo "%%%%% Checking for WiX executables %%%%%" 1>&2
for i in $PROGS; do
	if ! which -a $1 >/dev/null; then
		echo "Cannot find '$i' on search path." 1>$2
		exit 1
	fi
done

echo "%%%%% Checking the packager's path %%%%%" 1>&2
if ! test -f ../../src/env.bash; then
	echo "package.bash must be run from $GOROOT/misc/windows" 1>&2
fi

echo "%%%%% Setting the go package version info %%%%%" 1>&2
ver="$(bash ../../src/version.bash | sed 's/ .*//')"

rm -rf go
mkdir go

echo "%%%%% Cloning the go tree %%%%%" 1>&2
hg clone -r $(hg id -n | sed 's/+//') $(hg root) go

rm -rf ./go/.hg ./go/.hgignore ./go/.hgtags

echo "%%%%% Copying pkg, bin and src/pkg/runtime/z* %%%%%" 1>&2
cp -a ../../pkg go/pkg
cp -a ../../bin go/bin
cp ../../src/pkg/runtime/z*.c go/src/pkg/runtime/
cp ../../src/pkg/runtime/z*.go go/src/pkg/runtime/
cp ../../src/pkg/runtime/z*.h go/src/pkg/runtime/

echo "%%%%% Starting zip packaging %%%%%" 1>&2
7za a -tzip -mx=9 gowin$GOARCH"_"$ver.zip "go/" >/dev/null

echo "%%%%% Starting Go directory file harvesting %%%%%" 1>&2
heat dir go -nologo -cg AppFiles -gg -g1 -srd -sfrag -template fragment -dr INSTALLDIR -var var.SourceDir -out AppFiles.wxs

echo "%%%%% Starting installer packaging %%%%%" 1>&2
candle -nologo -dVersion=$ver -dArch=$GOARCH -dSourceDir=go installer.wxs AppFiles.wxs
light -nologo -ext WixUIExtension -ext WixUtilExtension installer.wixobj AppFiles.wixobj -o gowin$GOARCH"_"$ver.msi

rm -f *.wixobj AppFiles.wxs *.wixpdb

{'fraction_non_alphanumeric': 0.19288104654700336, 'fraction_numerical': 0.017645269242470337, 'mean_word_length': 3.2371134020618557, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '325718', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1219, 'n_words': 420}