mirror of
				https://github.com/minio/minio.git
				synced 2025-10-29 15:55:00 -04:00 
			
		
		
		
	feat: detect starting from windows explorer (#13570)
Windows users often click on the binary without knowing MinIO is a command-line tool and should be run from a terminal. Throw a message to guide them on what to do. Co-authored-by: Klaus Post <klauspost@gmail.com>
This commit is contained in:
		
							parent
							
								
									be3f81c7ec
								
							
						
					
					
						commit
						1016fbb8f9
					
				| @ -38,6 +38,7 @@ import ( | ||||
| 
 | ||||
| 	fcolor "github.com/fatih/color" | ||||
| 	"github.com/go-openapi/loads" | ||||
| 	"github.com/inconshreveable/mousetrap" | ||||
| 	dns2 "github.com/miekg/dns" | ||||
| 	"github.com/minio/cli" | ||||
| 	consoleCerts "github.com/minio/console/pkg/certs" | ||||
| @ -66,6 +67,17 @@ var serverDebugLog = env.Get("_MINIO_SERVER_DEBUG", config.EnableOff) == config. | ||||
| var defaultAWSCredProvider []credentials.Provider | ||||
| 
 | ||||
| func init() { | ||||
| 	if runtime.GOOS == "windows" { | ||||
| 		if mousetrap.StartedByExplorer() { | ||||
| 			fmt.Printf("Don't double-click %s\n", os.Args[0]) | ||||
| 			fmt.Println("You need to open cmd.exe/PowerShell and run it from the command line") | ||||
| 			fmt.Println("Refer to the docs here on how to run it as a Windows Service https://github.com/minio/minio-service/tree/master/windows") | ||||
| 			fmt.Println("Press the Enter Key to Exit") | ||||
| 			fmt.Scanln() | ||||
| 			os.Exit(1) | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	rand.Seed(time.Now().UTC().UnixNano()) | ||||
| 
 | ||||
| 	logger.Init(GOPATH, GOROOT) | ||||
|  | ||||
							
								
								
									
										1
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								go.mod
									
									
									
									
									
								
							| @ -32,6 +32,7 @@ require ( | ||||
| 	github.com/gomodule/redigo v2.0.0+incompatible | ||||
| 	github.com/google/uuid v1.3.0 | ||||
| 	github.com/gorilla/mux v1.8.0 | ||||
| 	github.com/inconshreveable/mousetrap v1.0.0 | ||||
| 	github.com/jcmturner/gokrb5/v8 v8.4.2 | ||||
| 	github.com/json-iterator/go v1.1.12 | ||||
| 	github.com/klauspost/compress v1.13.6 | ||||
|  | ||||
							
								
								
									
										1
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								go.sum
									
									
									
									
									
								
							| @ -776,6 +776,7 @@ github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ | ||||
| github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= | ||||
| github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= | ||||
| github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= | ||||
| github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= | ||||
| github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= | ||||
| github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= | ||||
| github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user