1 ;p8-usbcec-driver installer
2 ;Copyright (C) 2011-2013 Pulse-Eight Ltd.
3 ;http://www.pulse-eight.com/
6 !include "nsDialogs.nsh"
7 !include "LogicLib.nsh"
10 Name "Pulse-Eight USB-CEC Adapter"
11 OutFile "..\build\p8-usbcec-driver-installer.exe"
14 InstallDir "$PROGRAMFILES\Pulse-Eight\USB-CEC Adapter\driver"
15 InstallDirRegKey HKLM "Software\Pulse-Eight\USB-CEC Adapter driver" ""
16 RequestExecutionLevel admin
18 !define MUI_FINISHPAGE_LINK "Visit http://www.pulse-eight.com/ for more information."
19 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.pulse-eight.com/"
20 !define MUI_ABORTWARNING
22 !insertmacro MUI_PAGE_WELCOME
23 !insertmacro MUI_PAGE_LICENSE "..\COPYING"
24 !insertmacro MUI_PAGE_DIRECTORY
26 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
27 !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Pulse-Eight\USB-CEC Adapter driver"
29 !insertmacro MUI_PAGE_INSTFILES
30 !insertmacro MUI_PAGE_FINISH
32 !insertmacro MUI_UNPAGE_WELCOME
33 !insertmacro MUI_UNPAGE_CONFIRM
34 !insertmacro MUI_UNPAGE_INSTFILES
35 !insertmacro MUI_UNPAGE_FINISH
37 !insertmacro MUI_LANGUAGE "English"
39 InstType "USB-CEC driver only"
41 Section "USB-CEC driver" SecDriver
42 SetShellVarContext current
46 ; Copy to the installation directory
51 ; Copy the driver installer and .inf file
52 File "..\build\dpinst-amd64.exe"
53 File "..\build\dpinst-x86.exe"
54 File "..\driver\p8usb-cec.inf"
55 File "..\driver\p8usb-cec.cat"
57 ;Store installation folder
58 WriteRegStr HKLM "Software\Pulse-Eight\USB-CEC Adapter driver" "" $INSTDIR
61 WriteUninstaller "$INSTDIR\Uninstall.exe"
63 ;add entry to add/remove programs
64 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pulse-Eight USB-CEC Adapter driver" \
65 "DisplayName" "Pulse-Eight USB-CEC Adapter driver"
66 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pulse-Eight USB-CEC Adapter driver" \
67 "UninstallString" "$INSTDIR\uninstall.exe"
68 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pulse-Eight USB-CEC Adapter driver" \
70 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pulse-Eight USB-CEC Adapter driver" \
72 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pulse-Eight USB-CEC Adapter driver" \
73 "InstallLocation" "$INSTDIR"
74 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pulse-Eight USB-CEC Adapter driver" \
75 "Publisher" "Pulse-Eight Limited"
76 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pulse-Eight USB-CEC Adapter driver" \
77 "HelpLink" "http://www.pulse-eight.com/"
78 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pulse-Eight USB-CEC Adapter driver" \
79 "URLInfoAbout" "http://www.pulse-eight.com"
83 ExecWait '"$INSTDIR\dpinst-amd64.exe" /lm /sa /sw /PATH "$INSTDIR"'
85 ExecWait '"$INSTDIR\dpinst-x86.exe" /lm /sa /sw /PATH "$INSTDIR"'
89 ;--------------------------------
94 SetShellVarContext current
97 ExecWait '"$INSTDIR\dpinst-amd64.exe" /u "$INSTDIR\p8usb-cec.inf"'
99 ExecWait '"$INSTDIR\dpinst-x64.exe" /u "$INSTDIR\p8usb-cec.inf"'
101 Delete "$INSTDIR\AUTHORS"
102 Delete "$INSTDIR\COPYING"
103 Delete "$INSTDIR\p8usb-cec.inf"
104 Delete "$INSTDIR\p8usb-cec.cat"
105 Delete "$INSTDIR\dpinst-amd64.exe"
106 Delete "$INSTDIR\dpinst-x86.exe"
108 RMDir /r "$INSTDIR\include"
109 Delete "$INSTDIR\Uninstall.exe"
111 RMDir "$PROGRAMFILES\Pulse-Eight\USB-CEC Adapter"
112 RMDir "$PROGRAMFILES\Pulse-Eight"
114 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pulse-Eight USB-CEC Adapter driver"
115 DeleteRegKey /ifempty HKLM "Software\Pulse-Eight\USB-CEC Adapter driver"
116 DeleteRegKey /ifempty HKLM "Software\Pulse-Eight"