1
0
mirror of https://github.com/golang/go synced 2024-09-30 12:18:33 -06:00
go/misc/dist/darwin/Distribution
Tyler Bunnell 65983695fb misc/dist: handle previous installation
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
2013-02-28 16:09:48 +11:00

33 lines
1.3 KiB
XML

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-script minSpecVersion="1.000000">
<title>Go</title>
<background mime-type="image/png" file="bg.png"/>
<options customize="never" allow-external-scripts="no"/>
<domains enable_localSystem="true" />
<installation-check script="installCheck();"/>
<script>
function installCheck() {
if(!(system.compareVersions(system.version.ProductVersion, '10.6.0') >= 0)) {
my.result.title = 'Unable to install';
my.result.message = 'Go requires Mac OS X 10.6 or later.';
my.result.type = 'Fatal';
return false;
}
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>
<line choice="com.googlecode.go.choice"/>
</choices-outline>
<choice id="com.googlecode.go.choice" title="Go">
<pkg-ref id="com.googlecode.go.pkg"/>
</choice>
<pkg-ref id="com.googlecode.go.pkg" auth="Root">com.googlecode.go.pkg</pkg-ref>
</installer-script>