コード例 #1
0
ファイル: VMware.cs プロジェクト: elkaamee326/Cosmos
        public VMware(Dictionary <string, string> aParams, bool aUseGDB, string harddisk = "Filesystem.vmdk") : base(aParams, aUseGDB)
        {
            mHarddisk = harddisk;
            mDir      = Path.Combine(CosmosPaths.Build, @"VMWare\Workstation\");
            mVmxPath  = Path.Combine(mDir, @"Debug.vmx");

            mWorkstationPath = GetPathname("VMware Workstation", "vmware.exe");
            mPlayerPath      = GetPathname("VMware Player", "vmplayer.exe");
            if (mWorkstationPath == null && mPlayerPath == null)
            {
                throw new Exception("VMware not found.");
            }

            string xFlavor = aParams[BuildPropertyNames.VMwareEditionString].ToUpper();

            mEdition = VMwareEdition.Player;
            if (xFlavor == "WORKSTATION")
            {
                mEdition = VMwareEdition.Workstation;
            }

            // Try alternate if selected one is not installed
            if (mEdition == VMwareEdition.Player && mPlayerPath == null && mWorkstationPath != null)
            {
                mEdition = VMwareEdition.Workstation;
            }
            else if (mEdition == VMwareEdition.Workstation && mWorkstationPath == null)
            {
                mEdition = VMwareEdition.Player;
            }
        }
コード例 #2
0
        public VMware(NameValueCollection aParams, bool aUseGDB) : base(aParams, aUseGDB)
        {
            mDir     = Path.Combine(CosmosPaths.Build, @"VMWare\Workstation\");
            mVmxPath = Path.Combine(mDir, @"Debug.vmx");

            mWorkstationPath = GetPathname("VMware Workstation", "vmware.exe");
            mPlayerPath      = GetPathname("VMware Player", "vmplayer.exe");
            if (mWorkstationPath == null && mPlayerPath == null)
            {
                throw new Exception("VMware not found.");
            }

            CheckIfHyperVServiceIsRunning();

            string xFlavor = aParams[BuildProperties.VMwareEditionString].ToUpper();

            mEdition = VMwareEdition.Player;
            if (xFlavor == "WORKSTATION")
            {
                mEdition = VMwareEdition.Workstation;
            }

            // Try alternate if selected one is not installed
            if (mEdition == VMwareEdition.Player && mPlayerPath == null && mWorkstationPath != null)
            {
                mEdition = VMwareEdition.Workstation;
            }
            else if (mEdition == VMwareEdition.Workstation && mWorkstationPath == null)
            {
                mEdition = VMwareEdition.Player;
            }
        }
コード例 #3
0
ファイル: VMware.cs プロジェクト: ChrisJamesSadler/Cosmos
    public VMware(NameValueCollection aParams, bool aUseGDB,string harddisk = "Filesystem.vmdk") : base(aParams, aUseGDB) {
      mHarddisk = harddisk;
      mDir = Path.Combine(CosmosPaths.Build, @"VMWare\Workstation\");
      mVmxPath = Path.Combine(mDir, @"Debug.vmx");

      mWorkstationPath = GetPathname("VMware Workstation", "vmware.exe");
      mPlayerPath = GetPathname("VMware Player", "vmplayer.exe");
      if (mWorkstationPath == null && mPlayerPath == null) {
        throw new Exception("VMware not found.");
      }

      CheckIfHyperVServiceIsRunning();

      string xFlavor = aParams[BuildPropertyNames.VMwareEditionString].ToUpper();
      mEdition = VMwareEdition.Player;
      if (xFlavor == "WORKSTATION") {
        mEdition = VMwareEdition.Workstation;
      }

      // Try alternate if selected one is not installed
      if (mEdition == VMwareEdition.Player && mPlayerPath == null && mWorkstationPath != null) {
        mEdition = VMwareEdition.Workstation;
      } else if (mEdition == VMwareEdition.Workstation && mWorkstationPath == null) {
        mEdition = VMwareEdition.Player;
      }
    }
コード例 #4
0
        public VMware(VMwareEdition aVMwareEdition, string aIsoFile, string aHardDisk = null, bool aUseGDB = false)
        {
            if (!RuntimeHelper.IsWindows)
            {
                throw new PlatformNotSupportedException();
            }

            mUseGDB  = aUseGDB;
            mIsoFile = aIsoFile ?? throw new ArgumentNullException(nameof(aIsoFile));

            mHardDiskFile = aHardDisk;
            mVmxFile      = Path.ChangeExtension(aIsoFile, ".vmx");

            mWorkstationPath = GetPathname("VMware Workstation", "vmware.exe");
            mPlayerPath      = GetPathname("VMware Player", "vmplayer.exe");
            if (mWorkstationPath == null && mPlayerPath == null)
            {
                throw new Exception("VMware not found.");
            }

            string xFlavor = aVMwareEdition.ToString().ToUpper();

            mEdition = VMwareEdition.Player;
            if (xFlavor == "WORKSTATION")
            {
                mEdition = VMwareEdition.Workstation;
            }

            // Try alternate if selected one is not installed
            if (mEdition == VMwareEdition.Player && mPlayerPath == null && mWorkstationPath != null)
            {
                mEdition = VMwareEdition.Workstation;
            }
            else if (mEdition == VMwareEdition.Workstation && mWorkstationPath == null)
            {
                mEdition = VMwareEdition.Player;
            }
        }