Java Is Windows isWindowsInstall()

Here you can find the source of isWindowsInstall()

Description

is Windows Install

License

Open Source License

Return

true if the software is a windows installation (ie: the plateform is windows and there is an exe file).

Declaration

public static boolean isWindowsInstall() 

Method Source Code

//package com.java2s;
/*******************************************************************************
  * GenPlay, Einstein Genome Analyzer/*ww w  .j  a v  a 2  s  . c om*/
  * Copyright (C) 2009, 2014 Albert Einstein College of Medicine
  * 
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  * 
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  * 
  * You should have received a copy of the GNU General Public License
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  * Authors: Julien Lajugie <julien.lajugie@einstein.yu.edu>
  *          Nicolas Fourel <nicolas.fourel@einstein.yu.edu>
  *          Eric Bouhassira <eric.bouhassira@einstein.yu.edu>
  * 
  * Website: <http://genplay.einstein.yu.edu>
  ******************************************************************************/

import java.io.File;

public class Main {
    /**
      * @return true if the software is a windows installation (ie: the plateform is windows and there is an exe file).
      */
    public static boolean isWindowsInstall() {
        File genPlayExe = new File("GenPlay.exe");
        return isWindowsOS() && genPlayExe.exists();
    }

    /**
      * @return true if the OS running the program is Windows, false otherwise
      */
    public static boolean isWindowsOS() {
        return System.getProperty("os.name").toLowerCase().indexOf("windows") != -1;
    }
}

Related

  1. isWindows64JREAvailable()
  2. isWindowsAdministrator()
  3. isWindowsCygwin()
  4. isWindowsFileSep()
  5. isWindowsFileSystem()
  6. isWinFileSystem()