📄 haalireader.nsi
字号:
; Default names
!ifndef NAME
!define NAME "Haali Reader CE"
!endif
!ifndef NSPNAME
!define NSPNAME "HaaliReaderCE"
!endif
!ifndef VENDOR
!define VENDOR "Haali"
!endif
!ifndef VERSION
!define VERSION "2.0"
!endif
Name "${NAME}"
; Use the new UI
!include "MUI.nsh"
; MUI settings
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-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"
Section "Haali Reader"
SetOutPath $INSTDIR
; check for appmgr
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\CEAPPMGR.EXE" ""
StrCmp $0 "" 0 okmgr
Abort "CE App Manager not found!"
okmgr:
File "HaaliReader.ARM.PPC.CAB"
File "HaaliReader.MIPS.PPC.CAB"
File "HaaliReader.SH3.PPC.CAB"
File "HaaliReader.ini"
; Write the installation path into the registry
WriteRegStr HKLM "SOFTWARE\${VENDOR}\${NSPNAME}" "InstallDir" "$INSTDIR"
; Uninstall info
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${VENDOR}${NSPNAME}" "DisplayName" "${NAME} ${VERSION} (remove only)"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${VENDOR}${NSPNAME}" "UninstallString" '"$INSTDIR\uninstall.exe"'
; uninstall program
WriteUninstaller "uninstall.exe"
; run ce app mgr
Exec '"$0" "$INSTDIR\HaaliReader.ini"'
IfErrors noclose
SetAutoClose true
noclose:
SectionEnd
Section "Uninstall"
; remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${VENDOR}${NSPNAME}"
DeleteRegKey HKLM "SOFTWARE\${VENDOR}\${NSPNAME}"
; remove files
Delete "$INSTDIR\HaaliReader.ini"
Delete "$INSTDIR\HaaliReader.ARM.PPC.CAB"
Delete "$INSTDIR\HaaliReader.MIPS.PPC.CAB"
Delete "$INSTDIR\HaaliReader.MIPS.PsPC.CAB"
Delete "$INSTDIR\HaaliReader.SH3.PPC.CAB"
Delete "$INSTDIR\HaaliReader.SH3.PsPC.CAB"
; MUST REMOVE UNINSTALLER, too
Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR"
IfErrors noclose
SetAutoClose true
noclose:
SectionEnd
; eof
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -