Menu

[b84aab]: / src / platform / fltk / sbasic.nsi  Maximize  Restore  History

Download this file

124 lines (96 with data), 3.6 kB

  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
;
; FLTK windows NSIS installer script
;
;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
;--------------------------------
;General
;Name and file
Name "SmallBASIC"
OutFile "sbasic_0.11.5.exe"
;Default installation folder
InstallDir "$PROGRAMFILES\SBW32\FLTK_0.11.5"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\SmallBASIC\FLTK_0.11.5" ""
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE "..\..\..\documentation\LICENSE"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
RequestExecutionLevel admin
; Optional section (can be disabled by the user)
Section "Start Menu Shortcut"
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\SmallBASIC 0.11.5"
SetOutPath $INSTDIR
CreateShortCut "$SMPROGRAMS\SmallBASIC 0.11.5\SmallBASIC.lnk" "$INSTDIR\sbasici.exe"
CreateShortCut "$SMPROGRAMS\SmallBASIC 0.11.5\Sokoban.lnk" "$INSTDIR\games\sokoban.bas"
CreateShortCut "$SMPROGRAMS\SmallBASIC 0.11.5\Tetris.lnk" "$INSTDIR\games\tetris.bas"
CreateShortCut "$SMPROGRAMS\SmallBASIC 0.11.5\Calculator.lnk" "$INSTDIR\apps\calc.bas"
CreateShortCut "$SMPROGRAMS\SmallBASIC 0.11.5\Uninstall.lnk" "$INSTDIR\uninstall.exe"
SectionEnd
Section "Quick Launch Shortcut"
SetOutPath $INSTDIR
CreateShortCut "$QUICKLAUNCH\SmallBASIC.lnk" "$INSTDIR\sbasici.exe" "" "$INSTDIR\sbasici.exe" 0
SectionEnd
Section "Desktop Shortcut"
SetOutPath $INSTDIR
CreateShortCut "$DESKTOP\SmallBASIC.lnk" "$INSTDIR\sbasici.exe" "" "$INSTDIR\sbasici.exe" 0
SectionEnd
Section "Create .BAS file association"
WriteRegStr HKCR ".bas" "" "SmallBASIC"
WriteRegStr HKCR "SmallBASIC" "" "SmallBASIC"
WriteRegStr HKCR "SmallBASIC\DefaultIcon" "" "$INSTDIR\sbasici.exe,0"
WriteRegStr HKCR "SmallBASIC\shell" "" "open"
WriteRegStr HKCR "SmallBASIC\shell\open\command" "" '"$INSTDIR\sbasici.exe" -e "%1"'
WriteRegStr HKCR "SmallBASIC\shell" "" "run"
WriteRegStr HKCR "SmallBASIC\shell\run\command" "" '"$INSTDIR\sbasici.exe" -r "%1"'
SectionEnd
Section "SmallBASIC" SecMain
SetOutPath "$INSTDIR"
File sbasici.exe
File ..\..\..\documentation\sbasic_ref.csv
File /r ..\..\..\samples\distro-examples\*.bas
SetOutPath "$INSTDIR\games"
File ..\..\..\samples\distro-examples\games\sokoban.levels
SetOutPath $INSTDIR\plugins
File "..\..\..\plugins\*.*"
;Store installation folder
WriteRegStr HKCU "Software\SmallBASIC\FLTK_0.11.5" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd
;--------------------------------
;Descriptions
;Language strings
LangString DESC_SecMain ${LANG_ENGLISH} "Program executable."
;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecMain} $(DESC_SecMain)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------
;Uninstaller Section
Section "Uninstall"
SetShellVarContext all
; Remove registry keys
DeleteRegKey /ifempty HKCU "Software\SmallBASIC\FLTK_0.11.5"
; Remove shortcuts, if any
Delete "$SMPROGRAMS\SmallBASIC 0.11.5\*.*"
Delete "$QUICKLAUNCH\SmallBASIC.lnk"
Delete "$DESKTOP\SmallBASIC.lnk"
; Remove directories used
RMDir "$SMPROGRAMS\SmallBASIC 0.11.5"
RMDir /r "$INSTDIR"
SectionEnd
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.