我有一個批處理文件,它將檢測用戶是否通過轉到目錄安裝.Net框架並檢查CONFIG目錄是否存在。批處理文件在移動到下一行之前等待安裝完成
如果該目錄不存在,那麼用戶沒有安裝.Net框架。該批處理文件將繼續安裝.Net框架。但是,在運行安裝程序安裝我的撥號程序之前需要安裝.Net框架時出現問題。所以我已經放了一個PAUSE語句,這樣用戶就可以在安裝框架後按任意按鈕繼續。
但是,我們的客戶不喜歡這個,因爲他們的一些客戶不理解,他們在框架完成安裝之前按下了一個鍵。這會導致安裝失敗,因爲框架尚未先安裝。
我正在使用等待用戶輸入的PAUSE。然而,有沒有辦法讓批處理等待框架自動完成,而不是使用PAUSE命令?
非常感謝您的任何建議,
@ECHO OFF
REM Copy the configuration file
copy config.xml "%AppData%\DataLinks.xml"
REM Search for the CONFIG file, if this doesn't exit then the user doesn't have the .Net framework 2.0
SET FileName=%windir%\Microsoft.NET\Framework\v2.0.50727\CONFIG
IF EXIST %FileName% GOTO INSTALL_DIALER
ECHO.You currently do not have the Microsoft(c) .NET Framework 2.0 installed.
ECHO.This is required by the setup program for MyApplication.
ECHO.
ECHO.The Microsoft(c) .NET Framework 2.0 will now be installed on you system.
ECHO.After completion setup will continue to install MyApplication on your system.
ECHO.
REM Install the .Net framework and wait for the user to input before install the dialer
PAUSE
ECHO Installing... Please wait...
SET FileName =
Start .\NetFx20SP2_x86.exe
ECHO Once the .Net Framework has completed. Press any key to continue to install the dialer.
PAUSE
Start .\setup.exe
ECHO ON
EXIT
REM .Net framework has been skipped contine to install the dialer.
:INSTALL_DIALER
ECHO *** Skiped Dotnet Framework 2.0.50727 ***
ECHO Installing... Please wait...
SET FileName=
Start .\setup.exe
ECHO ON
EXIT
你好,這裏的所有解決方案都有效。但是,我想知道在WAIT命令前面的反斜槓是什麼意思,即/ WAIT – ant2009 2009-06-25 04:26:13