; NSIS script for Angry IP Scanner ; Written by: lunarg@blackmanticore.com (v0.2) ; ; v0.2 -- Fixed file name to ipscan221.exe to accomodate for new download name (was: ipscan.exe) ; v0.1 -- Initial release ; ;-------------------------------- ;Static variables (like version-info) !define MY_VERINFO_INT 221 !define MY_VERINFO_STR "2.21" !define MY_VERINFO_MIN 21 !define MY_VERINFO_MAJ 2 !define MY_FILESIZE 110 ;-------------------------------- ;Include Modern UI !include "MUI2.nsh" !include "WinVer.nsh" ;-------------------------------- ;Custom graphics settings ; MUI Settings / Icons !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico" !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico" ; MUI Settings / Header !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_RIGHT !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-r.bmp" !define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall-r.bmp" ; MUI Settings / Wizard !define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp" !define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp" ;-------------------------------- ;General ;Name and file Name "Angry IP Scanner" Caption "Angry IP Scanner" BrandingText "Angryziber" OutFile "ipscan221-setup.exe" SetDatablockOptimize on CRCCheck on ;Default installation folder InstallDir "$PROGRAMFILES\Angry IP Scanner" ;Get installation folder from registry if available InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "InstallLocation" ;Request application privileges for Windows Vista RequestExecutionLevel admin ;-------------------------------- ;Interface Settings !define MUI_ABORTWARNING ;-------------------------------- ;Language Selection Dialog Settings ;Remember the installer language !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" !define MUI_LANGDLL_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" ;-------------------------------- ;Pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE $(F_License) !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM ;!insertmacro MUI_UNPAGE_COMPONENTS !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Reserve Files ;If you are using solid compression, files that are required before ;the actual installation should be stored first in the data block, ;because this will make your installer start faster. !insertmacro MUI_RESERVEFILE_LANGDLL ;-------------------------------- ;Language strings LicenseLangString F_License ${LANG_ENGLISH} "License.txt" LangString SEC_Core ${LANG_ENGLISH} "Program files" LangString DESC_Core ${LANG_ENGLISH} "The actual program files." LangString SEC_Shortcuts ${LANG_ENGLISH} "Start menu shortcuts" LangString DESC_Shortcuts ${LANG_ENGLISH} "Create shortcuts in start menu." ;-------------------------------- ;Installer Sections Section $(SEC_Core) Core SectionIn RO ; Set context to all users SetShellVarContext all SetOutPath "$INSTDIR" ;ADD YOUR OWN FILES HERE... File "ipscan221.exe" File "License.txt" ;Store installation folder WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "InstallLocation" $INSTDIR ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" ;Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "DisplayName" "Angry IP scanner" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "Publisher" "Angryziber" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "DisplayIcon" "$INSTDIR\ipscan.exe" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "Version" "${MY_VERINFO_STR}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "DisplayVersion" "${MY_VERINFO_STR}" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "VersionMajor" ${MY_VERINFO_MAJ} WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "VersionMinor" ${MY_VERINFO_MIN} WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "NoModify" 1 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "NoRepair" 1 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "EstimatedSize" ${MY_FILESIZE} WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "URLInfoAbout" "http://angryip.org/" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" "HelpLink" "http://angryip.org/" SectionEnd Section $(SEC_Shortcuts) Shortcuts ; Set context to all users SetShellVarContext all CreateDirectory "$SMPROGRAMS\Angry IP scanner" CreateShortCut "$SMPROGRAMS\Angry IP scanner\IPscan.lnk" "$INSTDIR\ipscan221.exe" "" "$INSTDIR\ipscan221.exe" 0 SectionEnd ;-------------------------------- ;Installer Functions Function .onInit ; !insertmacro MUI_LANGDLL_DISPLAY FunctionEnd ;-------------------------------- ;Descriptions !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${Core} $(DESC_Core) !insertmacro MUI_DESCRIPTION_TEXT ${Shortcuts} $(DESC_Shortcuts) !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- ;Uninstaller Section Section "Uninstall" ; Set context to all users SetShellVarContext all ; Remove file association ;ADD YOUR OWN FILES HERE... Delete "$INSTDIR\ipscan.exe" Delete "$INSTDIR\Uninstall.exe" ; Remove shortcuts, if any Delete "$SMPROGRAMS\Angry IP scanner\*.*" ; Remove directories used RMDir "$SMPROGRAMS\Angry IP scanner" RMDir "$INSTDIR" ; Remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ipscan" SectionEnd ;-------------------------------- ;Uninstaller Functions Function un.onInit ; !insertmacro MUI_UNGETLANGUAGE FunctionEnd