Added automatic installation of USB driver on windows.

This commit is contained in:
Kovid Goyal 2007-05-28 21:10:42 +00:00
parent 8a9110740d
commit f01341f750
2 changed files with 7 additions and 5 deletions

View File

@ -83,6 +83,7 @@ Var MUI_TEMP
!define XPUI_BRANDINGTEXT "${PRODUCT_NAME} created by Kovid Goyal" !define XPUI_BRANDINGTEXT "${PRODUCT_NAME} created by Kovid Goyal"
!define PRODUCT_VERSION "'''+VERSION+r'''" !define PRODUCT_VERSION "'''+VERSION+r'''"
!define WEBSITE "https://libprs500.kovidgoyal.net" !define WEBSITE "https://libprs500.kovidgoyal.net"
!define DEVCON "C:\devcon\i386\devcon.exe"
!define PY2EXE_DIR "C:\libprs500" !define PY2EXE_DIR "C:\libprs500"
!define LIBUSB_DIR "C:\libusb-prs500" !define LIBUSB_DIR "C:\libusb-prs500"
!define LIBUNRAR_DIR "C:\Program Files\UnrarDLL" !define LIBUNRAR_DIR "C:\Program Files\UnrarDLL"
@ -162,17 +163,18 @@ Section "libprs500" Seclibprs500
File "${LIBUSB_DIR}\*.sys" File "${LIBUSB_DIR}\*.sys"
File "${LIBUSB_DIR}\*.cat" File "${LIBUSB_DIR}\*.cat"
File "${LIBUSB_DIR}\*.inf" File "${LIBUSB_DIR}\*.inf"
File "${DEVCON}"
SetOutPath "$SYSDIR" SetOutPath "$SYSDIR"
File "${LIBUSB_DIR}\libusb0.dll" File "${LIBUSB_DIR}\libusb0.dll"
File "${LIBUNRAR_DIR}\unrar.dll" File "${LIBUNRAR_DIR}\unrar.dll"
DetailPrint " " DetailPrint " "
DetailPrint "Installing USB driver (this may take a few seconds) ..." DetailPrint "Installing USB driver for prs500..."
ExecWait '"rundll32" libusb0.dll,usb_install_driver_np_rundll "$INSTDIR\driver\prs500.inf"' $0 ExecWait '"$INSTDIR\driver\devcon.exe" install "$INSTDIR\driver\prs500.inf" "USB\VID_054C&PID_029B"' $0
DetailPrint "rundll32 returned exit code $0" DetailPrint "devcon returned exit code $0"
IfErrors 0 +2 IfErrors 0 +2
MessageBox MB_OK 'You may need to run the following at the console in order for the SONY Reader to be detected:\r\n"rundll32" libusb0.dll,usb_install_driver_np_rundll "$INSTDIR\driver\prs500.inf"' MessageBox MB_OK "Failed to install USB driver. devcon exit code: $0"
DetailPrint " " DetailPrint " "

View File

@ -33,7 +33,7 @@ You may have to adjust the GROUP and the location of the rules file to
suit your distribution. suit your distribution.
""" """
__version__ = "0.3.42" __version__ = "0.3.43"
__docformat__ = "epytext" __docformat__ = "epytext"
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>" __author__ = "Kovid Goyal <kovid@kovidgoyal.net>"