⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shylock.nsi

📁 c+++ game uploading now
💻 NSI
字号:
; The name of the installer
Name "Shylock"

; The file to write
OutFile "shylocksetup.exe"

; The default installation directory
InstallDir $PROGRAMFILES\Shylock

; Registry key to check for directory (so if you install again, it will 
; overwrite the old one automatically)
InstallDirRegKey HKLM SOFTWARE\Shylock "Install_Dir"

; Check installer integrity
CRCCheck on

; use compression only if there is something to gain
SetCompress auto

; No background image during install
BGGradient off

;display license text
LicenseText "You must read the following license before installing:"
LicenseData license.txt

; Show install process details
ShowInstDetails show

; Show uninstall process details
ShowUninstDetails show

; The text to prompt the user to enter a directory
ComponentText "You are now installing Shylock on your computer. Shylock is an \
Othello (Reversi) entity, with strong playing strength:"

; The text to prompt the user to enter a directory
DirText "Select a directory to install in to:"

DirShow show

; binaries, helpfiles
Section "Install base files"
  ; Set output path to the installation directory.
  SetOutPath $INSTDIR
  
  ; InputFiles
  File "Shylock.exe"
  File "params.bin"
  File "Usage.htm"
  File "Background1.jpg"
  File "Logo1.jpg"
  File "Shylock.css"
  File "license.txt"
  File "vim.vialle.love.anim.gif"
  

  ; Write the installation path into the registry
  WriteRegStr HKLM SOFTWARE\Shylock "Install_Dir" "$INSTDIR"

  ; Write the uninstall keys for Windows
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Shylock" "DisplayName" "Shylock (remove only)"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Shylock" "UninstallString" '"$INSTDIR\uninstall.exe"'

  ; Write uninstaller
  WriteUninstaller $INSTDIR\uninstall.exe
SectionEnd

; Start menu
Section "Install Start Menu shortcuts"
  CreateDirectory "$SMPROGRAMS\Shylock"
  CreateShortCut "$SMPROGRAMS\Shylock\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
  CreateShortCut "$SMPROGRAMS\Shylock\Shylock.lnk" "$INSTDIR\Shylock.exe" "" "$INSTDIR\Shylock.exe" 0
  CreateShortCut "$SMPROGRAMS\Shylock\Shylock help.lnk" "$INSTDIR\Usage.htm" "" "$INSTDIR\Usage.htm" 0
SectionEnd

; Desktop shortcuts
Section "Put a shortcut on the desktop"
  CreateShortCut "$DESKTOP\Shylock.lnk" "$INSTDIR\Shylock.exe" "" "$INSTDIR\Shylock.exe" 0
SectionEnd


; uninstall stuff
UninstallText "This will uninstall Shylock. Hit next to continue."

; special uninstall section.
Section "Uninstall"
  
  ; remove registry keys
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Shylock"
  DeleteRegKey HKLM SOFTWARE\Shylock

  IfFileExists $INSTDIR\book.bin 0 OtherFiles
  Delete $INSTDIR\book.bin
OtherFiles:
  ; remove files
  Delete $INSTDIR\Shylock.exe
  Delete $INSTDIR\params.bin
  Delete $INSTDIR\Usage.htm
  Delete $INSTDIR\Logo1.jpg
  Delete $INSTDIR\Background1.jpg
  Delete $INSTDIR\Shylock.css
  Delete $INSTDIR\license.txt
  Delete $INSTDIR\vim.vialle.love.anim.gif
  ;just to be sure
  Delete "$INSTDIR\*.*"
  
  ; MUST REMOVE UNINSTALLER, too
  Delete $INSTDIR\uninstall.exe
  
  ; remove shortcuts, if any.
  Delete "$SMPROGRAMS\Shylock\*.*"
  
  ; remove directories used.
  RMDir "$SMPROGRAMS\Shylock"
  
  RMDir "$INSTDIR"
SectionEnd

; eof

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -