DPInst 使用方法
1. Download Site: http://www.microsoft.com/taiwan/whdc/driver/install/DIFxtls.mspx
2. Document Site: http://www.microsoft.com/taiwan/whdc/driver/install/default.mspx
DPInst是包裝在Driver Install Frameworks Tools裡頭的一個安裝工具,這個工具可以直接使用,用來安裝Driver。安裝的Driver必須是要認證過的,如此一來安裝後就可以馬上使用。如果 是沒有認證過的驅動程式,在安裝時會比較麻煩一點,有興趣的人可以參考http://www.programmer-club.com/pc2020v5 /forum/ShowSameTitleN.asp?URL=N&board_pc2020=driver&index=4&id=3078&mode=&type_pc2020=sametitleLevel-2
使用方法相當簡單,只要將DPInst.exe和所要安裝的inf檔放在一起(包括Driver的必要檔案),執行DPInst.exe就會自動幫電腦安 裝,而且在2000及XP上面會自動在”新增移除”裡頭自動加上,方便解除安裝。而Vista上不會在新增移除裡頭加上反安裝資訊,這是因為Vista上 面的裝置管理員,本來就可以直接解除安裝而且刪除檔案。
在Windows 2000及XP上面安裝的過程,只要是管理者權限,安裝過程完全沒有問題,比較麻煩的是在Vista 32/64上面安裝。因為Vista有UAC (User Account Control),以至於會使得DPInst沒辦法在Vista上面順利的安裝,在安裝過程中會出現詢問使用者要不要執行的問題。
網路上對於UAC的討論還不是很多,但有一些方法可以讓使用者只要問一次以何種身分執行,如此就可以解決DPInst不能直接在Vista 64上面安裝的問題。另外DPInst也有Localization版本,因為也不用擔心語系問題,更可以使用XML檔來客制化安裝的過程及畫面。
為了解決Vista 64上的問題,下面這些Code就是會問使用者以什麼身分執行。
SHELLEXECUTEINFOA TempInfo = {0};
TempInfo.cbSize = sizeof(SHELLEXECUTEINFOA);
TempInfo.fMask = 0;
TempInfo.hwnd = NULL;
TempInfo.lpVerb = "runas";
TempInfo.lpFile = "C:TEMPUACTest.exe";
TempInfo.lpParameters = "";
TempInfo.lpDirectory = "C:TEMPUAC";
TempInfo.nShow = SW_NORMAL;
::ShellExecuteExA(&TempInfo);
其中的runas就是這種功能
RUNAS可以參考: http://www.microsoft.com/technet/prodtechnol/windowsserver2003/zh-cht/library/ServerHelp/0a688988-b5d1-494a-be98-61e3434c5715.mspx?mfr=true
DPInst的參數如下:
Usage: DPInst.exe [/U INF-file][/S | /Q][/LM][/P][/F][/SH][/SA][/A][/PATH Path][
/EL][/L LanguageID][/C][/D][/LogTitle Title][/SW][/? | /h | /help]
/U path to INF file
Uninstall a driver package (INF-file).
/S | /Q Silent (Quiet) mode. Suppresses the Device Installation
Wizard and any dialogs popped-up by the operating system.
/LM Legacy mode. Accepts unsigned driver packages and packages with
missing files. These packages won't install on the latest
version of Windows.
/P Prompt if the driver package to be installed is not better
than the current one.
/F Force install inf the driver package is not better than the
current one.
/SH Scans hardware for matching devices and only copies and installs
those drivers for which a device is present. Only valid for
Plug and Play drivers.
/SA Suppress the Add/Remove Programs entry normally created for
each driver package.
/A Install all or none.
/PATH Path
Search for driver packages under the given path.
/EL Enables all languages not explicitly listed in the XML file.
/L LanguageID
Tries to use the given language in all UI.
Useful for localization tests.
/SE Suppress the EULA.
/C Dump logging output to attached Console (Windows XP and above).
/D Delete driver binaries on uninstall.
/SW Suppresses the Device Installation Wizard, the operating system
might still pop-up user dialogs.
/? | /h | /help
Shows this help.
沒有留言:
張貼留言