; Action list for USB3

[Variables]
product=Intel(R) USB 3.0 eXtensible Host Controller Driver
installDir=%ProgFilesDir%\Intel\%product%
USB3Ver=%getdriverversion(iusb3xhc)%

[Groups]
DRIVER=NOT IsCmd(nodrv)
HCSDRIVER=IsGroupSel(DRIVER) AND IsOS(WIN7,WIN2008_R2_MAXSP)
TOOLS=NOT IsCmd(notray)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;        Version Info Files      ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[File]
operation=copy
mode=overwrite
source=%source%\USB3Ver.dll
destination=%system64%\drivers\USB3Ver.dll
error=ignore
sequence=100

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Setup files             ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[File]
operation=copyonly
mode=overwrite
source=%setup%
destination=%installDir%\uninstall\Setup.exe
sequence=100
usequence=10000

[Folder]
operation=copy
mode=overwrite
source=%source%\lang
destination=%installDir%\uninstall
sequence=150
usequence=1100

[File]
operation=copy
mode=overwrite
source=%source%\x64\Drv64.exe
destination=%installDir%\uninstall\x64\Drv64.exe
condition=Is64
sequence=200
usequence=1200

[File]
operation=copyonly
mode=ifnewer
source=%source%\difxapi.dll
destination=%system%\difxapi.dll
;condition=NOT Is64
error=ignore
sequence=250
usequence=9001

[File]
operation=copyonly
mode=ifnewer
source=%source%\x64\difxapi.dll
destination=%system64%\difxapi.dll
condition=Is64
error=ignore
sequence=300
usequence=9002

[Uninstall]
name={240C3DDD-C5E9-4029-9DF7-95650D040CF2}
display=%product%
display_mui=@%installDir%\Uninstall\Setup.exe,-2018
command=%installDir%\Uninstall\setup.exe -uninstall_arp
location=%installDir%
estimatedsize=18942
publisher=Intel Corporation
icon=%installDir%\uninstall\setup.exe,0
modify=no
repair=no
version=%USB3Ver%
sequence=350


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Driver                  ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[Process]
operation=runonly
bin=%windir%\system32\wevtutil.exe
commandline=um "%installDir%\Drivers\iusb3xhc.man"
wait=yes
hide=yes
sequence=390
error=ignore
group=DRIVER

[Process]
operation=runonly
bin=%windir%\system32\wevtutil.exe
commandline=um "%installDir%\Drivers\iusb3hub.man"
wait=yes
hide=yes
sequence=395
error=ignore
group=DRIVER

;; cannot use %_os% since 2k8r2 is also required to install as a flavor of Win7
[File]
operation=copy
mode=overwrite
source=%source%\drivers\Win7\%_ia%\iusb3xhc.man
destination=%installDir%\Drivers\iusb3xhc.man
condition=IsOS(WIN7,WIN2008_R2_MAXSP)
sequence=400
usequence=2000
group=DRIVER

;; cannot use %_os% since 2k8r2 is also required to install as a flavor of Win7
[File]
operation=copy
mode=overwrite
source=%source%\drivers\Win7\%_ia%\IUsb3Hub.man
destination=%installDir%\Drivers\IUsb3Hub.man
condition=IsOS(WIN7,WIN2008_R2_MAXSP)
sequence=400
usequence=2000
group=DRIVER

;; cannot use %_os% since 2k8r2 is also required to install as a flavor of Win7
[File]
operation=copy
mode=overwrite
source=%source%\drivers\Win8\%_ia%\iusb3xhc.man
destination=%installDir%\Drivers\iusb3xhc.man
condition=IsOS(WIN8,WIN8_MAXSP)
sequence=400
usequence=2000
group=DRIVER

;; cannot use %_os% since 2k8r2 is also required to install as a flavor of Win7
[File]
operation=copy
mode=overwrite
source=%source%\drivers\Win8\%_ia%\IUsb3Hub.man
destination=%installDir%\Drivers\IUsb3Hub.man
condition=IsOS(WIN8,WIN8_MAXSP)
sequence=400
usequence=2000
group=DRIVER

[INF]
name=iusb3hub
sequence=500
usequence=-5000
uninstall=yes
forcebinarydeletion=%systemcuros%\drivers\iusb3hub.sys
group=DRIVER

[INF]
name=iusb3xhc
sequence=550
usequence=-4999
uninstall=yes
removedevice=yes
forcebinarydeletion=%systemcuros%\drivers\iusb3xhc.sys
group=DRIVER

[INF]
name=iusb3hcs
sequence=600
usequence=-4998
condition=NOT IsVar(SKL,1)
uninstall=yes
forcebinarydeletion=%systemcuros%\drivers\iusb3hcs.sys
group=HCSDRIVER

[Process]
operation=runonly
bin=%windir%\system32\wevtutil.exe
commandline=im "%installDir%\Drivers\iusb3xhc.man"
wait=yes
hide=yes
sequence=710
group=DRIVER

[Process]
operation=runonly
bin=%windir%\system32\wevtutil.exe
commandline=im "%installDir%\Drivers\iusb3hub.man"
wait=yes
hide=yes
sequence=720
group=DRIVER

[Process]
operation=runonly
bin=%installDir%\Application\iusb3mon.exe
wait=no
hide=no
condition=IsVar(SKL,1)
sequence=1015
error=ignore
group=TOOLS


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Tools                   ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[Process]
operation=stoponinstall
bin=iusb3mon.exe
sequence=840
group=TOOLS

[Folder]
operation=copy
mode=overwrite
source=%source%\apps
destination=%installDir%\Application
sequence=850
usequence=1000
error=ignore
group=TOOLS

[Registry]
operation=create
root=HKLM
path=SOFTWARE\Microsoft\Windows\CurrentVersion\Run
value=USB3MON
data="%installDir%\Application\iusb3mon.exe"
type=sz
sequence=900
group=TOOLS


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; These actions run on uninstall ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[Service]
operation=removeonuninstall
name=iusb3hcs
usequence=-6100
group=HCSDRIVER

[Process]
operation=runonuninstall
bin=%windir%\system32\wevtutil.exe
commandline=um "%installDir%\Drivers\iusb3hub.man"
wait=yes
hide=yes
error=ignore
usequence=-30

[Process]
operation=runonuninstall
bin=%windir%\system32\wevtutil.exe
commandline=um "%installDir%\Drivers\iusb3xhc.man"
wait=yes
hide=yes
error=ignore
usequence=-20

[Registry]
operation=deleteonuninstall
root=HKLM
path=SOFTWARE\Microsoft\Windows\CurrentVersion\Run
value=USB3MON
delete_if_not_empty=YES
usequence=100

[Folder]
operation=deleteonuninstall
destination=%installDir%\uninstall\x64
delete_if_not_empty=yes
condition=Is64
usequence=200

[Folder]
operation=deleteonuninstall
destination=%installDir%\Drivers
delete_if_not_empty=yes
usequence=2010

[Folder]
operation=deleteonuninstall
mode=prune
destination=%installDir%
usequence=6001
