Esempio n. 1
0
func (d *Docs_NDA) Install(args ...string) {
	//fmt.Println(args[0], args[1], args[2], args[3])
	d.ComponentId = args[0]
	d.ExecFile = "docs.zip"
	d.InstallLocation = args[3]

	if _, e := os.Open(d.InstallLocation); e == nil {
		myutils.Rmdir(d.InstallLocation)
	}
	myutils.Decompress(d.ExecFile, d.InstallLocation)
	fmt.Println(filepath.Join(d.InstallLocation, "docs"))

}
func (g *GameWorks) Install(args ...string) {
	g.ComponentId = args[0]
	g.Version = args[1]
	g.ExecFile = args[2]
	g.InstallLocation = args[3]

	if _, e1 := os.Open(g.InstallLocation); e1 == nil {
		//destination directory exist
		myutils.Rmdir(g.InstallLocation)
	}

	//fmt.Println(c.ComponentId, "installing ", c.Version, "using execute file : ", c.ExecFile)
	myutils.Decompress(args[2], args[3])
	fmt.Println(filepath.Join(g.InstallLocation, ""))
}
Esempio n. 3
0
func (cs *CUDASamples) Install(args ...string) {
	if len(args) < 4 {
		fmt.Println("wrong args input")
		return
	}

	cs.Version = args[1]
	cs.ExecFile = args[2]
	cs.InstallLocation = args[3]

	if _, e := os.Open(cs.InstallLocation); e == nil {
		myutils.Rmdir(cs.InstallLocation)
	}

	myutils.Decompress(args[2], args[3])
	fmt.Println(filepath.Join(cs.InstallLocation, "CUDA_Samples"))
}
Esempio n. 4
0
func (ocv *OpenCV) Install(args ...string) {
	if len(args) < 4 {
		fmt.Println("wrong args input")
		return
	}

	ocv.Version = args[1]
	ocv.ExecFile = args[2]
	ocv.InstallLocation = args[3]

	if _, e := os.Open(filepath.Join(ocv.InstallLocation, "OpenCV-"+ocv.Version+"-Tegra-sdk")); e == nil {
		myutils.Rmdir(filepath.Join(ocv.InstallLocation, "OpenCV-"+ocv.Version+"-Tegra-sdk"))
	}

	myutils.Decompress(args[2], args[3])
	fmt.Println(filepath.Join(ocv.InstallLocation, "OpenCV-"+ocv.Version+"-Tegra-sdk"))
}
Esempio n. 5
0
func (c *Component) Uninstall(args ...string) {
	if len(args) < 3 {
		fmt.Println("wrong args input")
		return
	}
	c.ComponentId = args[0]
	c.Version = args[1]
	c.InstallLocation = filepath.Join(args[2], "")
	//fmt.Println(c.ComponentId, "uninstalling from : ", c.InstallLocation)
	//if myutils.Global_OS == "windows" {
	//	exec.Command("cmd", "/c", "del", "/s", "/f", "/q", c.InstallLocation).Output()
	//}

	myutils.Rmdir(c.InstallLocation)
	fmt.Println(c.InstallLocation)

}
Esempio n. 6
0
func (d *Docs) Install(args ...string) {
	if len(args) < 4 {
		fmt.Println("wrong args input")
		return
	}

	d.Version = args[1]
	d.ExecFile = args[2]
	d.InstallLocation = args[3]

	if _, e := os.Open(d.InstallLocation); e == nil {
		myutils.Rmdir(d.InstallLocation)
	}

	myutils.Decompress(args[2], args[3])
	fmt.Println(filepath.Join(d.InstallLocation, "docs"))
}
Esempio n. 7
0
func (j *JavaSDK) Install(args ...string) {
	j.ComponentId = args[0]
	j.Version = args[1]
	j.InstallLocation = args[3]

	if _, e1 := os.Open(filepath.Join(j.InstallLocation, "jdk"+j.Version)); e1 == nil {
		//destination directory exist
		myutils.Rmdir(filepath.Join(j.InstallLocation, "jdk"+j.Version))
	}
	myutils.Decompress(args[2], args[3])

	//Add enviroment variables
	//1. add java/bin to PATH
	j.Version = args[1]
	java_path := filepath.Join(args[3], "jdk"+args[1])
	bin_path := filepath.Join(java_path, "bin")
	myutils.Set_Environment("PATH", bin_path)

	//2. add ANT_HOME
	myutils.Set_Environment("JAVA_HOME", java_path)
	fmt.Println(java_path)
}
Esempio n. 8
0
func (ca *CUDAAndroid) Install(args ...string) {
	if len(args) < 4 {
		fmt.Println("wrong args input")
		return
	}

	ca.Version = args[1]
	ca.ExecFile = args[2]
	ca.InstallLocation = args[3]

	if _, e := os.Open(ca.InstallLocation); e == nil {
		myutils.Rmdir(ca.InstallLocation)
	}

	//fmt.Println(c.ComponentId, "installing ", c.Version, "using execute file : ", c.ExecFile)
	myutils.Decompress(args[2], args[3])
	if strings.Contains(ca.Version, "6.5") {
		fmt.Println(filepath.Join(ca.InstallLocation, "cuda-android-6.5"))
	} else if strings.Contains(ca.Version, "7.0") {
		fmt.Println(filepath.Join(ca.InstallLocation, "cuda-android-7.0"))
	}

}