1 ; $Id: c_count.nsi,v 1.8 2021/01/09 15:12:46 tom Exp $ 2 ; Script generated with the Venis Install Wizard 3 4 ; Define your application name 5 !define APPNAME "c_count" 6 !define VERSION_MAJOR "7" 7 !define VERSION_MINOR "20" 8 !define VERSION "${VERSION_MAJOR}.${VERSION_MINOR}" 9 !define APPNAMEANDVERSION "${APPNAME} ${VERSION}" 10 11 ; Main Install settings 12 Name "${APPNAMEANDVERSION}" 13 InstallDir "\mingw\bin" 14 InstallDirRegKey HKLM "Software\${APPNAME}" "NSIS install_dir" 15 OutFile "NSIS-Output\${APPNAME}-${VERSION}-setup.exe" 16 17 ; Modern interface settings 18 !include "MUI.nsh" 19 20 !define MUI_ABORTWARNING 21 22 !insertmacro MUI_PAGE_WELCOME 23 !insertmacro MUI_PAGE_LICENSE "..\COPYING" 24 !insertmacro MUI_PAGE_COMPONENTS 25 !insertmacro MUI_PAGE_DIRECTORY 26 !insertmacro MUI_PAGE_INSTFILES 27 !insertmacro MUI_PAGE_FINISH 28 29 !insertmacro MUI_UNPAGE_CONFIRM 30 !insertmacro MUI_UNPAGE_INSTFILES 31 32 ; Set languages (first is default language) 33 !insertmacro MUI_LANGUAGE "English" 34 !insertmacro MUI_RESERVEFILE_LANGDLL 35 36 InstType "Full" ; SectionIn 1 37 InstType "Typical" ; SectionIn 2 38 39 Section "C_Count" Section1 40 41 SectionIn 1 2 42 43 ; Set Section properties 44 SetOverwrite on 45 46 ; Set Section Files and Shortcuts 47 SetOutPath "$INSTDIR\" 48 File ".\bin\c_count.exe" 49 CreateDirectory "$SMPROGRAMS\C_Count" 50 51 SectionEnd 52 53 Section "Documentation" Section2 54 55 SectionIn 1 2 56 57 ; Set Section properties 58 SetOverwrite on 59 60 ; Set Section Files and Shortcuts 61 SetOutPath "$INSTDIR\" 62 File ".\share\man\man1\c_count.1" 63 64 SectionEnd 65 66 Section -FinishSection 67 68 WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR" 69 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}" 70 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe" 71 WriteUninstaller "$INSTDIR\uninstall.exe" 72 73 SectionEnd 74 75 ; Modern install component descriptions 76 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN 77 !insertmacro MUI_DESCRIPTION_TEXT ${Section1} "Program" 78 !insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Documentation" 79 !insertmacro MUI_FUNCTION_DESCRIPTION_END 80 81 ;Uninstall section 82 Section Uninstall 83 84 ;Remove from registry... 85 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" 86 DeleteRegKey HKLM "SOFTWARE\${APPNAME}" 87 88 ; Delete self 89 Delete "$INSTDIR\uninstall.exe" 90 91 ; Clean up program 92 Delete "$INSTDIR\c_count.exe" 93 Delete "$INSTDIR\c_count.txt" 94 95 ; Remove remaining directories 96 RMDir "$SMPROGRAMS\CCount" 97 RMDir "$INSTDIR\" 98 99 SectionEnd 100 101 ; eof