Advertisement
Guest User

BetterRepack R7.1 to R8 Updater NSIS

a guest
Jun 26th, 2019
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.68 KB | None | 0 0
  1.  
  2. ;-------------------------------------------------------------------------------------
  3. ; Made by ScrewThisNoise
  4. ;-------------------------------------------------------------------------------------
  5.  
  6. ;-------------------------------------------------------------------------------------
  7. ; Giving NSIS instructions with regards to UI
  8. ;-------------------------------------------------------------------------------------
  9.  
  10. !include "MUI2.nsh"
  11. !include "Sections.nsh"
  12. !include "LogicLib.nsh"
  13. Unicode true
  14. RequestExecutionLevel admin
  15.  
  16. ;-------------------------------------------------------------------------------------
  17. ; General information
  18. ;-------------------------------------------------------------------------------------
  19.  
  20.  
  21. !define OVERSION "R7.1" ;Old Version
  22. !define NVERSION "R8" ;New Version
  23. !define APPLI "BetterRepack" ;Application Name
  24.  
  25. ;Definerer installasjonen
  26. !define NAME "${APPLI} (${OVERSION} to ${NVERSION} update)"
  27. !define FILENAME "${APPLI} (${OVERSION} to ${NVERSION} update).exe"
  28. !define MUI_ICON "files\Graphics\Icon\KKCap.ico"
  29. !define MUI_HEADERIMAGE
  30. !define MUI_HEADERIMAGE_BITMAP "files\Graphics\HeaderImage\header.bmp"
  31. !define MUI_WELCOMEFINISHPAGE_BITMAP "files\Graphics\SideBar\sidebar.bmp"
  32. !define MUI_ABORTWARNING
  33. !define MUI_LANGDLL_ALLLANGUAGES
  34.  
  35.  
  36. InstallDirRegKey HKCU Software\illusion\Koikatu\Koikatu INSTALLDIR
  37.  
  38. Name "${NAME}"
  39. OutFile "files\dist\${FILENAME}"
  40. XPStyle on
  41.  
  42. ;-------------------------------------------------------------------------------------
  43. ; Defining pages
  44. ;-------------------------------------------------------------------------------------
  45.  
  46. !insertmacro MUI_PAGE_WELCOME
  47. ;!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\Modern UI\License.txt"
  48. ;!insertmacro MUI_PAGE_COMPONENTS
  49. !insertmacro MUI_PAGE_DIRECTORY
  50. !insertmacro MUI_PAGE_INSTFILES
  51. !insertmacro MUI_PAGE_FINISH
  52.  
  53. ;-------------------------------------------------------------------------------------
  54. ; Defining language
  55. ;-------------------------------------------------------------------------------------
  56.  
  57. !insertmacro MUI_LANGUAGE "English" ; The first language is the default language
  58. !insertmacro MUI_LANGUAGE "French"
  59. !insertmacro MUI_LANGUAGE "German"
  60. !insertmacro MUI_LANGUAGE "Spanish"
  61. !insertmacro MUI_LANGUAGE "SpanishInternational"
  62. !insertmacro MUI_LANGUAGE "SimpChinese"
  63. !insertmacro MUI_LANGUAGE "TradChinese"
  64. !insertmacro MUI_LANGUAGE "Japanese"
  65. !insertmacro MUI_LANGUAGE "Korean"
  66. !insertmacro MUI_LANGUAGE "Italian"
  67. !insertmacro MUI_LANGUAGE "Dutch"
  68. !insertmacro MUI_LANGUAGE "Danish"
  69. !insertmacro MUI_LANGUAGE "Swedish"
  70. !insertmacro MUI_LANGUAGE "Norwegian"
  71. !insertmacro MUI_LANGUAGE "NorwegianNynorsk"
  72. !insertmacro MUI_LANGUAGE "Finnish"
  73. !insertmacro MUI_LANGUAGE "Greek"
  74. !insertmacro MUI_LANGUAGE "Russian"
  75. !insertmacro MUI_LANGUAGE "Portuguese"
  76. !insertmacro MUI_LANGUAGE "PortugueseBR"
  77. !insertmacro MUI_LANGUAGE "Polish"
  78. !insertmacro MUI_LANGUAGE "Ukrainian"
  79. !insertmacro MUI_LANGUAGE "Czech"
  80. !insertmacro MUI_LANGUAGE "Slovak"
  81. !insertmacro MUI_LANGUAGE "Croatian"
  82. !insertmacro MUI_LANGUAGE "Bulgarian"
  83. !insertmacro MUI_LANGUAGE "Hungarian"
  84. !insertmacro MUI_LANGUAGE "Thai"
  85. !insertmacro MUI_LANGUAGE "Romanian"
  86. !insertmacro MUI_LANGUAGE "Latvian"
  87. !insertmacro MUI_LANGUAGE "Macedonian"
  88. !insertmacro MUI_LANGUAGE "Estonian"
  89. !insertmacro MUI_LANGUAGE "Turkish"
  90. !insertmacro MUI_LANGUAGE "Lithuanian"
  91. !insertmacro MUI_LANGUAGE "Slovenian"
  92. !insertmacro MUI_LANGUAGE "Serbian"
  93. !insertmacro MUI_LANGUAGE "SerbianLatin"
  94. !insertmacro MUI_LANGUAGE "Arabic"
  95. !insertmacro MUI_LANGUAGE "Farsi"
  96. !insertmacro MUI_LANGUAGE "Hebrew"
  97. !insertmacro MUI_LANGUAGE "Indonesian"
  98. !insertmacro MUI_LANGUAGE "Mongolian"
  99. !insertmacro MUI_LANGUAGE "Luxembourgish"
  100. !insertmacro MUI_LANGUAGE "Albanian"
  101. !insertmacro MUI_LANGUAGE "Breton"
  102. !insertmacro MUI_LANGUAGE "Belarusian"
  103. !insertmacro MUI_LANGUAGE "Icelandic"
  104. !insertmacro MUI_LANGUAGE "Malay"
  105. !insertmacro MUI_LANGUAGE "Bosnian"
  106. !insertmacro MUI_LANGUAGE "Kurdish"
  107. !insertmacro MUI_LANGUAGE "Irish"
  108. !insertmacro MUI_LANGUAGE "Uzbek"
  109. !insertmacro MUI_LANGUAGE "Galician"
  110. !insertmacro MUI_LANGUAGE "Afrikaans"
  111. !insertmacro MUI_LANGUAGE "Catalan"
  112. !insertmacro MUI_LANGUAGE "Esperanto"
  113. !insertmacro MUI_LANGUAGE "Asturian"
  114. !insertmacro MUI_LANGUAGE "Basque"
  115. !insertmacro MUI_LANGUAGE "Pashto"
  116. !insertmacro MUI_LANGUAGE "ScotsGaelic"
  117. !insertmacro MUI_LANGUAGE "Georgian"
  118. !insertmacro MUI_LANGUAGE "Vietnamese"
  119. !insertmacro MUI_LANGUAGE "Welsh"
  120. !insertmacro MUI_LANGUAGE "Armenian"
  121. !insertmacro MUI_LANGUAGE "Corsican"
  122. !insertmacro MUI_LANGUAGE "Tatar"
  123. !insertmacro MUI_LANGUAGE "Hindi"
  124.  
  125. ;-------------------------------------------------------------------------------------
  126. ; OnInit config
  127. ;-------------------------------------------------------------------------------------
  128.  
  129. Function .onInit
  130. InitPluginsDir
  131. !insertmacro MUI_LANGDLL_DISPLAY
  132.  
  133. UserInfo::GetAccountType
  134. pop $0
  135. ${If} $0 != "admin" ;Require admin rights on NT4+
  136. MessageBox mb_iconstop "Administrator rights required!"
  137. SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
  138. Quit
  139. ${EndIf}
  140. FunctionEnd
  141.  
  142. ;-------------------------------------------------------------------------------------
  143. ; main installation step
  144. ;-------------------------------------------------------------------------------------
  145.  
  146. Section ""
  147. SetRegView 64
  148. ;does the folder contain what it should?
  149. IfFileExists "$INSTDIR\[BR] Better Repack R7.1.png" +3
  150. MessageBox MB_YESNO|MB_ICONSTOP "Can't find BetterRepack R7.1 files in folder!$\n$\nInstalling this over another Koikatsu installation will lead to problems.$\n$\nDo you still want to continue?" IDYES true IDNO false
  151. false:
  152. Quit
  153. true:
  154.  
  155. ;Playing with files
  156. SetOutPath "$PLUGINSDIR\Install"
  157. File "files\Files\KoikatuR7.1to8\Patcher\*"
  158.  
  159. ;Closing processes
  160. ExecWait '"$SYSDIR\taskkill.exe" /F /IM Koikatu* /T'
  161. ExecWait '"$SYSDIR\taskkill.exe" /F /IM CharaStudio* /T'
  162.  
  163. ;Applying patch
  164. ExecWait '"$PLUGINSDIR\Install\patcher.exe" -O "$INSTDIR" -P "$PLUGINSDIR\Install\KoikatuR7.1to8.zip" -C'
  165.  
  166. ;Mod Settings
  167. MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to set recommended mod settings? (Recommended)" IDYES true2 IDNO false2
  168. true2:
  169. Delete "$INSTDIR\BepInEx\config.ini"
  170. SetOutPath "$INSTDIR\BepInEx\"
  171. File "files\Files\KoikatuR7.1to8\Config\config.ini"
  172. false2:
  173.  
  174. ;Setting folder attribs
  175. Exec '"C:\Windows\System32\attrib.exe" +s $INSTDIR'
  176. Exec '"C:\Windows\System32\attrib.exe" +s $INSTDIR\UserData\cap'
  177. Exec '"C:\Windows\System32\attrib.exe" +s $INSTDIR\UserData\Studio\scene'
  178. Exec '"C:\Windows\System32\attrib.exe" +h $INSTDIR\version'
  179.  
  180.  
  181. SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement