1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
;
; Gargoyle NSIS 2 installer script
;
RequestExecutionLevel admin
!include "MUI.nsh"
Name "Gargoyle"
OutFile "gargoyle-2009-08-25-windows.exe"
InstallDir $PROGRAMFILES\Gargoyle
InstallDirRegKey HKLM "Software\Tor Andersson\Gargoyle\Install" "Directory"
SetCompressor lzma
;
; The installer theme
;
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall.bmp"
;
; Define which pages we want
;
!define MUI_ABORTWARNING
Var SMFOLDER
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Gargoyle"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Tor Andersson\Gargoyle\Install"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu"
; !insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "License.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $SMFOLDER
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
;
; The installation script
;
Section "DoInstall"
SetOutPath $INSTDIR
File "build\dist\*.exe"
File "build\dist\*.dll"
File "licenses\*.txt"
File "garglk\garglk.ini"
WriteUninstaller "uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$SMFOLDER"
CreateShortCut "$SMPROGRAMS\$SMFOLDER\Gargoyle.lnk" "$INSTDIR\gargoyle.exe" "" "$INSTDIR\gargoyle.exe" 0
CreateShortCut "$SMPROGRAMS\Gargoyle\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
!insertmacro MUI_STARTMENU_WRITE_END
; Write the installation path into the registry
WriteRegStr HKLM "Software\Tor Andersson\Gargoyle" "Directory" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gargoyle" "DisplayName" "Gargoyle"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gargoyle" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gargoyle" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gargoyle" "NoRepair" 1
; Associate file types except dat and sna because they're too generic
WriteRegStr HKCR ".l9" "" "Gargoyle.Story"
WriteRegStr HKCR ".t3" "" "Gargoyle.Story"
WriteRegStr HKCR ".z3" "" "Gargoyle.Story"
WriteRegStr HKCR ".z4" "" "Gargoyle.Story"
WriteRegStr HKCR ".z5" "" "Gargoyle.Story"
WriteRegStr HKCR ".z6" "" "Gargoyle.Story"
WriteRegStr HKCR ".z8" "" "Gargoyle.Story"
WriteRegStr HKCR ".taf" "" "Gargoyle.Story"
WriteRegStr HKCR ".agx" "" "Gargoyle.Story"
WriteRegStr HKCR ".acd" "" "Gargoyle.Story"
WriteRegStr HKCR ".a3c" "" "Gargoyle.Story"
WriteRegStr HKCR ".asl" "" "Gargoyle.Story"
WriteRegStr HKCR ".cas" "" "Gargoyle.Story"
WriteRegStr HKCR ".ulx" "" "Gargoyle.Story"
WriteRegStr HKCR ".hex" "" "Gargoyle.Story"
WriteRegStr HKCR ".jacl" "" "Gargoyle.Story"
WriteRegStr HKCR ".j2" "" "Gargoyle.Story"
WriteRegStr HKCR ".gam" "" "Gargoyle.Story"
WriteRegStr HKCR ".mag" "" "Gargoyle.Story"
WriteRegStr HKCR ".blb" "" "Gargoyle.Story"
WriteRegStr HKCR ".glb" "" "Gargoyle.Story"
WriteRegStr HKCR ".zlb" "" "Gargoyle.Story"
WriteRegStr HKCR ".blorb" "" "Gargoyle.Story"
WriteRegStr HKCR ".gblorb" "" "Gargoyle.Story"
WriteRegStr HKCR ".zblorb" "" "Gargoyle.Story"
WriteRegStr HKCR ".d$$$$" "" "Gargoyle.Story"
WriteRegStr HKCR "Gargoyle.Story" "" "Interactive Fiction Story File"
WriteRegStr HKCR "Gargoyle.Story\DefaultIcon" "" "$INSTDIR\gargoyle.exe,1"
WriteRegStr HKCR "Gargoyle.Story\shell" "" "open"
WriteRegStr HKCR "Gargoyle.Story\shell\open" "" "Play"
WriteRegStr HKCR "Gargoyle.Story\shell\open\command" "" "$INSTDIR\gargoyle.exe $\"%1$\""
SectionEnd
;
; The uninstallation script
;
Section "Uninstall"
DeleteRegKey HKCR "Gargoyle.Story"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Gargoyle"
DeleteRegKey HKLM "Software\Tor Andersson\Gargoyle"
Delete $INSTDIR\*.exe
Delete $INSTDIR\*.dll
Delete $INSTDIR\*.txt
; Remove shortcuts, if any
!insertmacro MUI_STARTMENU_GETFOLDER Application $R0
Delete "$SMPROGRAMS\$R0\*.*"
RMDir "$SMPROGRAMS\Gargoyle"
RMDir "$INSTDIR"
SectionEnd
|