HaaliReaderDesktop.nsi
上传用户:hmc_gdtv
上传日期:2013-08-04
资源大小:798k
文件大小:4k
源码类别:
Windows Mobile
开发平台:
Visual C++
- ; Default names
- !ifndef NAME
- !define NAME "Haali Reader"
- !endif
- !ifndef NSPNAME
- !define NSPNAME "HaaliReader"
- !endif
- !ifndef VENDOR
- !define VENDOR "Haali"
- !endif
- !ifndef VERSION
- !define VERSION "2.0"
- !endif
- Name "${NAME}"
- ; Use the new UI
- !include "MUI.nsh"
- !define MUI_ICON "${NSISDIR}ContribGraphicsIconswin-install.ico"
- !define MUI_UNICON "${NSISDIR}ContribGraphicsIconswin-uninstall.ico"
- ; The file to write
- OutFile "${NAME} v${VERSION} Setup.exe"
- ; The default installation directory
- InstallDir "$PROGRAMFILES${VENDOR}${NAME}"
- InstallDirRegKey HKLM "SOFTWARE${VENDOR}${NSPNAME}" "InstallDir"
- ; Insert MUI
- !insertmacro MUI_PAGE_WELCOME
- !insertmacro MUI_PAGE_LICENSE "LICENSE.txt"
- !insertmacro MUI_PAGE_DIRECTORY
- !insertmacro MUI_PAGE_INSTFILES
- !insertmacro MUI_PAGE_FINISH
- !insertmacro MUI_UNPAGE_WELCOME
- !insertmacro MUI_UNPAGE_CONFIRM
- !insertmacro MUI_UNPAGE_INSTFILES
- !insertmacro MUI_UNPAGE_FINISH
- !insertmacro MUI_LANGUAGE "English"
- ; first section, initialize
- Section ""
- SetOutPath $INSTDIR
- ; install unicows on win9x
- ReadRegStr $0 HKLM "SOFTWAREMicrosoftWindows NTCurrentVersion" CurrentVersion
- StrCmp $0 "" 0 nthere
- File "....unicowsunicows.dll"
- nthere:
- ; create an FB2 progid
- WriteRegStr HKCR "FictionBook.2" "" "FictionBook"
- WriteRegStr HKCR "FictionBook.2CurVer" "" "FictionBook.2"
- ; create an FB2 filetype
- WriteRegStr HKCR ".fb2" "" "FictionBook.2"
- WriteRegStr HKCR ".fb2" "PerceivedType" "Text"
- WriteRegStr HKCR ".fb2" "Content Type" "text/xml"
- File /oname=HaaliReader.exe "HaaliReader.x86.U.exe"
- CreateDirectory "$SMPROGRAMS${NAME}"
- CreateShortCut "$SMPROGRAMS${NAME}Haali Reader.lnk" "$INSTDIRHaaliReader.exe" "" "$INSTDIRHaaliReader.exe" 0
- CreateShortcut "$SMPROGRAMS${NAME}Haali Reader Dictionary.lnk" "$INSTDIRHaaliReader.exe" "-d" "$INSTDIRHaaliReader.exe" 0
- ; register application
- WriteRegStr HKCR "ApplicationsHaaliReader.exe" "FriendlyAppName" "Haali Reader"
- WriteRegStr HKCR "ApplicationsHaaliReader.exeSupportedTypes" ".fb2" ""
- WriteRegStr HKCR "ApplicationsHaaliReader.exeSupportedTypes" ".xml" ""
- WriteRegStr HKCR "ApplicationsshellOpenCommand" "" '"$INSTDIRHaaliReader.exe" "%1"'
- ; register verb
- WriteRegStr HKCR "FictionBook.2shellOpenCommand" "" '"$INSTDIRHaaliReader.exe" "%1"'
- ; Uninstall shortcut
- CreateShortCut "$SMPROGRAMS${NAME}Uninstall.lnk" "$INSTDIRuninstall.exe" "" "$INSTDIRuninstall.exe" 0
- ; Write the installation path into the registry
- WriteRegStr HKLM "SOFTWARE${VENDOR}${NSPNAME}" "InstallDir" "$INSTDIR"
- ; Uninstall info
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${VENDOR}${NSPNAME}" "DisplayName" "${NAME} ${VERSION} (remove only)"
- WriteRegStr HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${VENDOR}${NSPNAME}" "UninstallString" '"$INSTDIRuninstall.exe"'
- ; uninstall program
- WriteUninstaller "uninstall.exe"
- SectionEnd
- Section "Uninstall"
- ; remove registry keys
- DeleteRegKey HKLM "SoftwareMicrosoftWindowsCurrentVersionUninstall${VENDOR}${NSPNAME}"
- DeleteRegKey HKLM "SOFTWARE${VENDOR}${NSPNAME}"
- DeleteRegValue HKLM "SoftwareMicrosoftIE SetupDependentComponents" "FictionBook Editor"
- ; remove applications
- DeleteRegKey HKCR "ApplicationsFBE.exe"
- ; remove verbs
- DeleteRegKey HKCR "FictionBook.2shellOpen"
- ; remove files
- Delete "$INSTDIRHaaliReader.exe"
- ; MUST REMOVE UNINSTALLER, too
- Delete "$INSTDIRuninstall.exe"
- ; remove shortcuts, if any.
- Delete "$SMPROGRAMS${NAME}*.*"
- ; remove directories used.
- RMDir "$SMPROGRAMS${NAME}"
- RMDir "$INSTDIR"
- SectionEnd
- ; eof