!include "winver.nsh"
;include "ZipDLL.nsh"

outfile "ADRF6620_customer_installer.exe"

;BOOL UpdateDriverForPlugAndPlayDevices(HWND, PSTR, PSTR, DWORD, PBOOL);

!define sysUpdateDriverForPlugAndPlayDevices "newdev::UpdateDriverForPlugAndPlayDevices(i,t,t,i,*i) i"

;the masked value of ERROR_NO_SUCH_DEVINST is 523

!define ERROR_NO_SUCH_DEVINST -536870389

;BOOL SetupCopyOEMInf(PSTR, PSTR, DWORD, DWORD, PSTR, DWORD, PDWORD, PSTR);
!define sysSetupCopyOEMInf "setupapi::sysSetupCopyOEMInf(t,t,i,i,i,i,*i,t) i"
!define SPOST_NONE 0
!define SPOST_PATH 1
!define SPOST_URL 2
!define SP_COPY_DELETESOURCE 0x1
!define SP_COPY_REPLACEONLY 0x2
!define SP_COPY_NOOVERWRITE 0x8
!define SP_COPY_OEMINF_CATALOG_ONLY 0x40000 

section "installer section"

CreateDirectory "c:\program files\ADRF6620_customer_software"

CreateDirectory "c:\program files\ADRF6620_customer_software\device_save_states"

CopyFiles $EXEDIR\ADRF6620.exe "c:\program files\ADRF6620_customer_software"
CopyFiles $EXEDIR\ADRF6612_20.hex "c:\program files\ADRF6620_customer_software"

CopyFiles $EXEDIR\ADI.ico "c:\program files\ADRF6620_customer_software"
CopyFiles $EXEDIR\CyUSB.dll "c:\program files\ADRF6620_customer_software"
CopyFiles $EXEDIR\cyusb.sys "c:\program files\ADRF6620_customer_software"
CopyFiles $EXEDIR\SPI_BlockDiagramDPDMix.jpg "c:\program files\ADRF6620_customer_software"

CopyFiles $EXEDIR\cyusb_RFG_USB_7050.inf "c:\program files\ADRF6620_customer_software"
CopyFiles $EXEDIR\device_save_states\*.* "c:\program files\ADRF6620_customer_software\device_save_states"

SetOutPath "C:\Program Files\ADRF6620_customer_software"
CreateShortcut "C:\Program Files\ADRF6620_customer_software\ADRF6620_customer_software.lnk" "C:\Program Files\ADRF6620_customer_software\ADRF6620.exe" "" "C:\Program Files\ADRF6620_customer_software\ADI.ico" "" SW_SHOWNORMAL ALT|CTRL|SHIFT|F5 "ADRF6620_customer_software"

CopyFiles "C:\Program Files\ADRF6620_customer_software\ADRF6620_customer_software.lnk" "$Desktop"

sectionend