2
0

Installer.nsi 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. ; FreeOberon.nsi
  2. ;
  3. ; This script is based on example1.nsi, but it remember the directory,
  4. ; has uninstall support and (optionally) installs start menu shortcuts.
  5. ;
  6. ; It will install FreeOberon.nsi into a directory that the user selects,
  7. ;--------------------------------
  8. ; The name of the installer
  9. Name "FreeOberon"
  10. ;!include "MUI.nsh"
  11. ;!define MUI_ICON "FreeOberon\Data\Images\Icon.ico"
  12. ; The file to write
  13. OutFile "FreeOberon_Setup_v1.1.0_alpha.exe"
  14. ; The default installation directory
  15. InstallDir C:\FreeOberon
  16. ; Registry key to check for directory (so if you install again, it will
  17. ; overwrite the old one automatically)
  18. InstallDirRegKey HKLM "Software\FreeOberon" "Install_Dir"
  19. ; Request application privileges for Windows Vista
  20. RequestExecutionLevel admin
  21. ;--------------------------------
  22. ; Pages
  23. Page components
  24. Page directory
  25. Page instfiles
  26. UninstPage uninstConfirm
  27. UninstPage instfiles
  28. ;--------------------------------
  29. ; The stuff to install
  30. Section "FreeOberon (required)"
  31. SectionIn RO
  32. ; Set output path to the installation directory
  33. SetOutPath $INSTDIR
  34. ; Files to install
  35. File /r "C:\FreeOberon\*"
  36. ; Write the installation path into the registry
  37. WriteRegStr HKLM SOFTWARE\NSIS_FreeOberon "Install_Dir" "$INSTDIR"
  38. ; Write the uninstall keys for Windows
  39. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FreeOberon" "DisplayName" "NSIS FreeOberon"
  40. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FreeOberon" "UninstallString" '"$INSTDIR\uninstall.exe"'
  41. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FreeOberon" "NoModify" 1
  42. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FreeOberon" "NoRepair" 1
  43. WriteUninstaller "uninstall.exe"
  44. SectionEnd
  45. ; Optional section (can be disabled by the user)
  46. Section "Start Menu Shortcuts"
  47. CreateDirectory "$SMPROGRAMS\FreeOberon"
  48. CreateShortcut "$SMPROGRAMS\FreeOberon\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
  49. CreateShortcut "$SMPROGRAMS\FreeOberon\FreeOberon.lnk" "$INSTDIR\FreeOberon.exe" "" "$INSTDIR\FreeOberon.exe" 0
  50. SectionEnd
  51. ; Optional section (can be disabled by the user)
  52. Section "Desktop Shortcut"
  53. CreateShortcut "$DESKTOP\Free Oberon.lnk" "$INSTDIR\FreeOberon.exe"
  54. SectionEnd
  55. ;--------------------------------
  56. ; Uninstaller
  57. Section "Uninstall"
  58. ; Remove registry keys
  59. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\FreeOberon"
  60. DeleteRegKey HKLM SOFTWARE\NSIS_FreeOberon
  61. ; Remove files and uninstaller
  62. Delete $INSTDIR\FreeOberon.exe
  63. Delete $INSTDIR\uninstall.exe
  64. Delete $INSTDIR\LICENSE
  65. Delete $INSTDIR\README.md
  66. Delete $INSTDIR\libjpeg-9.dll
  67. Delete $INSTDIR\libpng16-16.dll
  68. Delete $INSTDIR\SDL2.dll
  69. Delete $INSTDIR\SDL2_image.dll
  70. Delete $INSTDIR\zlib1.dll
  71. Delete $INSTDIR\Programs\BlitBmp.Mod
  72. Delete $INSTDIR\Programs\BlitBmp2.Mod
  73. Delete $INSTDIR\Programs\Book.Mod
  74. Delete $INSTDIR\Programs\GEVM.Mod
  75. Delete $INSTDIR\Programs\Gradient24.Mod
  76. Delete $INSTDIR\Programs\Gui.Mod
  77. Delete $INSTDIR\Programs\Mandelbrot.Mod
  78. Delete $INSTDIR\Programs\Mandelbrot2.Mod
  79. Delete $INSTDIR\Programs\r.Mod
  80. Delete "$DESKTOP\Free Oberon.lnk"
  81. ; Remove Free Oberon subdirectories
  82. RMDir /r /REBOOTOK $INSTDIR\bin
  83. RMDir /r /REBOOTOK $INSTDIR\Data
  84. RMDir /r /REBOOTOK $INSTDIR\src
  85. RMDir /r /REBOOTOK $INSTDIR\Programs
  86. ; Remove shortcuts, if any
  87. Delete "$SMPROGRAMS\FreeOberon\*.*"
  88. ; Remove directories used
  89. RMDir "$SMPROGRAMS\FreeOberon"
  90. RMDir /REBOOTOK "$INSTDIR"
  91. SectionEnd