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 "Please 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
50 File "..\cec-client.exe"
55 File "..\pthreadVC2.dll"
58 SetOutPath "$INSTDIR\driver"
59 File "..\dpinst-amd64.exe"
60 File "..\dpinst-x86.exe"
62 SetOutPath "$INSTDIR\include"
63 File /r /x *.so "..\include\cec*.*"
65 ;Store installation folder
66 WriteRegStr HKCU "Software\libCEC" "" $INSTDIR
69 WriteUninstaller "$INSTDIR\Uninstall.exe"
71 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
74 CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
75 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\CEC Test client.lnk" "$INSTDIR\cec-client.exe" \
76 "" "$INSTDIR\cec-client.exe" 0 SW_SHOWNORMAL \
77 "" "Start the CEC Test client."
78 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall libCEC.lnk" "$INSTDIR\Uninstall.exe" \
79 "" "$INSTDIR\Uninstall.exe" 0 SW_SHOWNORMAL \
80 "" "Uninstall libCEC."
82 WriteINIStr "$SMPROGRAMS\$StartMenuFolder\Visit Pulse-Eight.url" "InternetShortcut" "URL" "http://www.pulse-eight.com/"
83 !insertmacro MUI_STARTMENU_WRITE_END
86 ;add entry to add/remove programs
87 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
88 "DisplayName" "libCEC"
89 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
90 "UninstallString" "$INSTDIR\uninstall.exe"
91 WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
93 WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
95 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
96 "InstallLocation" "$INSTDIR"
97 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
98 "DisplayIcon" "$INSTDIR\cec-client.exe,0"
99 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
100 "Publisher" "Pulse-Eight Ltd."
101 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
102 "HelpLink" "http://www.pulse-eight.com/"
103 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC" \
104 "URLInfoAbout" "http://www.pulse-eight.com"
108 ExecWait '"$INSTDIR\driver\dpinst-amd64.exe" /lm /sa /sw /PATH "$INSTDIR\driver"'
110 ExecWait '"$INSTDIR\driver\dpinst-x86.exe" /lm /sa /sw /PATH "$INSTDIR\driver"'
114 ;--------------------------------
119 SetShellVarContext current
122 ExecWait '"$INSTDIR\driver\dpinst-amd64.exe" /u "$INSTDIR\driver\OEM001.inf"'
124 ExecWait '"$INSTDIR\driver\dpinst-x64.exe" /u "$INSTDIR\driver\OEM001.inf"'
126 Delete "$INSTDIR\AUTHORS"
127 Delete "$INSTDIR\cec-client.exe"
128 Delete "$INSTDIR\ChangeLog"
129 Delete "$INSTDIR\COPYING"
130 Delete "$INSTDIR\libcec.dll"
131 Delete "$INSTDIR\libcec.lib"
132 Delete "$INSTDIR\libcec.pdb"
133 Delete "$INSTDIR\pthreadVC2.dll"
134 Delete "$INSTDIR\README"
135 Delete "$INSTDIR\driver\OEM001.inf"
136 Delete "$INSTDIR\driver\dpinst-amd64.exe"
137 Delete "$INSTDIR\driver\dpinst-x86.exe"
139 RMDir /r "$INSTDIR\include"
140 Delete "$INSTDIR\Uninstall.exe"
143 !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
144 Delete "$SMPROGRAMS\$StartMenuFolder\CEC Test client.lnk"
145 Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall libCEC.lnk"
146 Delete "$SMPROGRAMS\$StartMenuFolder\Visit Pulse-Eight.url"
147 RMDir "$SMPROGRAMS\$StartMenuFolder"
149 DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\libCEC"
151 DeleteRegKey /ifempty HKCU "Software\libCEC"