;Written by Dean Wilson !define MUI_PRODUCT "IE Addressbar Search - CPAN" !define MUI_VERSION "0.1" !include "MUI.nsh" OutFile "IE_AB_CPAN_search.exe" InstallDir "$PROGRAMFILES" ;-------------------------------- ;Modern UI Configuration !define MUI_LICENSEPAGE !define MUI_DIRECTORYPAGE !define MUI_ABORTWARNING !define MUI_UNINSTALLER !define MUI_UNCONFIRMPAGE ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Data LicenseData "D:\Code\IE Addressbar\gpl.txt" ;-------------------------------- ;Installer Sections Section "cpan_ab_search" SecCopyUI ;add entry to reg ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WriteRegStr HKCU "Software\Microsoft\Internet Explorer\SearchUrl\cpan" "" "http://search.cpan.org/search?query=%s&mode=module" WriteRegStr HKCU "Software\Microsoft\Internet Explorer\SearchUrl\cpan" ":" "%3A" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;add to the "Add/Remove Programs" listing for the current user only WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT}" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" "$INSTDIR\IE_AB_CPAN_search_uninstall.exe" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "RegOwner" "Dean Wilson" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "URLInfoAbout" "www.unixdaemon.net" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayVersion" "${MUI_VERSION}" ;mark as remove only WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "NoRepair" "1" WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "NoModify" "1" ;Create uninstaller WriteUninstaller "$INSTDIR\IE_AB_CPAN_search_uninstall.exe" SectionEnd ;Display the Finish header ;Insert this macro after the sections if you are not using a finish page !insertmacro MUI_SECTIONS_FINISHHEADER ;-------------------------------- ;Uninstaller Section Section "Uninstall" Delete "$INSTDIR\IE_AB_CPAN_search_uninstall.exe" ;this removes the key and all leaves. DeleteRegKey HKCU "Software\Microsoft\Internet Explorer\SearchUrl\cpan" DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" ;Display the Finish header !insertmacro MUI_UNFINISHHEADER SectionEnd