2 ;Copyright (C) 2011 Pulse-Eight Ltd.
3 ;http://www.pulse-eight.com/
6 !include "nsDialogs.nsh"
7 !include "LogicLib.nsh"
11 OutFile "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
55 File "..\LibCecSharp*.dll"
59 ReadRegStr $1 HKCU "Software\XBMC" ""
61 SetOutPath "$1\system"
65 SetOutPath "$INSTDIR\driver"
66 File "..\dpinst-amd64.exe"
67 File "..\dpinst-x86.exe"
69 SetOutPath "$INSTDIR\include"
70 File /r /x *.so "..\include\cec*.*"
72 ;Store installation folder
73 WriteRegStr HKCU "Software\libCEC" "" $INSTDIR
76 WriteUninstaller "$INSTDIR\Uninstall.exe"
78 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
81 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
82 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\CEC Test client.lnk" "$INSTDIR\cec-client.exe" \
83 "" "$INSTDIR\cec-client.exe" 0 SW_SHOWNORMAL \
84 "" "Start the CEC Test client."
86 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\CEC Test client (x64).lnk" "$INSTDIR\cec-client.x64.exe" \
87 "" "$INSTDIR\cec-client.x64.exe" 0 SW_SHOWNORMAL \
88 "" "Start the CEC Test client (x64)."
90 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall libCEC.lnk" "$INSTDIR\Uninstall.exe" \
91 "" "$INSTDIR\Uninstall.exe" 0 SW_SHOWNORMAL \
92 "" "Uninstall libCEC."
94 WriteINIStr "$SMPROGRAMS\$StartMenuFolder\Visit Pulse-Eight.url" "InternetShortcut" "URL" "http://www.pulse-eight.com/"
95 !insertmacro MUI_STARTMENU_WRITE_END
98 ;add entry to add/remove programs
99 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
100 "DisplayName" "libCEC"
101 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
102 "UninstallString" "$INSTDIR\uninstall.exe"
103 WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
105 WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
107 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
108 "InstallLocation" "$INSTDIR"
109 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
110 "DisplayIcon" "$INSTDIR\cec-client.exe,0"
111 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
112 "Publisher" "Pulse-Eight Ltd."
113 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
114 "HelpLink" "http://www.pulse-eight.com/"
115 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
116 "URLInfoAbout" "http://www.pulse-eight.com"
120 ExecWait '"$INSTDIR\driver\dpinst-amd64.exe" /lm /sa /sw /PATH "$INSTDIR\driver"'
122 ExecWait '"$INSTDIR\driver\dpinst-x86.exe" /lm /sa /sw /PATH "$INSTDIR\driver"'
126 ;--------------------------------
131 SetShellVarContext current
134 ExecWait '"$INSTDIR\driver\dpinst-amd64.exe" /u "$INSTDIR\driver\OEM001.inf"'
136 ExecWait '"$INSTDIR\driver\dpinst-x64.exe" /u "$INSTDIR\driver\OEM001.inf"'
138 Delete "$INSTDIR\AUTHORS"
139 Delete "$INSTDIR\cec*.exe"
140 Delete "$INSTDIR\ChangeLog"
141 Delete "$INSTDIR\COPYING"
142 Delete "$INSTDIR\*.dll"
143 Delete "$INSTDIR\*.lib"
144 Delete "$INSTDIR\*.pdb"
145 Delete "$INSTDIR\README"
146 Delete "$INSTDIR\driver\OEM001.inf"
147 Delete "$INSTDIR\driver\dpinst-amd64.exe"
148 Delete "$INSTDIR\driver\dpinst-x86.exe"
150 RMDir /r "$INSTDIR\include"
151 Delete "$INSTDIR\Uninstall.exe"
154 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
155 Delete "$SMPROGRAMS\$StartMenuFolder\CEC Test client.lnk"
157 Delete "$SMPROGRAMS\$StartMenuFolder\CEC Test client (x64).lnk"
159 Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall libCEC.lnk"
160 Delete "$SMPROGRAMS\$StartMenuFolder\Visit Pulse-Eight.url"
161 RMDir "$SMPROGRAMS\$StartMenuFolder"
163 DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC"
165 DeleteRegKey /ifempty HKCU "Software\libCEC"