mudgangster

Tiny, scriptable MUD client
Log | Files | Refs | README

installer.nsi (2050B)


      1 !include "MUI2.nsh"
      2 
      3 Name "Mud Gangster"
      4 Outfile "MudGangsterInstaller.exe"
      5 
      6 !define MUI_ICON "icon.ico"
      7 !define MUI_UNICON "icon.ico"
      8 
      9 InstallDir "$PROGRAMFILES64\Mud Gangster"
     10 RequestExecutionLevel admin
     11 
     12 !insertmacro MUI_PAGE_DIRECTORY
     13 !insertmacro MUI_PAGE_INSTFILES
     14 !insertmacro MUI_UNPAGE_CONFIRM
     15 !insertmacro MUI_UNPAGE_INSTFILES
     16 
     17 Section "Install" SectionInstall
     18 	# Install stuff
     19 	SetOutPath $INSTDIR
     20 	File ..\release\mudgangster.exe
     21 	File licenses.txt
     22 
     23 	# Start menu shortcut
     24 	CreateDirectory "$SMPROGRAMS\Mud Gangster"
     25 	CreateShortCut "$SMPROGRAMS\Mud Gangster\Mud Gangster.lnk" "$INSTDIR\mudgangster.exe"
     26 
     27 	# Uninstaller
     28 	WriteUninstaller "$INSTDIR\uninstall.exe"
     29 
     30 	# Registry keys
     31 	SetRegView 64
     32 	WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MudGangster" "DisplayName" "Mud Gangster"
     33 	WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MudGangster" "UninstallString" "$INSTDIR\uninstall.exe"
     34 	WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MudGangster" "DisplayIcon" "$INSTDIR\mudgangster.exe"
     35 	WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MudGangster" "Publisher" "Hirve"
     36 	WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MudGangster" "DisplayVersion" "0.0.0.0"
     37 	WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MudGangster" "NoModify" 1
     38 	WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MudGangster" "NoRepair" 1
     39 
     40 	SectionGetSize ${SectionInstall} $0
     41 	IntFmt $1 "0x%08X" $0
     42 	WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MudGangster" "EstimatedSize" $1
     43 SectionEnd
     44 
     45 Section "Uninstall"
     46 	# Files
     47 	Delete "$INSTDIR\MudGangster.exe"
     48 	Delete "$INSTDIR\licenses.txt"
     49 	Delete "$INSTDIR\uninstall.exe"
     50 	RMDir "$INSTDIR"
     51 
     52 	# Start menu shortcut
     53 	Delete "$SMPROGRAMS\Mud Gangster\Mud Gangster.lnk"
     54 	RMDir "$SMPROGRAMS\Mud Gangster"
     55 
     56 	# Registry keys
     57 	SetRegView 64
     58 	DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MudGangster"
     59 SectionEnd