2 ;Copyright (C) 2011 Pulse-Eight Ltd.
3 ;http://www.pulse-eight.com/
6 !include "nsDialogs.nsh"
7 !include "LogicLib.nsh"
11 OutFile "..\build\libCEC-installer.exe"
14 InstallDir "$PROGRAMFILES\libCEC"
15 InstallDirRegKey HKCU "Software\libCEC" ""
16 RequestExecutionLevel admin
19 !define MUI_FINISHPAGE_LINK "Visit http://www.pulse-eight.com/ for more information."
20 !define MUI_FINISHPAGE_LINK_LOCATION "http://www.pulse-eight.com/"
21 !define MUI_ABORTWARNING
23 !insertmacro MUI_PAGE_WELCOME
24 !insertmacro MUI_PAGE_LICENSE "..\COPYING"
25 !insertmacro MUI_PAGE_DIRECTORY
27 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
28 !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\libCEC"
29 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
30 !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
32 !insertmacro MUI_PAGE_INSTFILES
33 !insertmacro MUI_PAGE_FINISH
35 !insertmacro MUI_UNPAGE_WELCOME
36 !insertmacro MUI_UNPAGE_CONFIRM
37 !insertmacro MUI_UNPAGE_INSTFILES
38 !insertmacro MUI_UNPAGE_FINISH
40 !insertmacro MUI_LANGUAGE "English"
44 Section "libCEC" SecLibCEC
45 SetShellVarContext current
47 SectionIn 1 #section is in installtype Full
49 ; Copy to the installation directory
52 File /x dpinst*.exe "..\build\*.exe"
57 SetOutPath "$INSTDIR\x64"
58 File /nonfatal "..\build\x64\*"
61 ReadRegStr $1 HKCU "Software\XBMC" ""
63 SetOutPath "$1\system"
64 File "..\build\libcec.dll"
67 ; Copy the driver installer and .inf file
68 SetOutPath "$INSTDIR\driver"
69 File "..\build\dpinst-amd64.exe"
70 File "..\build\dpinst-x86.exe"
74 SetOutPath "$INSTDIR\include"
75 File /r /x *.so "..\include\cec*.*"
77 ; Copy libcec.dll and libcec.x64.dll to the system directory
79 File "..\build\libcec.dll"
81 File /nonfatal "..\build\x64\libcec.x64.dll"
84 ;Store installation folder
85 WriteRegStr HKCU "Software\libCEC" "" $INSTDIR
88 WriteUninstaller "$INSTDIR\Uninstall.exe"
90 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
93 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
94 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\CEC Test client.lnk" "$INSTDIR\cec-client.exe" \
95 "" "$INSTDIR\cec-client.exe" 0 SW_SHOWNORMAL \
96 "" "Start the CEC Test client."
98 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\CEC Test client (x64).lnk" "$INSTDIR\x64\cec-client.x64.exe" \
99 "" "$INSTDIR\cec-client.x64.exe" 0 SW_SHOWNORMAL \
100 "" "Start the CEC Test client (x64)."
102 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall libCEC.lnk" "$INSTDIR\Uninstall.exe" \
103 "" "$INSTDIR\Uninstall.exe" 0 SW_SHOWNORMAL \
104 "" "Uninstall libCEC."
106 WriteINIStr "$SMPROGRAMS\$StartMenuFolder\Visit Pulse-Eight.url" "InternetShortcut" "URL" "http://www.pulse-eight.com/"
107 !insertmacro MUI_STARTMENU_WRITE_END
110 ;add entry to add/remove programs
111 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
112 "DisplayName" "libCEC"
113 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
114 "UninstallString" "$INSTDIR\uninstall.exe"
115 WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
117 WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
119 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
120 "InstallLocation" "$INSTDIR"
121 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
122 "DisplayIcon" "$INSTDIR\cec-client.exe,0"
123 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
124 "Publisher" "Pulse-Eight Ltd."
125 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
126 "HelpLink" "http://www.pulse-eight.com/"
127 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
128 "URLInfoAbout" "http://www.pulse-eight.com"
132 ExecWait '"$INSTDIR\driver\dpinst-amd64.exe" /lm /sa /sw /PATH "$INSTDIR\driver"'
134 ExecWait '"$INSTDIR\driver\dpinst-x86.exe" /lm /sa /sw /PATH "$INSTDIR\driver"'
138 ;--------------------------------
143 SetShellVarContext current
146 ExecWait '"$INSTDIR\driver\dpinst-amd64.exe" /u "$INSTDIR\driver\OEM001.inf"'
148 ExecWait '"$INSTDIR\driver\dpinst-x64.exe" /u "$INSTDIR\driver\OEM001.inf"'
150 Delete "$INSTDIR\AUTHORS"
151 Delete "$INSTDIR\cec*.exe"
152 Delete "$INSTDIR\ChangeLog"
153 Delete "$INSTDIR\COPYING"
154 Delete "$INSTDIR\*.dll"
155 Delete "$INSTDIR\*.lib"
156 Delete "$INSTDIR\x64\*.dll"
157 Delete "$INSTDIR\x64\*.lib"
158 Delete "$INSTDIR\README"
159 Delete "$INSTDIR\driver\OEM001.inf"
160 Delete "$INSTDIR\driver\dpinst-amd64.exe"
161 Delete "$INSTDIR\driver\dpinst-x86.exe"
163 RMDir /r "$INSTDIR\include"
164 Delete "$INSTDIR\Uninstall.exe"
167 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
168 Delete "$SMPROGRAMS\$StartMenuFolder\CEC Test client.lnk"
170 Delete "$SMPROGRAMS\$StartMenuFolder\CEC Test client (x64).lnk"
172 Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall libCEC.lnk"
173 Delete "$SMPROGRAMS\$StartMenuFolder\Visit Pulse-Eight.url"
174 RMDir "$SMPROGRAMS\$StartMenuFolder"
176 DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC"
178 DeleteRegKey /ifempty HKCU "Software\libCEC"