1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
!include "MUI.nsh"
!include "kshutdown.nsh"
Name "KShutdown for Windows"
OutFile "kshutdown-${APP_FILE_VERSION}-win32.exe"
InstallDir "$PROGRAMFILES\KShutdown"
InstallDirRegKey HKCU "Software\kshutdown.sf.net" ""
!define APP_UNINSTALL_REG "Software\Microsoft\Windows\CurrentVersion\Uninstall\KShutdown"
!define MUI_ABORTWARNING
!define MUI_COMPONENTSPAGE_NODESC
!insertmacro MUI_PAGE_LICENSE "LICENSE"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section "-"
SetOutPath "$INSTDIR"
WriteUninstaller "$INSTDIR\uninstall.exe"
WriteRegStr HKCU "Software\kshutdown.sf.net" "" $INSTDIR
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\kshutdown.exe" "" "$INSTDIR\kshutdown.exe"
WriteRegStr HKLM "${APP_UNINSTALL_REG}" "DisplayIcon" "$INSTDIR\kshutdown.ico"
WriteRegStr HKLM "${APP_UNINSTALL_REG}" "DisplayName" "KShutdown"
WriteRegStr HKLM "${APP_UNINSTALL_REG}" "DisplayVersion" "${APP_FULL_VERSION}"
WriteRegDWORD HKLM "${APP_UNINSTALL_REG}" "NoModify" 1
WriteRegDWORD HKLM "${APP_UNINSTALL_REG}" "NoRepair" 1
WriteRegStr HKLM "${APP_UNINSTALL_REG}" "Publisher" "Konrad Twardowski"
WriteRegStr HKLM "${APP_UNINSTALL_REG}" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegStr HKLM "${APP_UNINSTALL_REG}" "URLInfoAbout" "http://kshutdown.sourceforge.net/"
WriteRegStr HKLM "${APP_UNINSTALL_REG}" "URLUpdateInfo" "http://kshutdown.sourceforge.net/download.html"
File src\images\kshutdown.ico
File src\release\kshutdown.exe
File LICENSE
File C:\Qt\2010.01\mingw\bin\mingwm10.dll
SetShellVarContext all
CreateShortCut "$SMPROGRAMS\KShutdown.lnk" "$INSTDIR\kshutdown.exe" "" "$INSTDIR\kshutdown.ico"
# TODO: support for silent mode
SectionEnd
Section "Autostart" SectionAutostart
SetShellVarContext all
CreateDirectory "$SMSTARTUP"
CreateShortCut "$SMSTARTUP\KShutdown.lnk" "$INSTDIR\kshutdown.exe" "--init" "$INSTDIR\kshutdown.ico"
SectionEnd
Section "Uninstall"
Delete "$INSTDIR\kshutdown.exe"
Delete "$INSTDIR\kshutdown.ico"
Delete "$INSTDIR\LICENSE"
Delete "$INSTDIR\mingwm10.dll"
Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR"
DeleteRegKey HKCU "Software\kshutdown.sf.net"
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\kshutdown.exe"
DeleteRegKey HKLM "${APP_UNINSTALL_REG}"
SetShellVarContext all
Delete "$DESKTOP\KShutdown.lnk"
Delete "$SMPROGRAMS\KShutdown.lnk"
Delete "$SMSTARTUP\KShutdown.lnk"
SectionEnd
|