The installer package will now detect a previous installation and warn the user
that the previous installation will be deleted. If the user continues, the
installer will delete the previous installation and install the package as
usual.
Fixes #4293.
R=adg
CC=golang-dev
https://golang.org/cl/
7427044
my.result.type = 'Fatal';
return false;
}
- return true;
+ if(system.files.fileExistsAtPath('/usr/local/go/bin/go')) {
+ my.result.title = 'Previous Installation Detected';
+ my.result.message = 'A previous installation of Go exists at /usr/local/go. This installer will remove the previous installation prior to installing. Please back up any data before proceeding.';
+ my.result.type = 'Warning';
+ return false;
+ }
+ return true;
}
</script>
<choices-outline>
--- /dev/null
+#!/bin/bash
+
+GOROOT=/usr/local/go
+
+echo "Removing previous installation"
+if [ -d $GOROOT ]; then
+ rm -r $GOROOT
+fi