Advertisement
n7siha

ThaneMOD v1.0E Script

Apr 1st, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;ThaneMOD v1.0E NSIS Script
  2. ; Note -- This is the very first scripting any of us had done. It likely means there are better ways to do certain things, certain jargon that is commented out might be incorrect, etc. While this installer script is somewhat lengthy, it's actually relatively simple. It does, however, include many different features that are difficult to find present in a single script, so we hope you find it useful.
  3.  
  4. ;============================================================================
  5. ; DEFINITIONS -- adding these allows you to use them as "shortcuts" later on
  6.  
  7. !define PRODUCT_NAME "ThaneMOD"
  8. !define PRODUCT_VERSION "1.0E"
  9. !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
  10. !define PRODUCT_UNINST_ROOT_KEY "HKLM"
  11.  
  12. ;=============================================================================
  13. ; HEADER FILES -- add various functionalities to your installer; these .nsh files must be in your NSIS directory
  14.  
  15. ; Modern User Interface (MUI) -- Allows use of the "typical" Windows installer interface most people are familiar with
  16. !include "MUI.nsh"
  17.  
  18. ; InstallOptions -- Allows for creation of Custom Pages
  19. !include "InstallOptions.nsh"
  20.  
  21. ; Logic Library -- Allows If/Then/Else functionality
  22. !include "LogicLib.nsh"
  23.  
  24. ;===============================================================================
  25. ; MUI CONFIG -- sets up the appearance of each page of the installer via MUI definitions; relative paths ("..\graphics_docs\icon_v1.ico") should always be used
  26.  
  27. !define MUI_ABORTWARNING
  28. !define MUI_HEADERIMAGE
  29. !define MUI_WELCOMEPAGE_TITLE_3LINES
  30. !define MUI_ICON "..\graphics_docs\icon_v1.ico"
  31. !define MUI_UNICON "..\graphics_docs\icon_v1.ico"
  32. !define MUI_HEADERIMAGE_BITMAP "..\graphics_docs\header_v1.bmp"
  33. !define MUI_HEADERIMAGE_UNBITMAP "..\graphics_docs\header_v1.bmp"
  34. !define MUI_WELCOMEFINISHPAGE_BITMAP "..\graphics_docs\welcomefinish_v1.bmp"
  35. !define MUI_UNWELCOMEFINISHPAGE_BITMAP "..\graphics_docs\welcomefinish_v1.bmp"
  36. !define MUI_WELCOMEPAGE_TITLE "Welcome to the ThaneMOD v1.0E Install Wizard!"
  37. !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ThaneMOD.\r\n\r\nBefore proceeding, please open the Install Guide that came with your download. ThaneMOD is not difficult to install, but process has multiple steps and the procedure will vary by version and user.\r\n\r\nPay special attention to the information on the following pages. It contains important details you should know PRIOR to installing the mod.\r\n\r\nPlease click Next to continue."
  38. !define MUI_DIRECTORYPAGE_TEXT_TOP "Please verify the installer has correctly detected your Mass Effect 3 installation folder. If the location below is incorrect, please change it manually. Click Install when ready."
  39. !define MUI_LICENSEPAGE_TEXT_TOP  "Please scroll down to read the entire agreement."
  40. !define MUI_LICENSEPAGE_CHECKBOX_TEXT "WAIT! Have you read the information above? If not, Thane disapproves. Boo."
  41. !define MUI_COMPONENTSPAGE_TEXT_TOP "ThaneMOD v1.0E contains the components listed below. See the Install Guide and website for more detailed information. Click Next when finished."
  42. !define MUI_COMPONENTSPAGE_TEXT_COMPLIST "Select components to install. Gray items are required. See the adjacent Descriptions for more details."
  43. !define MUI_FINISHPAGE_TITLE "Installation Successful!"
  44. !define MUI_FINISHPAGE_TEXT "You have now completed PART 2 in the ThaneMOD v1.0E installation process.\r\n\r\nRefer to the Install Guide for your next step. Click Finish to close this window."
  45. !define MUI_FINISHPAGE_SHOWREADME_TEXT "Important -- you aren't done yet! View Readme PDF."
  46.  
  47. ;============================================================================================
  48. ; OTHER
  49.  
  50. BrandingText "ThaneMOD Installer v1.0E"
  51. ;the above re-defines the standard "NullSoft Install System" that appears toward the bottom left of the installer window, to whatever you specify
  52.  
  53. ;============================================================================================
  54. ; PAGES -- all pages for your installer must be listed here, in the order that you want them to appear; included are two custom pages
  55.  
  56. !insertmacro MUI_PAGE_WELCOME
  57. Page custom TexturesPage
  58. !define MUI_LICENSEPAGE_CHECKBOX
  59. !insertmacro MUI_PAGE_LICENSE "..\graphics_docs\license_agreement_v1.rtf"
  60. !insertmacro MUI_PAGE_COMPONENTS
  61. !insertmacro MUI_PAGE_DIRECTORY
  62. !insertmacro MUI_PAGE_INSTFILES
  63. Page custom CreditsPage
  64. !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\START_HERE_ThaneMOD_Install_Guide.pdf"
  65. !insertmacro MUI_UNPAGE_WELCOME
  66. !insertmacro MUI_UNPAGE_CONFIRM
  67. !insertmacro MUI_PAGE_FINISH
  68. !insertmacro MUI_UNPAGE_INSTFILES
  69.  
  70. ;==============================================================================
  71. ; LANGUAGES -- self explanatory
  72.  
  73. !insertmacro MUI_LANGUAGE "English"
  74.  
  75. ;==============================================================================
  76. ; DESCRIPTIONS -- this section is necessary if you are including custom pages
  77.  
  78. ; Language Strings
  79. LangString TEXTURESPAGE_TITLE ${LANG_ENGLISH} "Important Notice Below"
  80. LangString TEXTURESPAGE_SUBTITLE ${LANG_ENGLISH} "Please read and respond accordingly before continuing with installation of ThaneMOD."
  81. LangString CREDITSPAGE_TITLE ${LANG_ENGLISH} "Credits"
  82. LangString CREDITSPAGE_SUBTITLE ${LANG_ENGLISH} "ThaneMOD v1.0 is brought to you by the people below."
  83.  
  84. ;==============================================================================
  85. ; PAGE FUNCTIONS -- different functions associated with custom pages
  86.  
  87. ; Textures Page Settings -- Function below allows for display of the "stop sign" image, page title and subtitle, and specifies an ini file that contains the text, image, and their layout. You'll need a program like HM NIS Edit to do something like this.
  88. Function TexturesPage
  89.   InitPluginsDir
  90.   File "/oname=$PLUGINSDIR\stop.bmp" "..\graphics_docs\stop.bmp"
  91.  
  92.   ReserveFile "..\Installer Testing\textures.ini"
  93.   !insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "..\Installer Testing\textures.ini" "textures"
  94.   !insertmacro MUI_HEADER_TEXT $(TEXTURESPAGE_TITLE) $(TEXTURESPAGE_SUBTITLE)
  95.   !insertmacro MUI_INSTALLOPTIONS_WRITE "textures" "Field 1" "Text" "$PLUGINSDIR\stop.bmp"
  96.   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "textures"
  97. FunctionEnd
  98.  
  99. ; Credits Page Settings -- function set up very similar to the above, but does not include an image
  100. Function CreditsPage
  101.   ReserveFile "..\Installer Testing\credits.ini"
  102.   !insertmacro MUI_INSTALLOPTIONS_EXTRACT_AS "..\Installer Testing\credits.ini" "credits"
  103.   !insertmacro MUI_HEADER_TEXT $(CREDITSPAGE_TITLE) $(CREDITSPAGE_SUBTITLE)
  104.   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "credits"
  105. FunctionEnd
  106.  
  107. ;======================================================================================
  108. ; INSTALLATION PARAMETERS -- This is where are the files for installation are specified and the file name of the installer. It also includes scripting to back up original files. Note: ME3Exp uses a .bak extension when backing up files (.sfars, for example); MEHEM and Citadel Epilogue mod use a .bup extension; ThaneMOD uses a .bu2 extension. Files are written to several different subdirectories, all within the InstallDir (these are the ThaneMOD "modules"). Files are divided up into different Sections that appear as separate checkboxes in the installer GUI. "SectionIn RO" means it is checked by default and cannot be unchecked by the user. The registry key for ME3 is included to help the installer detect the directory it is installed to on the user's system.
  109.  
  110. Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
  111. OutFile "ThaneMOD_v1E.exe"
  112. InstallDir "$PROGRAMFILES\Origin Games\Mass Effect 3"
  113. InstallDirRegKey HKLM "Software\BioWare\Mass Effect 3" "Install Dir"
  114. ShowInstDetails show
  115. ShowUnInstDetails show
  116.  
  117. Section "Enhanced Core Module for MEHEM" SEC01
  118.   SectionIn RO
  119.   SetOutPath "$INSTDIR\BIOGame\CookedPCConsole"
  120.   SetOverwrite on
  121.  
  122.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\Conditionals.cnd" 0 +2
  123.         Rename "$INSTDIR\BIOGame\CookedPCConsole\Conditionals.cnd" "$INSTDIR\BIOGame\CookedPCConsole\Conditionals.cnd.bu2"
  124.   File "Conditionals.cnd"
  125.  
  126.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_204Kro002_Debrief3_LOC_INT.pcc" 0 +2
  127.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_204Kro002_Debrief3_LOC_INT.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_204Kro002_Debrief3_LOC_INT.pcc.bu2"
  128.   File "BioD_Nor_204Kro002_Debrief3_LOC_INT.pcc"
  129.  
  130.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_Miranda.pcc" 0 +2
  131.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_Miranda.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_Miranda.pcc.bu2"
  132.   File "BioD_CitHub_Miranda.pcc"
  133.  
  134.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_WardsFluxP3.pcc" 0 +2
  135.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_WardsFluxP3.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_WardsFluxP3.pcc.bu2"
  136.   File "BioD_CitHub_WardsFluxP3.pcc"
  137.  
  138.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP3.pcc" 0 +2
  139.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP3.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP3.pcc.bu2"
  140.   File "BioD_CitHub_HospitalP3.pcc"
  141.  
  142.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos_LOC_INT.pcc" 0 +2
  143.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos_LOC_INT.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos_LOC_INT.pcc.bu2"
  144.   File "BioD_Cat003_380DesksConvos_LOC_INT.pcc"
  145.  
  146.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos.pcc" 0 +2
  147.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos.pcc.bu2"
  148.   File "BioD_Cat003_380DesksConvos.pcc"
  149.  
  150.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_180DocksCop_LOC_INT.pcc" 0 +2
  151.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_180DocksCop_LOC_INT.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_180DocksCop_LOC_INT.pcc.bu2"
  152.   File "BioD_Cat003_180DocksCop_LOC_INT.pcc"
  153.  
  154.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_000LevelTrans_LOC_INT.pcc" 0 +2
  155.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_000LevelTrans_LOC_INT.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_000LevelTrans_LOC_INT.pcc.bu2"
  156.   File "BioD_Cat003_000LevelTrans_LOC_INT.pcc"
  157.  
  158.   SetOutPath "$INSTDIR\Binaries\Win32"
  159.  
  160.   IfFileExists "$INSTDIR\Binaries\Win32\binkw32.dll" 0 +2
  161.         Rename "$INSTDIR\Binaries\Win32\binkw32.dll" "$INSTDIR\Binaries\Win32\binkw32.dll.bu2"
  162.   File "binkw32.dll"
  163.  
  164.   IfFileExists "$INSTDIR\Binaries\Win32\binkw23.dll" 0 +2
  165.         Rename "$INSTDIR\Binaries\Win32\binkw23.dll" "$INSTDIR\Binaries\Win32\binkw23.dll.bu2"
  166.   File "binkw23.dll"
  167.  
  168. SectionEnd
  169.  
  170. Section "EWAC Module" SEC02
  171. SetOutPath "$INSTDIR\BIOGame\CookedPCConsole"
  172.   SectionIn RO
  173.  
  174.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor.pcc" 0 +2
  175.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor.pcc.bu2"
  176.   File "BioD_Nor.pcc"
  177.  
  178.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2.pcc" 0 +2
  179.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2.pcc.bu2"
  180.   File "BioD_CitHub_HospitalP2.pcc"
  181.  
  182.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\Coalesced.bin" 0 +2
  183.         Rename "$INSTDIR\BIOGame\CookedPCConsole\Coalesced.bin" "$INSTDIR\BIOGame\CookedPCConsole\Coalesced.bin.bu2"
  184.   File "Coalesced.bin"
  185.  
  186.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_Codex_1.pcc" 0 +2
  187.         Rename "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_Codex_1.pcc" "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_Codex_1.pcc.bu2"
  188.   File "SFXImages_Codex_1.pcc"
  189.  
  190.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\SFXGameInfoSP_SF.pcc" 0 +2
  191.         Rename "$INSTDIR\BIOGame\CookedPCConsole\SFXGameInfoSP_SF.pcc" "$INSTDIR\BIOGame\CookedPCConsole\SFXGameInfoSP_SF.pcc.bu2"
  192.   File "SFXGameInfoSP_SF.pcc"
  193.  
  194.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_GameManual_10.pcc" 0 +2
  195.         Rename "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_GameManual_10.pcc" "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_GameManual_10.pcc.bu2"
  196.   File "SFXImages_GameManual_10.pcc"
  197.  
  198. SectionEnd
  199.  
  200. Section "Romance Improvements" SEC03
  201. SetOutPath "$INSTDIR\BIOGame\CookedPCConsole"
  202.   SectionIn RO
  203.  
  204.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2_LOC_INT.pcc" 0 +2
  205.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2_LOC_INT.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2_LOC_INT.pcc.bu2"
  206.   File "BioD_CitHub_HospitalP2_LOC_INT.pcc"
  207.  
  208.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BIOGame_INT.tlk" 0 +2
  209.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BIOGame_INT.tlk" "$INSTDIR\BIOGame\CookedPCConsole\BIOGame_INT.tlk.bu2"
  210.   File "BIOGame_INT.tlk"
  211.  
  212.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_tha_inv_d_d_Int.afc" 0 +2
  213.         Rename "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_tha_inv_d_d_Int.afc" "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_tha_inv_d_d_Int.afc.bu2"
  214.   File "citprs_hosp_tha_inv_d_d_Int.afc"
  215.  
  216.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_thane_d_d_Int.afc" 0 +2
  217.         Rename "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_thane_d_d_Int.afc" "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_thane_d_d_Int.afc.bu2"
  218.   File "citprs_hosp_thane_d_d_Int.afc"
  219.  
  220.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_James_LOC_INT.pcc" 0 +2
  221.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_James_LOC_INT.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_James_LOC_INT.pcc.bu2"
  222.   File "BioD_CitHub_James_LOC_INT.pcc"
  223.  
  224.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_510CargoConv_LOC_INT.pcc" 0 +2
  225.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_510CargoConv_LOC_INT.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_510CargoConv_LOC_INT.pcc.bu2"
  226.   File "BioD_Nor_510CargoConv_LOC_INT.pcc"
  227.  
  228.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_100Cabin.pcc" 0 +2
  229.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_100Cabin.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_100Cabin.pcc.bu2"
  230.   File "BioD_Nor_100Cabin.pcc"
  231.  
  232. SectionEnd
  233.  
  234. Section "Huerta Music Module" SEC04
  235. SetOutPath "$INSTDIR\BIOGame\CookedPCConsole"
  236.   SectionIn RO
  237.  
  238.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioSnd_CitHub.pcc" 0 +2
  239.         Rename "$INSTDIR\BIOGame\CookedPCConsole\BioSnd_CitHub.pcc" "$INSTDIR\BIOGame\CookedPCConsole\BioSnd_CitHub.pcc.bu2"
  240.   File "BioSnd_CitHub.pcc"
  241.  
  242.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\Wwise_CitHub_Streaming.afc" 0 +2
  243.         Rename "$INSTDIR\BIOGame\CookedPCConsole\Wwise_CitHub_Streaming.afc" "$INSTDIR\BIOGame\CookedPCConsole\Wwise_CitHub_Streaming.afc.bu2"
  244.   File "Wwise_CitHub_Streaming.afc"
  245.  
  246. SectionEnd
  247.  
  248. Section "Readme" SEC05
  249.   SectionIn RO
  250.   SetOutPath "$INSTDIR"
  251.   File "START_HERE_ThaneMOD_Install_Guide.pdf"
  252. SectionEnd
  253.  
  254. Section "50+ Saves" SEC06
  255.   SetOutPath "$INSTDIR\BIOGame\CookedPCConsole"
  256.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\SFXGame.pcc" 0 +2
  257.         Rename "$INSTDIR\BIOGame\CookedPCConsole\SFXGame.pcc" "$INSTDIR\BIOGame\CookedPCConsole\SFXGame.pcc.bu2"
  258.   File "SFXGame.pcc"
  259. SectionEnd
  260.  
  261. ;======================================================================================
  262. ; REGISTRY -- Write to registry upon installation and create an uninstaller. The defined registry entry (back up top) causes the mod to appear in the list of installed programs (viewed via the Control Panel), which allows the user to easily see if it is installed.
  263.  
  264. Section -Post
  265.   WriteUninstaller "$INSTDIR\UNinstall_ThaneMOD_v1E_doNOTdeleteORemove.exe"
  266.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  267.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\UNinstall_ThaneMOD_v1E_doNOTdeleteORemove.exe"
  268.   WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  269. SectionEnd
  270.  
  271. ;======================================================================================
  272. ; INSTALLER SECTION DESCRIPTIONS -- defines the rollover text that appears when the section names are moused over in the installer GUI
  273.  
  274. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  275.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Requires: ME3 EC DLC, MEHEM, and EWAC. Thane is not present for the coup and returns in the epilogue -- including the Memorial Scene, if the LI. New Credits music option in DLC Patch."
  276.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Required. Thane's disease is treated in a lore-centric manner and his romance expanded. Five emails are sent from Thane to an LI-Shep during the game, each vary with plot decisions. New war assets and codex entry."
  277.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Required. Completely revamped and repeatable Huerta Dialogue for LI Thane. Cabin photo. Romance now locks in, locking out other LIs. Flirting with other LIs removed. Paramour in next release."
  278.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Required. Huerta conversation plays with ME2 romance music in the background."
  279.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} "Required. The ThaneMOD Install Guide...you should already have this open!"
  280.   !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} "Optional. Allows the player to have over 50 saves in a playthrough."
  281. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  282.  
  283. ;======================================================================================
  284. ; INSTALL/UNINSTALL FUNCTIONS -- specific functions that execute upon running the installer or uninstaller
  285.  
  286. ;Creates a pop up window after successful uninstallation of the mod
  287. Function un.onUninstSuccess
  288.   HideWindow
  289.   MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
  290. FunctionEnd
  291.  
  292. ;Checks the registry for previous installation of mod and will deny repeat installation to prevent a borked install. Careful with versions, here.
  293. Function .onInit
  294.   ClearErrors
  295.   ReadRegStr $R0 ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName"
  296.   ${IfNot} ${Errors}
  297.     MessageBox MB_OK|MB_ICONEXCLAMATION "ThaneMOD is already installed. Please uninstall before installing a new version."
  298.     Abort
  299.   ${EndIf}
  300. FunctionEnd
  301.  
  302. ;======================================================================================
  303. ; UNINSTALLATION PARAMETERS -- All in one section, unlike the install. Each file is again listed. Files are deleted only if they exist. Backups are restored upon deletion, and registry key is removed. Uninstaller is deleted after completion.
  304.  
  305. Section Uninstall
  306.  
  307.   IfFileExists "$INSTDIR\UNinstall_ThaneMOD_v1E_doNOTdeleteORemove.exe" 0 +2
  308.   Delete "$INSTDIR\UNinstall_ThaneMOD_v1E_doNOTdeleteORemove.exe"
  309.  
  310.   IfFileExists "$INSTDIR\START_HERE_ThaneMOD_Install_Guide.pdf" 0 +2
  311.   Delete "$INSTDIR\START_HERE_ThaneMOD_Install_Guide.pdf"
  312.  
  313.   IfFileExists "$INSTDIR\Binaries\Win32\binkw32.dll.bu2" 0 +2
  314.   Delete "$INSTDIR\Binaries\Win32\binkw32.dll"
  315.   Rename "$INSTDIR\Binaries\Win32\binkw32.dll.bu2" "$INSTDIR\Binaries\Win32\binkw32.dll"
  316.  
  317.   IfFileExists "$INSTDIR\Binaries\Win32\binkw23.dll" 0 +2
  318.   Delete "$INSTDIR\Binaries\Win32\binkw23.dll"
  319.  
  320.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2_LOC_INT.pcc.bu2" 0 +2
  321.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2_LOC_INT.pcc"
  322.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2_LOC_INT.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2_LOC_INT.pcc"
  323.  
  324.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2.pcc.bu2" 0 +2
  325.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2.pcc"
  326.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP2.pcc"
  327.  
  328.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\SFXGameInfoSP_SF.pcc.bu2" 0 +2
  329.   Delete "$INSTDIR\BIOGame\CookedPCConsole\SFXGameInfoSP_SF.pcc"
  330.   Rename "$INSTDIR\BIOGame\CookedPCConsole\SFXGameInfoSP_SF.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\SFXGameInfoSP_SF.pcc"
  331.  
  332.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_Codex_1.pcc.bu2" 0 +2
  333.   Delete "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_Codex_1.pcc"
  334.   Rename "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_Codex_1.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_Codex_1.pcc"
  335.  
  336.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_GameManual_10.pcc.bu2" 0 +2
  337.   Delete "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_GameManual_10.pcc"
  338.   Rename "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_GameManual_10.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\SFXImages_GameManual_10.pcc"
  339.  
  340.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor.pcc.bu2" 0 +2
  341.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor.pcc"
  342.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor.pcc"
  343.  
  344.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\Wwise_CitHub_Streaming.afc.bu2" 0 +2
  345.   Delete "$INSTDIR\BIOGame\CookedPCConsole\Wwise_CitHub_Streaming.afc"
  346.   Rename "$INSTDIR\BIOGame\CookedPCConsole\Wwise_CitHub_Streaming.afc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\Wwise_CitHub_Streaming.afc"
  347.  
  348.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BIOGame_INT.tlk.bu2" 0 +2
  349.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BIOGame_INT.tlk"
  350.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BIOGame_INT.tlk.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BIOGame_INT.tlk"
  351.  
  352.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_James_LOC_INT.pcc.bu2" 0 +2
  353.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_James_LOC_INT.pcc"
  354.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_James_LOC_INT.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_James_LOC_INT.pcc"
  355.  
  356.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_510CargoConv_LOC_INT.pcc.bu2" 0 +2
  357.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_510CargoConv_LOC_INT.pcc"
  358.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_510CargoConv_LOC_INT.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_510CargoConv_LOC_INT.pcc"
  359.  
  360.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_100Cabin.pcc.bu2" 0 +2
  361.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_100Cabin.pcc"
  362.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_100Cabin.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_100Cabin.pcc"
  363.  
  364.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\Coalesced.bin.bu2" 0 +2
  365.   Delete "$INSTDIR\BIOGame\CookedPCConsole\Coalesced.bin"
  366.   Rename "$INSTDIR\BIOGame\CookedPCConsole\Coalesced.bin.bu2" "$INSTDIR\BIOGame\CookedPCConsole\Coalesced.bin"
  367.  
  368.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioSnd_CitHub.pcc.bu2" 0 +2
  369.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioSnd_CitHub.pcc"
  370.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioSnd_CitHub.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioSnd_CitHub.pcc"
  371.  
  372.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_tha_inv_d_d_Int.afc.bu2" 0 +2
  373.   Delete "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_tha_inv_d_d_Int.afc"
  374.   Rename "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_tha_inv_d_d_Int.afc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_tha_inv_d_d_Int.afc"
  375.  
  376.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_thane_d_d_Int.afc.bu2" 0 +2
  377.   Delete "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_thane_d_d_Int.afc"
  378.   Rename "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_thane_d_d_Int.afc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\citprs_hosp_thane_d_d_Int.afc"
  379.  
  380.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\SFXGame.pcc.bu2" 0 +2
  381.   Delete "$INSTDIR\BIOGame\CookedPCConsole\SFXGame.pcc"
  382.   Rename "$INSTDIR\BIOGame\CookedPCConsole\SFXGame.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\SFXGame.pcc"
  383.  
  384.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_Miranda.pcc.bu2" 0 +2
  385.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_Miranda.pcc"
  386.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_Miranda.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_Miranda.pcc"
  387.  
  388.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_WardsFluxP3.pcc.bu2" 0 +2
  389.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_WardsFluxP3.pcc"
  390.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_WardsFluxP3.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_WardsFluxP3.pcc"
  391.  
  392.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_000LevelTrans_LOC_INT.pcc.bu2" 0 +2
  393.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_000LevelTrans_LOC_INT.pcc"
  394.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_000LevelTrans_LOC_INT.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_000LevelTrans_LOC_INT.pcc"
  395.  
  396.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_180DocksCop_LOC_INT.pcc.bu2" 0 +2
  397.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_180DocksCop_LOC_INT.pcc"
  398.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_180DocksCop_LOC_INT.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_180DocksCop_LOC_INT.pcc"
  399.  
  400.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos.pcc.bu2" 0 +2
  401.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos.pcc"
  402.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos.pcc"
  403.  
  404.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos_LOC_INT.pcc.bu2" 0 +2
  405.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos_LOC_INT.pcc"
  406.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos_LOC_INT.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Cat003_380DesksConvos_LOC_INT.pcc"
  407.  
  408.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP3.pcc.bu2" 0 +2
  409.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP3.pcc"
  410.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP3.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_CitHub_HospitalP3.pcc"
  411.  
  412.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_204Kro002_Debrief3_LOC_INT.pcc.bu2" 0 +2
  413.   Delete "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_204Kro002_Debrief3_LOC_INT.pcc"
  414.   Rename "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_204Kro002_Debrief3_LOC_INT.pcc.bu2" "$INSTDIR\BIOGame\CookedPCConsole\BioD_Nor_204Kro002_Debrief3_LOC_INT.pcc"
  415.  
  416.   IfFileExists "$INSTDIR\BIOGame\CookedPCConsole\Conditionals.cnd.bu2" 0 +2
  417.   Delete "$INSTDIR\BIOGame\CookedPCConsole\Conditionals.cnd"
  418.   Rename "$INSTDIR\BIOGame\CookedPCConsole\Conditionals.cnd.bu2" "$INSTDIR\BIOGame\CookedPCConsole\Conditionals.cnd"
  419.  
  420.   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  421.   SetAutoClose true
  422. SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement