阅读:1273回复:2
如何制作驱动打包安装程序,知道的进来指点一下。谢谢
如题。
|
|
沙发#
发布于:2004-06-18 11:16
这是一个MP3 Player在win98下的驱动程序安装包的例子,开发工具是InstallShield6.2。
其功能是实现Driver的自动安装,原始文件是StMp3Rec.inf,StUms.inf,StMp3Rec.sys, StUms.sys,StUmsPdr.pdr。供大家参考,以便快速掌握InstallShield开发98驱动安装程序的方法。 创建驱动程序包的步骤 一、用向导生成一个工程。 二、创建Files Groups 1、Inf Files 包含文件:StMp3Rec.inf, StUms.inf, 安装目录:<WINDIR>inf 2、Sys Files 包含文件:StMp3Rec.sys, StUms.sys, 安装目录:<WINDIR>System32Drivers 3、Pdr Files 包含文件:StUms.pdr, 安装目录:<WINSYSDIR>iosubsys 4、App Files 包含文件:无 三、创建Componets 1. Inf Files 2、Sys Files 3、Pdr Files 4、App Files 并指定它们和Files Groups的组件一一对应。 四、创建卸载菜单 新建Uninstall快捷方式,Target: <DISK1TARGET>setup.exe Install Conditions: App Files 五、写InstallScrip代码 //////////////////////////////////////////////////////////////////////////////// // // File Name: Setup.rul // // Description: InstallShield script // // Comments: This script was generated based on the selections you made in // the Project Wizard. Refer to the help topic entitled "Modify // the script that the Project Wizard generates" for information // on possible next steps. // //////////////////////////////////////////////////////////////////////////////// // Include header files #include "ifx.h" ////////////////////// string defines //////////////////////////// //////////////////// installation declarations /////////////////// // ----- DLL function prototypes ----- // your DLL function prototypes // ---- script function prototypes ----- // your script function prototypes // your global variables ////////////////////////////////////////////////////////////////////////////// // // FUNCTION: OnBegin // // EVENT: Begin event is always sent as the first event during installation. // ////////////////////////////////////////////////////////////////////////////// function OnBegin() begin if (!(SYSINFO.WIN9X.bWin98)) then MessageBox("The installation only for Windows 98.",INFORMATION); abort; endif; //delete device infomation RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); RegDBDeleteKey("Enum\USB\VID_066F&PID_8000"); end; ////////////////////////////////////////////////////////////////////////////// // // FUNCTION: OnFirstUIBefore // // EVENT: FirstUIBefore event is sent when installation is run for the first // time on given machine. In the handler installation usually displays // UI allowing end user to specify installation parameters. After this // function returns, ComponentTransferData is called to perform file // transfer. // /////////////////////////////////////////////////////////////////////////////// function OnFirstUIBefore() number nResult,nSetupType; string szTitle, szMsg; LIST listStartCopy; begin // TO DO: if you want to enable background, window title, and caption bar title // SetTitle( @TITLE_MAIN, 24, WHITE ); // SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Enable( FULLWINDOWMODE ); // Enable( BACKGROUND ); // SetColor(BACKGROUND,RGB (0, 128, 128)); TARGETDIR = PROGRAMFILES ^@COMPANY_NAME ^@PRODUCT_NAME; Dlg_Start: // beginning of dialogs label Dlg_SdWelcome: szTitle = ""; szMsg = ""; nResult = SdWelcome( szTitle, szMsg ); if (nResult = BACK) goto Dlg_Start; // setup default status SetStatusWindow(0, ""); Enable(STATUSEX); StatusUpdate(ON, 100); return 0; end; /////////////////////////////////////////////////////////////////////////////// // // FUNCTION: OnFirstUIAfter // // EVENT: FirstUIAfter event is sent after file transfer, when installation // is run for the first time on given machine. In this event handler // installation usually displays UI that will inform end user that // installation has been completed successfully. // /////////////////////////////////////////////////////////////////////////////// function OnFirstUIAfter() STRING szTitle, szMsg1, szMsg2; NUMBER nReserved; begin Disable(STATUSEX); ShowObjWizardPages(NEXT); szMsg1 = SdLoadString(IFX_SDFINISH_MSG1); nReserved = 0; SdFinishReboot(szTitle, szMsg1, SYS_BOOTMACHINE,szMsg2,nReserved); end; /////////////////////////////////////////////////////////////////////////////// // // FUNCTION: OnMoving // // EVENT: Moving event is sent when file transfer is started as a result of // ComponentTransferData call, before any file transfer operations // are performed. // /////////////////////////////////////////////////////////////////////////////// function OnMoving() string szAppPath; begin // Set LOGO Compliance Application Path // TO DO : if your application .exe is in a subfolder of TARGETDIR then add subfolder szAppPath = TARGETDIR; RegDBSetItem(REGDB_APPPATH, szAppPath); RegDBSetItem(REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY); end; /////////////////////////////////////////////////////////////////////////////// // // FUNCTION: OnMaintUIAfter // // EVENT: MaintUIAfter event is sent after file transfer, when end user runs // installation that has already been installed on the machine. Usually // this happens through Add/Remove Programs applet. // In the handler installation usually displays UI that will inform // end user that maintenance/uninstallation has been completed successfully. // /////////////////////////////////////////////////////////////////////////////// function OnMaintUIAfter() STRING szTitle, szMsg1, szMsg2, szOption1, szOption2; NUMBER bOpt1, bOpt2; begin Disable(STATUSEX); ShowObjWizardPages(NEXT); //Delete device information RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); RegDBDeleteKey("Enum\USB\VID_066F&PID_8000"); bOpt1 = FALSE; bOpt2 = FALSE; szMsg1 = SdLoadString(IFX_SDFINISH_MAINT_MSG1); szTitle = SdLoadString(IFX_SDFINISH_MAINT_TITLE); SdFinishEx(szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2); end; // --- include script file section --- |
|
板凳#
发布于:2004-06-18 14:54
和普通的差不多啊~~注意目录就可以了把~
|
|
|