cls
@echo off
CLS
color 0a
Title █████VMware 10.0.1 绿精简中文版█████
set vmbit=
if "%PROCESSOR_ARCHITECTURE%" neq "x86" set vmbit=64
echo.
echo 注意:
echo 运行此批处理文件后,安装过程持续十几秒钟,并将跳出VMware服务安装窗口.
echo 如果窗口一闪而过,说明安装过程中出了错误.
echo 未正确安装VMware将导致虚拟机运行出错.
echo 请先排除故障后再次运行"!)安装d"批处理文件进行安装.
echo.
echo 按任意键继续安装VMware&pause>nul
reg query "HKLM\SOFTWARE\VMware, Inc." >nul 2> install.log || reg query "HKLM\SOFTWARE\Wow6432Node\VMware, Inc." >nul 2>> install.log&&(echo.&echo 系统中已经安装了VMware,请先卸载干净并重启电脑!!!&pause>nul&exit)
cls
net user %USERNAME% | find "Administrators" || call :prompt
echo ................
echo 正在安装VMware 10.0.1 绿精简中文版,请稍后...
echo ................
echo.
echo 删除目录 >> install.log
rd /s /q "%AllUsersProfile%\VMware" >nul 2>> install.log
rd /s /q "%AllUsersProfile%\Application Data\VMware" >nul 2>> install.log
rd /s /q "%AppData%\VMware" >nul 2>> install.log||del /f /s /q "%AppData%\VMware" >nul 2>> install.log
echo. >> install.log
echo 创建目录 >> install.log
ver|find "6.">nul && (set profilepath=%AllUsersProfile%)
ver|find "5.">nul && (set profilepath=%AllUsersProfile%\Application Data)
md "%AppData%\VMware" >nul
if %errorlevel% neq 0 echo 创建目录失败,请关闭杀毒软件或者HIPS后再重新安装VMware&pause>nul&exit
md "%profilepath%\VMware" >nul 2>> install.log
md "%profilepath%\VMware\VMware Workstation" >nul 2>> install.log
md "%profilepath%\VMware\VMware Player" >nul
md "%profilepath%\VMware\VMware USB Arbitration Service" >nul
echo. >> install.log
echo 添加注册表 >> install.log
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App " /ve /d "%cd%\\" /f >nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App " /v Path /t REG_SZ /d "%cd%\\" /f >nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App " /ve /d "%cd%\\" /f >nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App " /v Path /t REG_SZ /d "%cd%\\" /f >nul
if "%PROCESSOR_ARCHITECTURE%" neq "x86" goto _64
goto _86
:_64
set vmbit=64
echo.
echo 64位安装 >> install.log
cd /d "%~dp0"
if not exist "%cd%\64Drv" (echo.&echo 64Drv文件夹不存在或者已被删除,安装文件不全,请下载完
健康饮食整版!!!&pause>nul&exit)
echo 添加注册表项目...
regedit /s "%cd%\"
reg query "HKLM\SOFTWARE\Wow6432Node\VMware, Inc.\Installer" >nul 2>> install.log||(echo.&echo 注册表文件导入失败,请关闭杀毒软件或
者HIPS后再重新安装VMware&rd /s /q "%AppData%\VMware"&rd /s /q "%profilepath%\VMware"&pause>nul&exit)
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VMware, Inc.\Installer\VMware Workstation\Features" /v core /t REG_SZ /d "%cd%" /f >nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VMware, Inc.\VMware Player" /v InstallPath /t REG_SZ /d "%cd%\\" /f >nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VMware, Inc.\VMware Player" /v InstallPath64 /t REG_SZ /d "%cd%\x64\\" /f >nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VMware, Inc.\VMware Workstation" /v InstallPath /t REG_SZ /d "%cd%\\" /f >nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\VMware, Inc.\VMware Workstation" /v InstallPath64 /t REG_SZ /d "%cd%\x64\\" /f >nul
echo 安装VC运行库 >> install.log
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4B6C7001-C7D6-3710-913E-5BC23FCE91E6} >nul 2>nul||reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4} >nul 2>nul||(echo.&echo 正在安装VC++&start / /q&&start / /q)
copy /y 64Drv\*.* >nul
ver|find "5.">nul && (
copy /y 64Drv\bridge\_vmnetbridge.cat_xp_64 .\vmnetBridge.cat >nul 徐子菲
copy /y 64Drv\bridge\_vmnetBridge.dll_xp_64 .\vmnetBridge.dll >nul
copy /y 64Drv\bridge\_vmnetBridge.sys_xp_64 .\vmnetBridge.sys >nul
)
ver|find "6.">nul && (
copy /y 64Drv\bridge\_vmnetbridge.cat_vista_64 .\vmnetBridge.cat >nul
copy /y 64Drv\bridge\_vmnetBridge.dll_vista_64 .\vmnetBridge.dll >nul
copy /y 64Drv\bridge\_vmnetBridge.sys_vista_64 .\vmnetBridge.sys >nul
)
copy /y vmci\x64\* .\ >nul
move /y vsocklib32.dll "%WinDir%\SysWOW64\vsocklib.dll" >nul 2>> install.log
move /y vsocklib64.dll "%WinDir%\System32\vsocklib.dll" >nul
echo.
乘坐飞机须知
goto install
:_86
echo.
echo 32位安装 >> install.log
cd /d "%~dp0"
if not exist "%cd%\86Drv" (echo.&echo 86Drv文件夹不存在或者已被删除,安装文件不全,请下载完整版!!!&pause>nul&exit)
echo 添加注册表项目...
regedit /s "%cd%\"
reg query "HKLM\SOFTWARE\VMware, Inc.\Installer" >nul 2>> install.log||(echo.&echo 注册表文件导入失败,请关闭杀毒软件或者HIPS后再重新安装VMware&rd /s /q "%AppData%\VMware"&rd /s /q "%profilepath%\VMware"&pause>nul&exit)
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\Installer\VMware Workstation\Features" /v core /t REG_SZ /d "%cd%" /f >nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware Player" /v InstallPath /t REG_SZ /d "%cd%\\" /f >nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware Workstation" /v InstallPath /t REG_SZ /d "%cd%\\" /f >nul
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.\VMware Workstation" /v DATASTORE_PATH /t REG_SZ /d "%cd%\VOS" /f >nul
echo 安装VC运行库 >> install.log
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1F1C2DFC-2D24-3E06-BCB8-725134ADF989} >nul 2>nul||reg query HKLM\SOFTWARE\Microso
ft\Windows\CurrentVersion\Uninstall\{86CE1746-9EFF-3C9C-8755-81EA8903AC34} >nul 2>nul||reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9BE518E6-ECC6-35A9-88E4-87755C07200F} >nul 2>nul||(echo.&echo 正在安装VC++& /q)
copy /y 86Drv\*.* >nul
ver|find "5.">nul && (
copy /y 86Drv\bridge\_vmnetbridge.cat_xp .\vmnetBridge.cat >nul
copy /y 86Drv\bridge\_vmnetBridge.dll_xp .\vmnetBridge.dll >nul
copy /y 86Drv\bridge\_vmnetBridge.sys_xp .\vmnetBridge.sys >nul
)
ver|find "6.">nul && (
copy /y 86Drv\bridge\_vmnetbridge.cat_vista32 .\vmnetBridge.cat >nul
copy /y 86Drv\bridge\_vmnetBridge.dll_vista32 .\vmnetBridge.dll >nul 烧饼的做法
copy /y 86Drv\bridge\_vmnetBridge.sys_vista32 .\vmnetBridge.sys >nul
)
copy /y vmci\x86\* .\ >nul
move /y vsocklib32.dll "%WinDir%\System32\vsocklib.dll" >nul
echo.
:install
文章演员< preferences.ini 0 0 /R /asc:"VMwareDir" /asc:"%cd%" /A >nul 2>> install.log
< l 0 0 /R /asc:"VMwareDir" /asc:"%cd%" /A >nul 2>> install.log
echo 复制文件...
echo.
copy /y preferences.ini "%AppData%\VMware\" >nul 2>> install.log
copy /y inventory.vmls "%AppData%\VMware\" >nul
copy /y vmconfig.ini "%profilepath%\VMware\VMware Workstation\config.ini" >nul 2>> install.log
copy /y settings.ini "%profilepath%\VMware\VMware Player\" >nul
copy /y settings.ini "%profilepath%\VMware\VMware Workstation\" >nul
copy /y vpconfig.ini "%profilepath%\VMware\VMware Player\config.ini" >nul
copy /y vnetinst.dll "%WinDir%\System32\" >nul 2>> install.log
copy /y vnetlib%vmbit%.dll "%WinDir%\System32\" >nul 2>> install.log
move /y vsock.sys "%WinDir%\system32\drivers\" >nul 2>> install.log
echo.
echo 注册所需的DLL文件...
regsvr32 /s vmappcfg.dll
regsvr32 /s vmappsdk.dll
regsvr32 /s vmdbCOM.dll
regsvr32 /s vmdkShellExt.dll
regsvr32 /s elevated.dll
echo.
echo 创建 __vmware_user__ 用户组 >> install.log
西方世界的劫难3 答题echo 创建 __vmware_user__ 用户组 ...
net localgroup users __vmware_user__ /del >nul 2>nul
net localgroup __vmware__ /del >nul 2>nul
net user __vmware_user__ /del >nul 2>nul
echo.
net localgroup __vmware__ /add /comment:"VMware User Group" >nul 2>> install.log
if %errorlevel% neq 0 echo 用户组创建失败,请关闭杀毒软件或者HIPS后再重新安装VMware&pause>nul&exit
echo 安装VM基本服务 ...
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VMware\Performance" /v Library /t REG_SZ /d "%cd%\vmPerfmon.dll" /f >nul
sc create vsock type= kernel start= boot binpath= "%WinDir%\system32\drivers\vsock.sys" Group= "System Bus Extender" displayname= "vSockets Driver"
if not exist "%WinDir%\System32\Drivers\vsock.sys" copy /y vsock.sys "%WinDir%\System32\Drivers\"
net stop vmx86 >nul 2>> install.log
sc delete vmx86 >nul 2>> install.log
start /wait vnetlib%vmbit%.exe -- install vmx86
start /wait vnetlib%vmbit%.exe -- start vmx86
net stop vmx86 >nul 2>> install.log
net start vmx86 >nul 2>> install.log
if %errorlevel%
neq 0 echo 服务启动失败,请关闭杀毒软件或者HIPS后,再运行"卸载d"清理安装记录,然后重新安装VMware&pause>nul&exit
net stop vmci >nul 2>> install.log
sc delete vmci >nul 2>> install.log
if "%PROCESSOR_ARCHITECTURE%" equ "x86" ( -install "ROOT\VMWVMCIHOSTDEV" .\vmci.inf >nul)
if "%PROCESSOR_ARCHITECTURE%" neq "x86" ( installRootDriver HWND "ROOT\VMWVMCIHOSTDEV" .\vmci.inf "" >nul)
vnetlib%vmbit%.exe -- install vmci
net start vsock >nul 2>> install.log
echo.
echo 创建快捷方式
mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""AllUsersDesktop"") & ""\VMware.lnk""):b.TargetPath=""%~"":b.WorkingDirectory=""%~dp0\"":b.Save:close") >nul
echo.
echo.
echo.
echo 请注意上面错误提示,若安装后无法正常运行VMware,
echo 请把上面的错误提示复制下来反馈到我的帖子里,谢谢.
echo 按任意键继续安装VMware服务.
pause >nul
:ST
CALL "安装服务.cmd"
:EX
exit
:prompt
echo ..................
echo 提示:
echo 登录系统的并非是Administrators管理员组的用户,
echo 安装VMware精简版请切换到管理员用户进行安装!
echo 在管理员用户下使用右键--以管理员身份运行
echo 此批处理文件进行安装.
echo ..................
pause
goto :EX
发布评论