OpenSim.nsi 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. !include "MUI.nsh"
  2. Name "OpenSim"
  3. OutFile "OpenSim Setup 0.5.exe"
  4. CRCCheck On
  5. InstallDir "$PROGRAMFILES\OpenSim"
  6. InstallDirRegKey HKCU "Software\OpenSim" ""
  7. ;Vista redirects $SMPROGRAMS to all users without this
  8. RequestExecutionLevel admin
  9. Var MUI_TEMP
  10. Var STARTMENU_FOLDER
  11. !define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
  12. !define MUI_LANGDLL_REGISTRY_KEY "Software\OpenSim"
  13. !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
  14. !define MUI_ABORTWARNING
  15. !insertmacro MUI_PAGE_WELCOME
  16. !insertmacro MUI_PAGE_LICENSE "LICENSE.txt"
  17. !insertmacro MUI_PAGE_DIRECTORY
  18. !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"
  19. !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\OpenSim"
  20. !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
  21. !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
  22. !insertmacro MUI_PAGE_INSTFILES
  23. !insertmacro MUI_PAGE_FINISH
  24. !insertmacro MUI_UNPAGE_WELCOME
  25. !insertmacro MUI_UNPAGE_CONFIRM
  26. !insertmacro MUI_UNPAGE_INSTFILES
  27. !insertmacro MUI_UNPAGE_FINISH
  28. !insertmacro MUI_LANGUAGE "English"
  29. !insertmacro MUI_LANGUAGE "French"
  30. !insertmacro MUI_LANGUAGE "German"
  31. !insertmacro MUI_LANGUAGE "Spanish"
  32. !insertmacro MUI_LANGUAGE "SpanishInternational"
  33. !insertmacro MUI_LANGUAGE "SimpChinese"
  34. !insertmacro MUI_LANGUAGE "TradChinese"
  35. !insertmacro MUI_LANGUAGE "Japanese"
  36. !insertmacro MUI_LANGUAGE "Korean"
  37. !insertmacro MUI_LANGUAGE "Italian"
  38. !insertmacro MUI_LANGUAGE "Dutch"
  39. !insertmacro MUI_LANGUAGE "Danish"
  40. !insertmacro MUI_LANGUAGE "Swedish"
  41. !insertmacro MUI_LANGUAGE "Norwegian"
  42. !insertmacro MUI_LANGUAGE "NorwegianNynorsk"
  43. !insertmacro MUI_LANGUAGE "Finnish"
  44. !insertmacro MUI_LANGUAGE "Greek"
  45. !insertmacro MUI_LANGUAGE "Russian"
  46. !insertmacro MUI_LANGUAGE "Portuguese"
  47. !insertmacro MUI_LANGUAGE "PortugueseBR"
  48. !insertmacro MUI_LANGUAGE "Polish"
  49. !insertmacro MUI_LANGUAGE "Ukrainian"
  50. !insertmacro MUI_LANGUAGE "Czech"
  51. !insertmacro MUI_LANGUAGE "Slovak"
  52. !insertmacro MUI_LANGUAGE "Croatian"
  53. !insertmacro MUI_LANGUAGE "Bulgarian"
  54. !insertmacro MUI_LANGUAGE "Hungarian"
  55. !insertmacro MUI_LANGUAGE "Thai"
  56. !insertmacro MUI_LANGUAGE "Romanian"
  57. !insertmacro MUI_LANGUAGE "Latvian"
  58. !insertmacro MUI_LANGUAGE "Macedonian"
  59. !insertmacro MUI_LANGUAGE "Estonian"
  60. !insertmacro MUI_LANGUAGE "Turkish"
  61. !insertmacro MUI_LANGUAGE "Lithuanian"
  62. !insertmacro MUI_LANGUAGE "Slovenian"
  63. !insertmacro MUI_LANGUAGE "Serbian"
  64. !insertmacro MUI_LANGUAGE "SerbianLatin"
  65. !insertmacro MUI_LANGUAGE "Arabic"
  66. !insertmacro MUI_LANGUAGE "Farsi"
  67. !insertmacro MUI_LANGUAGE "Hebrew"
  68. !insertmacro MUI_LANGUAGE "Indonesian"
  69. !insertmacro MUI_LANGUAGE "Mongolian"
  70. !insertmacro MUI_LANGUAGE "Luxembourgish"
  71. !insertmacro MUI_LANGUAGE "Albanian"
  72. !insertmacro MUI_LANGUAGE "Breton"
  73. !insertmacro MUI_LANGUAGE "Belarusian"
  74. !insertmacro MUI_LANGUAGE "Icelandic"
  75. !insertmacro MUI_LANGUAGE "Malay"
  76. !insertmacro MUI_LANGUAGE "Bosnian"
  77. !insertmacro MUI_LANGUAGE "Kurdish"
  78. !insertmacro MUI_LANGUAGE "Irish"
  79. !insertmacro MUI_LANGUAGE "Uzbek"
  80. !insertmacro MUI_LANGUAGE "Galician"
  81. !insertmacro MUI_LANGUAGE "Afrikaans"
  82. !insertmacro MUI_LANGUAGE "Catalan"
  83. !insertmacro MUI_RESERVEFILE_LANGDLL
  84. Section "Install"
  85. SetOutPath "$INSTDIR"
  86. SetCompress Auto
  87. SetOverwrite IfNewer
  88. File /r "bin\*.*"
  89. WriteRegStr HKCU "Software\OpenSim" "" $INSTDIR
  90. WriteUninstaller "$INSTDIR\Uninstall.exe"
  91. !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  92. CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
  93. CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\OpenSim.lnk" "$INSTDIR\OpenSim.exe"
  94. CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
  95. !insertmacro MUI_STARTMENU_WRITE_END
  96. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenSim" "DisplayName" "OpenSim (remove only)"
  97. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenSim" "UninstallString" "$INSTDIR\Uninstall.exe"
  98. SectionEnd
  99. Function .onInit
  100. !insertmacro MUI_LANGDLL_DISPLAY
  101. FunctionEnd
  102. Section "Uninstall"
  103. Delete "$INSTDIR\*.*"
  104. RMDir /r "$INSTDIR"
  105. !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
  106. Delete "$SMPROGRAMS\$MUI_TEMP\OpenSim.lnk"
  107. Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
  108. ;Delete empty start menu parent diretories
  109. StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP"
  110. startMenuDeleteLoop:
  111. ClearErrors
  112. RMDir $MUI_TEMP
  113. GetFullPathName $MUI_TEMP "$MUI_TEMP\.."
  114. IfErrors startMenuDeleteLoopDone
  115. StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop
  116. startMenuDeleteLoopDone:
  117. DeleteRegKey /ifempty HKCU "Software\OpenSim"
  118. DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenSim"
  119. SectionEnd
  120. Function un.onInit
  121. !insertmacro MUI_UNGETLANGUAGE
  122. FunctionEnd