3
; This script is based on example1.nsi, but adds uninstall support
4
; and (optionally) start menu shortcuts.
6
; It will install notepad.exe into a directory that the user selects,
14
; The name of the installer
16
Caption "Enigma ${VERSION} Setup"
19
OutFile "Enigma-0.92.exe"
22
; The default installation directory
23
InstallDir $PROGRAMFILES\Enigma
24
; Registry key to check for directory (so if you install again, it will
25
; overwrite the old one automatically)
26
InstallDirRegKey HKLM SOFTWARE\Enigma "Install_Dir"
28
; The text to prompt the user to enter a directory
29
ComponentText "This will install Enigma on your computer. Select which optional things you want installed."
30
; The text to prompt the user to enter a directory
31
DirText "Choose a directory to install in to:"
33
; The stuff to install
34
Section "Enigma (required)"
35
; Set output path to the installation directory.
39
File /r "${SDIR}\data"
41
File /r "${SDIR}\manual"
43
; Write the installation path into the registry
44
WriteRegStr HKLM SOFTWARE\Enigma "Install_Dir" "$INSTDIR"
45
; Write the uninstall keys for Windows
46
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Enigma" "DisplayName" "Enigma"
47
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Enigma" "UninstallString" '"$INSTDIR\uninstall.exe"'
48
WriteUninstaller "uninstall.exe"
52
Section "Start Menu Shortcuts"
53
CreateDirectory "$SMPROGRAMS\Enigma"
54
CreateShortCut "$SMPROGRAMS\Enigma\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
55
CreateShortCut "$SMPROGRAMS\Enigma\Enigma.lnk" "$INSTDIR\enigma.exe" "" "$INSTDIR\enigma.exe" 0
56
CreateShortCut "$SMPROGRAMS\Enigma\Manual.lnk" "$INSTDIR\manual\index.html" "" "$INSTDIR\manual\index.html" 0
61
UninstallText "This will uninstall Enigma. Hit next to continue."
63
; special uninstall section.
65
; remove registry keys
66
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Enigma"
67
DeleteRegKey HKLM SOFTWARE\Enigma
69
; Delete $INSTDIR\not.exe
70
; MUST REMOVE UNINSTALLER, too
71
;Delete $INSTDIR\uninstall.exe
72
; remove shortcuts, if any.
73
Delete "$SMPROGRAMS\Enigma\*.*"
74
; remove directories used.
75
RMDir "$SMPROGRAMS\Enigma"